Notifications
Clear all

[Closed] mergeMaxfile: keeping a list of what comes in

I’m making a tool that temporarily brings in a character animation file
and then cleanly deletes it

currently I use this

mergeMaxfile f #select #autoRenameDups  #renameMtlDups #neverReparent quiet:true
tempNodes=selection as array

...and then later...
delete tempNodes


the idea being that using #select will pass the merged nodes to an array.
but this fails on hidden or locked nodes, it seems, leaving behind too much cruft.
is there a better way?

3 Replies

many years i was using this method:

get number of objects before merge

all newly merged nodes are objects[before+1]+

was using… but the merge method can replace old dups.
so. the safest method is:


 -- before merge
oldnodes = objects as array
-- after merge
newnodes = for node in objects where finditem oldnodes node == 0 collect node

I remember that this is asked at least one time on the forum.

Before merge get the objects count. after mere get the objects count again. Then if you count the objects again all objects with index bigger than the first object count are incoming object.

Get the inode value of the objects before merge operation. The bigest inode index is the last created/merged/imported object. Get the inode value of the objects after that. All objects with inode value bigger than the bigest value before merge are marged.

Maybe my explanations are not so perfect. Search the forum and you will find better answers.

thanks for the help!