How to activate a node by name and refresh Node Properties UI in Mari 5.0 using Python script?

46 views
Skip to first unread message

Eri

unread,
May 11, 2023, 12:54:17 PM5/11/23
to Python Programming for Autodesk Maya
Hello everyone,

I am trying to create a Python script in Mari 5.0 to activate a node in the Node Graph window by its name and refresh the Node Properties UI for that node. I've attempted to do this by simulating a double-click event on the node, but I have been struggling to find the correct way to convert the node's position in the Node Graph coordinate system to the QWidget coordinate system.

Here's what I've tried so far:

1. Finding the node in the Node Graph using its name.
2. Setting the node as selected using node.setSelected(True).
3. Calculating the node position using node.nodeGraphPosition().
4. Converting the node position to the QWidget coordinate system using various mapFrom* methods (e.g., mapFromParent, mapFromGlobal).
5. Creating a QMouseEvent MouseButtonDblClick event with the converted position.
6. Sending the event to the Node Graph view using QApplication.sendEvent().

Unfortunately, none of the methods I've tried have worked so far. I believe the main issue is with the coordinate conversion step. I would greatly appreciate any help or suggestions on how to properly convert the node position and successfully activate the node and refresh the Node Properties UI.

Thank you in advance for your help!

Marcus Ottosson

unread,
May 13, 2023, 3:14:03 AM5/13/23
to python_in...@googlegroups.com
I'm not sure you got the right mailing list, this one is primarily for Maya and Python.

--
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/0cf5547a-3262-4744-8743-ec63df829004n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages