Unique identification of objects [SOLVED]
On 10/06/2015 at 09:56, xxxxxxxx wrote:
I'm making a c++ plugin that sends (and handles) a processing job to Deadline. The user selects one or more objects in their c4d file, and then the list of those object(s) are stored in the jobinfo file that is sent to Deadline. These are the objects that needs processing.
When a Deadline Slave opens the submitted file, my c4d plugin is passed the list of objects from Deadline (via the command line) Pluss several other parameters the user have set in the submission dialog in Cinema. Then the plugin processes those objects and saves the result to disk.
Right now i'm just storing the names of the objects, but this is not a very good solution as you can get duplicate names in the file.
Whats the best solution for identifying objects like this? Does objects in c4d have unique ids thats permanent from session to session? Or is it better to make custom tag that the user attaches to the objects they want processed?
Any advise is appreciated.
On 11/06/2015 at 09:53, xxxxxxxx wrote:
On 11/06/2015 at 10:33, xxxxxxxx wrote:
Thanks Niklas! Is this id consistent from session to session?
On 11/06/2015 at 10:38, xxxxxxxx wrote:
calling FindUniqueID() with MAXON_CREATOR_ID is the same as using the marker system with GetMarker(). This marker allows unique identification within a scene. With BaseObjects you can use GetGUID() to get an unique ID for that object based on the marker.
But these markers and IDs are only valid inside a certain document. In another document – or in a copy of that document – these IDs may have changed. This was discussed in this thread: "Render Plugin: DirtyState, UniqueId, ActiveDoc".
Another way to identify an object may be by using it's position in the hierarchy. An object may be the first child or a parent object that itself is the second child of another parent. That leads to an array of numbers like in the unique IP system used with RayObjects.
An alternative to using a tag to identify an object could be to set an ID with AddUniqueID(). But I'm afraid there is no official solution to this specific task.
On 11/06/2015 at 10:52, xxxxxxxx wrote:
I think i'll go for a tag solution. This makes it easier for the artist to debug the scene if errors happens or the result of their processing job is not as expected.