[Bf-python] A few notes

models at paposo.com models at paposo.com
Fri Sep 19 01:22:37 CEST 2003


Just a suggestion about the object pointer...:

You covered Object.link() and Object.getData() and PutRaw() nicely :)
There are 3 ways of getting a new NMesh from inside of the nmesh module:
1.New
    a) calls new_NMesh
2.GetRaw
    a) calls new_NMesh
3.GetRawFromObject
   a) calls new_NMesh_internal for displists
   b) or calls new_NMesh for no displists

Right now the object pointer is set in new_NMesh_internal. Right now you
have New, GetRaw, and GetRawFromObject all setting nmesh->object to NULL.
This is good for New because there's no object.
1) For GetRaw you could be getting a mesh datablock that is linked to 1 or
more objects. You could test to see if the usercounts = 1 and find the
object it's linked to, else set as NULL.
2) For GetRawFromObject the mesh might not use displists, in which case it
calls new_NMesh instead of new_NMesh_internal.  Here you could pass the
object as a parameter to new_NMesh if there is no displist.

So I was thinking maybe new_NMesh could take a Object* pointer.
a) For New() this would be NULL
b) For GetRaw(), GetRaw() could check usercounts to see if it's linked to a
single object, in which case it would search for the linked object and pass
it as a parameter, else NULL. (this might be more difficult)
c) For GetRawFromObject() if there are no displists new_NMesh is called with
the object pointer. If there are displists you would pass NULL as the 4th
parameter to new_NMesh (instead of calling new_NMesh_internal).

just an idea.  I see about testing things out.




More information about the Bf-python mailing list