Ok, so I know Soya was built to have all images in one directory, worlds
in another, and so on.
But you know, things get really messy really fast when you do it like
that. Especially when you have multiple developers/artists.
So I restructured our data directory to have subdirectories. Not
multiple data directories (where multiple ./data/ ./data2/ etc would be
added to the soya path) but seperate directories under ./data/images etc
IE:
./data/images/hulls/
./data/images/engines/
./data/images/weapons/
./data/worlds/hulls/
./data/worlds/engines/
./data/worlds/weapons/
./data/src/hulls/
.. etc
Then call these as soya.Shape.get('hulls/mosquito'). This works good
for shapes (worlds), but I needed to patch up the blender2soya script as
well as a line in soya's __init__.py:
blender2soya.py:
51,52c51,56
< PATH =
os.path.join(os.path.dirname(Blender.Get("filename")), "..")
< FILENAME =
os.path.splitext(os.path.basename(Blender.Get("filename")))[0]
---
>
> #PATH =
> os.path.join(os.path.dirname(Blender.Get("filename")), "..")
> #FILENAME =
> os.path.splitext(os.path.basename(Blender.Get("filename")))[0]
> cutpoint = Blender.Get("filename").find('src/')
> PATH = Blender.Get("filename")[:cutpoint]
> FILENAME = os.path.splitext(Blender.Get("filename")[cutpoint+4:])[0]
316c320,321
< image_filename = face.image.name
---
> #image_filename = face.image.name
> image_filename = FILENAME+'.png'
and in __init__.py:
293c293
< image = Image.get(os.path.basename(image_file))
---
> image = Image.get(image_file[image_file.find('images/')+7:])
The only additional thing missing is that it doesn't create the
materials/ and shapes/ subdirectories on the fly yet.
I should note that use of this style is still optional. The only thing
doing it this way prevents is that you must use the /images/ and /src/
conventions - but I'm fairly certain it was already this way.
--
Diversity is the Fuel of Evolution,
Conformity it's Starvation.
Be Radical. Be New. Be Different.
Feed Evolution with Everything You Are.