Notifications
Clear all

[Closed] Select Last new scene Node

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

3 Replies

 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.

Try this one also.

select (objects as array)[(objects as array).count]

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