On 4/15/08, David Eyk <[EMAIL PROTECTED]> wrote: > > I'm excited about the pyglet.resource module, and the ability to set > up custom loaders for modules and packages. > > Here's my problem: I'm working on a large project, with an artist who > would prefer to organize art assets in an arbitrarily deep folder > structure. I *could* register each folder manually w/ the resource > loader, but this sounds error-prone with so many possible folders. > > The artist and I have agreed to unique filenames, so I don't see why I > shouldn't be able to auto-index the folder structure, but I don't see > an obvious way to do this with the current Loader setup. Has anybody > done anything like this? > > (I'm using pyglet 1.1alpha2, but it looks like this hasn't been solved > in the latest revision.) >
I ran into a similar issue during PyWeek, and decided to just enforce unique filenames and add each path under res/ explicitly. It obviously would not be difficult to os.walk over a directory and add everything to the path for resource to index, but I think that's kind of working around the real issue. Which is that we want to be able to have some resources indexed by a partial path + name. Say, 'tiles/water.png' should be a separately indexed resource to 'animations/water.png'. Asking the artist to keep unique filenames is risky, in my opinion. The current resource indexing method can't do this, but I think it's worth considering (and breaking compatibility for). I'd welcome any suggestions/comments/patches related to this :-) Alex. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
