How to get Empty's name for linked library?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
grzybu
Posts: 0
Joined: Wed Aug 04, 2004 8:40 am
Contact:

How to get Empty's name for linked library?

Post by grzybu » Fri May 15, 2009 4:20 pm

Hi,

I wonder how to get empty's name in case of linked library objects in python?
I have i.e. mesh object list but if I check object.name then I have many object with the same name if they use the same library or just have the same name in different libraries. I need unique names of those object and best I think will be just add empty's name to object.name.
Then I'll be sure I have unique name of object.

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Fri May 15, 2009 11:50 pm

The name together with the path to the linked library already is unique.

If you want to, you could also use UUIDs you generate yourself and put them in custom properties.

/Nathan

grzybu
Posts: 0
Joined: Wed Aug 04, 2004 8:40 am
Contact:

Post by grzybu » Mon May 18, 2009 9:14 am

jesterKing wrote:The name together with the path to the linked library already is unique.

If you want to, you could also use UUIDs you generate yourself and put them in custom properties.

/Nathan
The problem I have is when I link some group, and I have there object called i.e. Cube, then each instance of this group contains object named Cube.
This is what I get with object.name. Also object.lib value is the same for each object, because they are instances of the same group. So I have multiple objects with the same combination of object.lib and object.name.
But each instance is child of an Empty. And if I can somehow find Empty's name then I'll have unique id of object.
UUID generation is good idea but not such straight forward in case you want to modify scene in blender and then reexport it. Then you don't see properties in 3d window.
Knowing Empty's name is all what I need.

Post Reply