Notifications
Clear all

[Closed] How to snapShotAsMesh a node.baseObject

I was wondering how to snapshotasmesh a node’s baseobject :

snapshotasmesh ($.baseobject)
 -- Runtime error: snapshotAsMesh requires a node

i’ve tried this but new mesh has coords [0,0,0] :

m = mesh mesh:$.baseobject.mesh

I’d like to get the geometry before any modifier, in local coords.

2 Replies

m = $.baseobject.mesh
it’s at [0,0,0] because it is in local coord.
i guess m = mesh mesh:$.baseobject.mesh transform:$.transform
doesn’t get you what you want.

try this :

nod = selection[1]
otm = nod.objecttransform
tri = nod.baseobject.mesh 
for v in tri.verts do setvert tri v.index (v.pos*otm)
msh = mesh mesh:tri

Thanks Gumtoo,

my mystake, i’m always confused with local and world coords.
I need my node.baseobject not at [0,0,0] but at its original transform, so i guess in world coords.

Creating a new mesh from any triMesh, resets coords to [0,0,0].
So a solution for me would be like the one you said :
m = mesh mesh:$.baseobject.mesh transform:$.transform

So for example :


 	delete objects
 	nod = Teapot name:"TP" wirecolor:green transform:(matrix3 [0.453313,0.890372,-0.0417702] [-0.805494,0.389132,-0.44694] [-0.381689,0.236249,0.893588] [-110.614,-33.7841,18.417])
 	addmodifier nod (Spherify())
 	nm = mesh mesh:nod.baseobject.mesh transform:nod.transform name:"nm" wirecolor:red