[Bf-committers] Proposed changes re: procedural textures
Emanuel Greisen
blender at emanuelgreisen.dk
Wed Nov 22 08:46:43 CET 2006
>
> if(tex->type)
> retval = textypes[tex->type].render_func(tex,texvec,texres);
>
May I suggest that it be take into account that this design depends on
every texture having a unique "id", which actually is an index into an
array. Hence if two developers both make a new texture (independently)
their indexes will collide.
To avoid such things on the projects I have resently been working on we
use GUIDs (http://en.wikipedia.org/wiki/Globally_Unique_Identifier).
These are by definition unique, hence there is no risk of collision.
A generator can be found here:
http://kruithof.xs4all.nl/uuid/uuidgen
If we could design it such that these were used to look up the texture,
then new textures could be added both builtin and as plugins with no
risk of identifier collision. I know that this would most likely require
a change in the texture-struct, and thereby a change in the file-format.
But it could be possible if we have a backward compatibility table for
the old index based system.
Also, this could be used for any "plug-in" like situation, like the
modifiers, etc. Giving developers an option to easily extend blender
with new functionality, without having to specify anything but a GUID to
be uniquely identifiable in blender.
./Emanuel
More information about the Bf-committers
mailing list