PDA

View Full Version : Select Last new scene Node


Snoelk
04-12-2008, 09: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 :)

shibumenon
04-12-2008, 10: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.

mir-vadim
04-12-2008, 12:03 PM
Try this one also. :)
select (objects as array)[(objects as array).count]

Snoelk
04-12-2008, 12:54 PM
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

newmesh=meshop.detach
or
polyop.detach
latestObj = (returnLastObj())
select latestObj
or via the counter

thanks for the hints :)

CGTalk Moderation
04-12-2008, 12:54 PM
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.