[Closed] Clone nodes not acting the same as original
Hi
I have a script that checks the density of pixels on a given editable poly object, it color codes the faces depending on how close they are to a target density, green is correct red is too dense blue is too low.
This all works fine but I’m modifying the actual mesh asset so if there is any vertex colors that the artist want to keep its destroying them, not good. Simple answer duplicate the meshes run the script on them and then instead,
and here is the problem
Im using maxOps.cloneNodes then passing the new node into the same function and get a different result!
I have also tried creating a new mesh with snapshotAsMesh an i get the same incorrect results, and here is the kicker, its not consistent, when i run it 5 times ill get different vertex colors but when i dont duplicate the mesh i get completely accurate consistent results.
Anyone have any thoughts? It seems like im missing something really fundamental here
Here is what i mean in codeyness
--WORKS
objs = selection as array
doDensityVertexColoring objs 0.1 128
-- FAILS!
originalObjs = selection as array
maxOps.CloneNodes originalObjs offset:[0,130,0] expandHierarchy:on cloneType:#copy actualNodeList:&anl newNodes:&nnl
objs = nnl --not really needed could just call doDensityVertexColoring with nnl
doDensityVertexColoring objs 0.1 128
Dave
when max clones nodes it make copies of all channels (including vertex color).
it shouldn’t be a ‘different’ results.
what if do just
copy <a node>