[Bf-python] Texture API- first "sketch"

alex mole nal at blueyonder.co.uk
Wed Nov 12 17:27:29 CET 2003


This makes sense to me :)
Should an exception be thrown if the user does something invalid [sets 
an ENVMAP stype when the type is IMAGE?


alex



Willian Padovani Germano wrote:
> Hi,
> 
> 
>>What about the stype member though? This stores a number that means
>>different things depending on what type of texture it is [if it is an
>>envmap texture, stype=0 means something totally different than if it's a
>>cloud texture]. Should there just be a constant dict which contains all
>>the possible values, with names like 'ENV_ANIM' or 'CLD_COLOR', and
>>leave figuring out the proper ones to use to the scripter? This seems
>>like the most reasonable option....
> 
> 
> That's a good way, since script writers can then consult the docs to see
> what each thing means.  For the set???() method for this, maybe you could
> standardize a little and accept the string "Default" for stype==0, where
> then default would mean something different for each tex type.  Then in the
> switch/case statements or if/if else, depending on your preferences:
> 
> [pseudo code with bogus examples]
> 
> switch (textype) {
>   case EXPP_TEX_TYPE_CLOUD:
>      if (!strcmp(arg, "Default") || !strcmp(arg, "Color") { ... }
>      else if (!strcmp ...
>      ...
>      break;
>   case EXPP_TEX_TYPE_ENVMAP:
>      if (!strcmp(arg, "Default") || !strcmp(arg, ...
> 
> you got the picture.
> 
> --
> Willian, wgermano at ig.com.br
> 
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://www.blender.org/mailman/listinfo/bf-python
> 



________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________



More information about the Bf-python mailing list