Get python instance from custom plug in node.

35 views
Skip to first unread message

Simone Tartaglia

unread,
Apr 5, 2016, 6:14:43 AM4/5/16
to Python Programming for Autodesk Maya
Hello everyone, I've tried to google around but I couldn't find the answer to what seems a really stupid question.
I've got a custom maya plug-in node that I've scripted in python.
In the  python plug-in module, I've defined some python attributes in the __init__ and postConstructor method, which I'd like to get after the maya node has been created.
I can't find a way to get the python underlying instance of my custom maya node.

I hope someone can shed a bit of light on my issue!

hugs.

Justin Israel

unread,
Apr 5, 2016, 5:41:07 PM4/5/16
to Python Programming for Autodesk Maya
Hi Simone,

As far as I know, you are supposed to treat the custom node as an interface and not think about the underlying Python instance, which acts as a delegate for satisfying interface functions. That is, if you create a Node that was defined by a scripted plugin, you shouldn't expect to be able to access the real underlying python instance, externally to that class. Can your attributes be stored as proper Node attributes? What kind of attributes are you trying to expose?

Justin


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ad703fdc-50bb-4a7d-882a-ba44a9030ce7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simone Tartaglia

unread,
Apr 6, 2016, 6:19:03 AM4/6/16
to Python Programming for Autodesk Maya
Hi Justin,

thanks for your reply, to be honest, the attributes I'm trying to access to, are nothing that I can't implement through the maya dependency node.
It was merely curiosity.
That's because the python instance coexist with the dependency node object, in fact, trying to print an instance's attribute through the compute method of the node, returns the value of the attribute. 
So the instance is there with the node, but unreachable.
Reply all
Reply to author
Forward
0 new messages