New Condition Naming in Attribute Manager
-
Hello, I noticed there seemed to be a new 'name' feature with the Condition object.
Is it possible to make use of it in a plugin?'Condition' is just the object's Name, but I can't figure out how 'distance' is set.
Dan
-
Hey @d_schmidt,
Thank you for reaching out to us. That feature has existed since Pyro was introduced but at the same time it is also an internal feature, i.e., a feature of which we publish the components, but which we do not support in public usage. To realize a node which supports name additions, you must register it with the flag OBJECT_CUSTOM_NAME_ADDITION:
RegisterObjectPlugin(ID_MY_PLUGIN, GeLoadString(IDS_MY_PLUGIN), otherFlags | OBJECT_CUSTOM_NAME_ADDITION, MyPlugin::Alloc, "omyplugin"_s, nullptr, 0);
Reading or writing to the custom name is then realised via the node message MSG_GETCUSTOM_NAME_ADDITION. I am showing the write access in C++:
Bool MyPlugin::Message(GeListNode* node, Int32 type, void* data) { ... switch (type) { // Something, for example the Object Manager, wants to know the addition to the name. The // message data is just an empty string. The plugin should return the addition to the name. case MSG_GETCUSTOM_NAME_ADDITION: { *reinterpret_cast<String*>(data) = "Hello World"_s; break; } default: break; } ... }
And since nothing is safe from @m_adam , I just found out that he wrapped the reading part for Python (cannot see the writing part handled in Python). Since you cannot cast arbitrary data in Python, we must use a dictionary as the data container.
Cheers,
Ferdinand -
Thank you so much! I couldn't ask for a more thorough response.
Dan