Notifications
Clear all

[Closed] Assign an object name to another object

hi everyone!
helped by the listener I’ve written a litte script:

into my scene there are more or less 100 group object; each group object has inside 3 or 2 mesh object that identify a Tree model.
Each group is yet correctly positioned and named for example:
-walnut_01
-mesh_01_foliage
-mesh-01_trunk
-pear_tree_01
-mesh_01_trunk
-mesh_01_branch

… and so on

Now I’d like to create a proxy object for each tree model so the scene could be better managed.

I’ve written this little script:

  1. max hide inv

  2. max group ungroup

  3. macros.run “VRay” “vrayMeshExport”

  4. max select all

  5. max group group

  6. max unhide all

  7. I isolate selected group

  8. ungroup it

  9. run vrayExport mesh tool and click OK

  10. select all new vrayproxy objects

  11. group them

  12. unhide all other tree models

It works correctly, but I’d like to update it: I don’t want to lose tree model names, so till now before run the script I copy on the clipboard the “group object” name and then I paste it when I group the new proxy objects.

Can some one help me to update the script in the way that once selected the original “group object” :

  1. Create a variable with the name of the selected “group object”
            1. (run the script)
  2. rename the new “group proxy object” like the one before using the variable I’ve saved

I hope I was clear enough, sorry for the length of the post.

Thank you very much for any kind of help!