On 07/02/2018 at 09:02, xxxxxxxx wrote:
Hi,
welcome to the Plugin Café forums 
Cinema 4D actually doesn't care for the name of objects at all. There are a few special objects, where only the first enabled object in the scene has an effect (like e.g. background). You can use GetHighest() to find the effective object.
Adding meta data to objects can be achieved in different ways:
The technically best (or rather say recommended) way is to create a custom tag (may also be hidden from the user), which
carries the needed data and may or may not expose the data via a parameter description. See TagData plugins for this.
Here's a Python example of a TagData plugin, even if it's doing a bit more than just adding data: Py-LookAtCamera.
Probably the easiest way of adding data to an object (or a scene... or any other NodeData derived entity) is to simply store it in it's BaseContainer (see GetDataInstance()). For this make sure to get a unique ID here from the forum. Then store your own BaseContainer with this unique ID inside of the entity's BaseContainer (basically entitiesBc.SetContainer(uniqueId, yourCustomContainer) ). Within your own BaseContainer you can store whatever data you want. Of course in this simple scenario the data does not get exposed to the user.
Your User Data approach is of course also an option. Really depends on your needs, what works best for you.
Just for completeness sake, if you wanted to add data to a scene, the technically correct way would be via a SceneHook plugin, but that's not available in Python (link leads into C++ docs). So you would need to go the above described BaseContainer route.