NMesh module, new function, GetRawFromRender(object_name)

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
jms
Posts: 33
Joined: Sat Oct 19, 2002 3:04 pm

NMesh module, new function, GetRawFromRender(object_name)

Post by jms » Sun Mar 12, 2006 1:04 pm

Python API
I am currently trying to add a new function to the NMesh module : GetRawFromRender(object_name) .

The aim : to get the geometry which is modified by displacement mapping, or added by particules strand and 'dupliverted' or 'dupliframed' object . These data are not available by the display list of the object and the GetRawFromObject() ignores all of them .

A test can be done with this win32 compilation :
http://www.zoo-logique.org/3D.Blender/i ... p3?zoo=com
An example file can be downloaded from this url :
http://www.zoo-logique.org/3D.Blender/n ... tachment=1
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo » Sun Mar 12, 2006 7:50 pm

would this also be helpful for getting the subdivision surface mesh (for example for exporters)?

or is there another way to access the sds mesh i haven't found yet?

Bagration
Posts: 0
Joined: Sun May 01, 2005 2:12 pm

Post by Bagration » Sun Mar 12, 2006 9:28 pm

kakapo wrote:would this also be helpful for getting the subdivision surface mesh (for example for exporters)?

or is there another way to access the sds mesh i haven't found yet?
http://www.elysiun.com/forum/viewtopic.php?t=60971

I haven't tried it myself though...

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo » Sun Mar 12, 2006 10:23 pm

hm... the question of the thread starter didn't seem to get answered.

is it possible for a script to export a sds mesh (for example level 2) without requiring the user to finally apply the modifier?

jms
Posts: 33
Joined: Sat Oct 19, 2002 3:04 pm

Post by jms » Tue Mar 14, 2006 9:41 pm

kakapo wrote:hm... the question of the thread starter didn't seem to get answered.

is it possible for a script to export a sds mesh (for example level 2) without requiring the user to finally apply the modifier?
For such a simple thing you could use the NMesh.GetRawFromObject() function or the Mesh.FromObject .
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo » Wed Mar 15, 2006 7:31 pm

what do you mean? mesh.getfromobject just gives me the base mesh (subdivision level 0) no matter what the subsurf modifier is set to. how would i get the subdivision level 2 mesh for example?

jms
Posts: 33
Joined: Sat Oct 19, 2002 3:04 pm

Post by jms » Wed Mar 15, 2006 10:57 pm

kakapo wrote:what do you mean? mesh.getfromobject just gives me the base mesh (subdivision level 0) no matter what the subsurf modifier is set to. how would i get the subdivision level 2 mesh for example?
So use NMesh.GetRawFromObject(), it returns exactely the render
state of the subsurf modifier .
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo » Thu Mar 16, 2006 12:34 am

ok, thanks! i will try that. will the mesh module get something similar (since it looks like the nmesh module will get abandoned)?

jms
Posts: 33
Joined: Sat Oct 19, 2002 3:04 pm

Post by jms » Thu Mar 16, 2006 9:03 pm

kakapo wrote: it looks like the nmesh module will get abandoned)?
Not a good idea, we really need a 'thick' mesh wrapper .
A thin wrapper like Mesh, can't be used to manage a
"rendermesh" with correct normal but nobody seems to
see this simple thing .
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.

Post Reply