Got everything, but it has no concept of object in the scene. Is there a way to take a class instance and figure out what node/object it is in the scene graph for renaming, selecting etc?
The real problem with classof o is that the class is mutable and if you have a modifier on the stack, the object might appear as an EditableMesh instead.
For example, create an XMesh Loader, select it and run:
classof $
-->XMeshLoader
addModifier $ (Bend())
-->OK
classof $
-->Editable_mesh
This is why a modified XMesh Loader might not get collected by
theLoaders = (for o in objects where classof o == XMeshLoader collect o)
But if you ask for the base object instead…
classof $.baseobject
-->XMeshLoader
In other words,
theLoaders = (for o in objects where classof o.baseobject == XMeshLoader collect o)
This should find any XMesh Loader, with or without modifiers!