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

alex mole nal at blueyonder.co.uk
Wed Nov 12 16:30:54 CET 2003


That's a good point. My reasoning for doing it this way is that you want 
to allow the script to understand which channels the textures are 
assigned to, so returning a sequence NCHANNELS long seems like a good 
idea. The reason I chose a tuple is because I wanted to reinforce the 
fact that changing the list would have no effect on the material 
[setTexture() or clearTexture() must be used for this].

I can remove the references to '8' though, so the doc would change to:

getTextures()- Returns the texture channels as a tuple of Texture
                objects or None if the channel is empty


That any better? If the number of channels increases, so could the size 
of the tuple that gets returned.


Alex


Kent Mein wrote:
>>As well as creating this new module, I plan on adding the following 
>>functions to Material.Material:
>>
>>getTextures()- returns the 8 texture channels as an 8-tuple with None
>>               for empty channels and Texture objects in the rest
>>
>>setTexture(num,tex)- set channel _num_ to texture _tex_
>>
>>clearTexture(num)- remove a texture from channel _num_
> 
> 
> It would be really nice if it used a list instead of a fixed 8.
> I'm sure in the future we will be expanding it so a material can have
> more channels.  Maybe not right away but since were working on this stuff now
> it might be nice to make it expandable.
> 
> Just an idea.
> 
> Kent



________________________________________________________________________
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