Get type name by Id
rsodre last edited by
This sounds like a very basic question, I'm probably skipping a very clear concept, but I can't find the answer anywhere...
How Can I get the type name of a custom object from the type id only?
This is what I'm doing but I'm sure there should be some API call that does the same:
auto baseObject = BaseObject::Alloc( operatorTypeId ); auto name = baseObject->GetTypeName(); BaseObject::Free( baseObject );
iluxa7k last edited by
This post is deleted!
// find plugin const BasePlugin* const plugin = FindPlugin(pluginId, PLUGINTYPE::ANY); if (plugin == nullptr) return maxon::UnexpectedError(MAXON_SOURCE_LOCATION); // print plugin name const maxon::String name = plugin->GetName(); ApplicationOutput("Plugin Name: @", name);
And if you are only interested in BaseObjects, there is also GetObjectName().
See BaseObject Manual.
rsodre last edited by rsodre
@s_bach I've tried GetPlugin but even returning the BasePlugin pointer, GetName() was always empty for my custom baseObjects. Edit: GetName() works, GetTypeName() don't.
But GetObjectName() is perfect for me, thanks!