Skip to content

Instantly share code, notes, and snippets.

@fwilleke80
Last active July 18, 2019 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwilleke80/f110061f9b4f14b95e32e0687364eea9 to your computer and use it in GitHub Desktop.
Save fwilleke80/f110061f9b4f14b95e32e0687364eea9 to your computer and use it in GitHub Desktop.
[C4D] A function that finds the name of a plugin by ID, and even works for builtin BaseList2D elements that are not registered plugins
def GetPluginName(pluginId, pluginType=c4d.PLUGINTYPE_ANY):
# Check if it's the ID of a registered plugin
foundPlugin = c4d.plugins.FindPlugin(pluginId, type=pluginType)
if foundPlugin is not None:
return foundPlugin.GetName()
# It's not the ID of a registered plugin, but might still be a builtin
# Try to allocate a new instance, and get type name
newObj = c4d.BaseList2D(pluginId)
if newObj is not None:
return str(type(newObj).__name__)
# No idea what this is
return "N/A"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment