0

Is it possible to copy the name of one object to another using python, as well as save the initial name state?

For example: A Cube and Cylinder are in the scene. Save the name-state of Cylinder. Copy the name from the cube, "Cube" and give the Cylinder that name ("Cube"). Do whatever action(s) to the Cylinder, then rename it back using the name-state. So essentially it will be renamed back to "Cylinder".

So this is a two part question:


How to copy the name from one object to another.

How to save and then access the name-state of an object for later use in a script.

Increality
  • 411
  • 3
  • 14
  • 2
    Two objects in blender cannot have the same name. Would seriously reconsider this approach. – batFINGER Jun 14 '20 at 04:00
  • It's fine if the Cube in this example gets deleted. Or better yet, it could be an empty's name that get's copied, the empty get's deleted, and then the name get's placed on the cylinder. Either way, is it possible to save one objects name at one point, and then access the name-state later on (say the name gets changed and you want to revert back)? Thank you for your response. – Increality Jun 14 '20 at 04:58
  • 1
    IMO using a pointerproperty https://blender.stackexchange.com/a/165885/15543 is the way to keep a reference to another object. Set up a property group to also store the name at some state if required. – batFINGER Jun 14 '20 at 09:57

0 Answers0