[Bf-python] Another Mesh question

Ken Hughes khughes at pacific.edu
Fri Mar 3 18:43:50 CET 2006


Chris Want wrote:
> 
> I've been using the docs in CVS. Is there a wiki
> document I should be looking at instead? Is there
> an example that sets vertex colors for a face?
> Grepping release/scripts/*.py yeilds nothing.
> 
> The one thing I don't like having to do is rewriting
> my scripts because of API changes, so if adding constructors
> means rewriting, then I'm against it. Also, if adding
> constructors slows things down, I'm against it -- I
> like that this module was built for speed. Really,
> I think all that's needed is some more clear examples.

Ok, I'm typing this during a bout with the flu or a cold or something, 
and colors are swimming in my peripheral vision, so take this 
explanation with that in mind....

The face.col attribute returns a tuple of MCols and takes a list or 
tuple of MCols.  There is no constructor for MCols, so right now the 
only way to assign MCols to a face is to read the existing values, then 
change them:

cols = face.col
for col in cols:
     col.r = 0

If you want, you can also just set them directly:

face.col[0].r = 0

Ken



More information about the Bf-python mailing list