Object-Referencing without Names

On 14/07/2013 at 10:22, xxxxxxxx wrote:

Hey guys,

i was wondering if there's any way of referencing a specific object inside the document without it's actual name but rather by it's ID.

So that i can generate a lot of objects together with a single python tag referencing all of them and doing it's thing.
At the moment I'm using a list of all the object-names, but if the user wants to rename one of the objects, the link will break. This is exactly what I want to prevent by using IDs.

I already found a GetUniqueIP()-function but all it returns is 0 for every object.

Any ideas?

greetings
phsn

On 14/07/2013 at 10:59, xxxxxxxx wrote:

Why not just use a Link Box or In/Exclude list? This does not also prevent the loss of the link
to the object, but is also a whole lot faster than searching for the object by name in the object
tree.

-Nik

On 14/07/2013 at 11:41, xxxxxxxx wrote:

as niklas has already pointed out, c4d is strictly oo when it comes to object references. objects are meant to be referenced by the gui elements niklas mentioned or as child/parent of xyz. however in r14 a ID system has been introduced to generate IDs and IPs for objects. IPs have to be set by yourself ( so that you can 'mark' objects ), while IDs are automatically generated .

BaseObject.GetUniqueIP()
BaseObject.SetUniqueIP()
BaseObject.GetGUID() <- that is the one you are looking for

the subject does come up here on a regular basis and although it is possible now, you should be aware of the fact the identifying objects with their id is a rather uncommon approach in the c4d api.

On 14/07/2013 at 12:39, xxxxxxxx wrote:

Thanks a lot for the answers! You helped me out 🙂

An In/Exclude-List solved my problem. I attached it via Script to the Python-Tag itself, also generated by the Script, so its not even very disturbing for the user in the end, since it's kind of an "internal list"