I'm trying to use your declarative plugin syntax. I pasted your sample class, but then I'm not sure how to instantiate it?
I tried:
node = cmdx.create_node(MyNode)
but Maya complains:
TypeError: '<class 'MyNode'>' is not a valid node type
I then tried:
node = cmdx.create_node("MyNode")
but now:
TypeError: 'MyNode' is not a valid node type
I can simply do:
node = MyNode()
... but then I don't know what to do with the node (how to register it in the DAG).
Apologies for being quite the Maya noob, so what I'm trying to do might be misguided. What I really want to do is create my own node type, so I can add it to the scene, and serialize it/store information in it. I'm not sure it's easily done, I could I guess use custom attributes for this, but I was looking for a more "strongly typed" approach.
Oh, and I believe there's a typo in your example, there's no MTypeId in cmdx, IMO it should be simply typeid = cmdx.TypeId(0x85006) (no M).
I'm trying to use your declarative plugin syntax. I pasted your sample class, but then I'm not sure how to instantiate it?
I tried:
node = cmdx.create_node(MyNode)
but Maya complains:TypeError: '<class 'MyNode'>' is not a valid node type
I then tried:
node = cmdx.create_node("MyNode")
but now:TypeError: 'MyNode' is not a valid node type
I can simply do:
node = MyNode()
... but then I don't know what to do with the node (how to register it in the DAG).Apologies for being quite the Maya noob, so what I'm trying to do might be misguided. What I really want to do is create my own node type, so I can add it to the scene, and serialize it/store information in it. I'm not sure it's easily done, I could I guess use custom attributes for this, but I was looking for a more "strongly typed" approach.
Oh, and I believe there's a typo in your example, there's no
MTypeId
incmdx
, IMO it should be simplytypeid = cmdx.TypeId(0x85006)
(no M).