Eri
unread,May 11, 2023, 12:54:17 PM5/11/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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!