[Bf-python] NMesh Q

models at paposo.com models at paposo.com
Sat Sep 6 00:42:59 CEST 2003


I am going to answer myself here. I thought this was interesting...

    The getattr callback is used when you are calling an Index.
i.e. Vertex.no[1] = 3.0 or Vertex.co[2] = 3.0, etc. (getattr called)
i.e. print Vertex.no[1]  (getattr called)
    However, if you are not calling an index you are by default calling an
attribute of the class so setattr gets if your setting or getattr gets
called if your getting.
i.e. Vertex.index = 3. (setattr called)
i.e. print Vertex.index (getattr called)
   That's why there is no setattribute for 'co' or 'no' in the vertex
class - because they will always be called by index. It also explains why
'uvco' has a setattr and a getattr:
i.e. Vertex.uvco[0] = 3.0 (calls getattr version)
i.e. Vertex.uvco = (1.0, 3.0) (calls setattr version because its called as a
member of vertex)

Anyway I couldn't find this info anywhere else.. Ill be quiet now.




More information about the Bf-python mailing list