[Bf-python] Mesh Keys

Willian Padovani Germano wgermano at ig.com.br
Mon Jul 7 20:40:58 CEST 2003


On Sun, 2003-07-06 at 16:06, Manuel wrote:
> Another little question. What's the difference between this
> two method (using an object named ME:foo_a OB:foo_b) ? 
> I hope to remember it correctly.
> 
> 1)
> 
> obj = Blender.Object.Get("foo_a")
> if obj.getType() = "Mesh":
>     objData = obj.getData()
>     print objData.faces
> 
> 2)
> 
> obj = Blender.Object.Get("foo_a")
> if obj.getType() = "Mesh":
>     meName = obj.getData().name
>     objData = NMesh.getRaw(meName)
>     print objData.faces
> 
> I think the first is more "clear"...

Yes, it sure is.  When you start with Object, it's the better way to
go.  There isn't any difference in the end, you can use any of these 2
ways.  But the second one is redundant, with obj.getData() you're
already "grabbing" the mesh, so no need for the objData = NMesh ...
line, better to use way # 1) above.


--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list