View Full Version : Select Last new scene Node

04 April 2008, 08:28 AM
got a problem with polyop.detachface and assigning the attached new object to a variable

here is the current script section

polyop.detachFaces theCopiedObject theEdgeMasterFaceList delete:true asNode:true name:"___DEL__cloneMasterMeshAtEdge"

cloneMasterMeshAtEdge = GetNodeByName ("___DEL__cloneMasterMeshAtEdge")

the problem now
the section in the script runs multiple times until theCopiedObject has no faces left
but each time it ataches 01 to n at the string name.

is there a way to directly assigning the current polyop.detachface to cloneMasterMeshAtEdge without selecting it via names ?
is there any option to get the last created scene node?

thanks in advance :)

04 April 2008, 09:17 AM
fn returnLastObj =
allObjs = $* as array;
theLastHandle = 0;
for obj in allObjs do
if obj.inode.handle > theLastHandle then
theLastHandle = obj.inode.handle;
theLastNode = maxOps.getNodeByHandle theLastHandle;

latestObj = (returnLastObj());
select latestObj;

should give you the last created object without depending on names.

04 April 2008, 11:03 AM
Try this one also. :)
select (objects as array)[(objects as array).count]

04 April 2008, 11:54 AM
thanks for the help

are those options faster then the direct assignment via meshop.detach ?

im not sure whats different and faster for large meshes

latestObj = (returnLastObj())
select latestObj
or via the counter

thanks for the hints :)

CGTalk Moderation
04 April 2008, 11:54 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.