Enter code here...
nodes_to_display = cmds.ls(sl=True)
title = 'Custom Node Editor Window'h = 700w = 950window_name = cmds.window(title, height=h, width=w)
form_layout = cmds.formLayout()custom_node_editor = cmds.scriptedPanel(type="nodeEditorPanel", label="My Node Editor")cmds.formLayout(form_layout, e=True, af=[(custom_node_editor, s, 0) for s in ("top", "bottom", "left", "right")])cmds.showWindow(window_name)
editor_name = custom_node_editor + "NodeEditorEd"
print "Clear node editor"cmds.nodeEditor(editor_name, e=True, rootNode='')
print "adding nodes"for node in nodes_to_display: cmds.nodeEditor(editor_name, e=True, addNode=node)
print "layout nodes"cmds.nodeEditor(editor_name, e=True, layout=True)
print "frame nodes"cmds.nodeEditor(editor_name, e=True, frameAll=True)
Hi allI'm trying to write a script to display a node editor, populate it with a given list of nodes and frame them. Unfortunately when running in python, maya mostly only completes the first step of displaying the scriptedPanel node editor I'm making. Occasionally when running this code I do get a node editor with the nodes added, but not framed.Even though I have the name of said editor, the commands to add nodes and frame them do nothing when everything is run in one execution. If I run them separately and individually it works great!I've tried using evalDeferred and utils.executeInMainThreadWithResult() to create the window first then run the nodeEditor commands, but no luck there.Any thoughts on how to approach this problem?
Thanks!Enter code here...nodes_to_display = cmds.ls(sl=True)title = 'Custom Node Editor Window'h = 700w = 950window_name = cmds.window(title, height=h, width=w)form_layout = cmds.formLayout()custom_node_editor = cmds.scriptedPanel(type="nodeEditorPanel", label="My Node Editor")cmds.formLayout(form_layout, e=True, af=[(custom_node_editor, s, 0) for s in ("top", "bottom", "left", "right")])cmds.showWindow(window_name)editor_name = custom_node_editor + "NodeEditorEd"print "Clear node editor"cmds.nodeEditor(editor_name, e=True, rootNode='')print "adding nodes"for node in nodes_to_display:cmds.nodeEditor(editor_name, e=True, addNode=node)print "layout nodes"cmds.nodeEditor(editor_name, e=True, layout=True)print "frame nodes"cmds.nodeEditor(editor_name, e=True, frameAll=True)
--
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/5af628e9-65f8-44ff-9c38-e1bbfeb4176d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5af628e9-65f8-44ff-9c38-e1bbfeb4176d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1jKsiwKEZbDE3LYeraqdP7MiFUcc0e465AHgGoSPXqTQ%40mail.gmail.com.To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Hey JustinThanks for the suggestion. Looks like this works without a hitch when run in Maya, but I'm sad to say that as soon as I put it in a module and called it to display some nodes I was checking, it did not work at all. it just opened the custom node editor and displayed the last thing I had in my normal node editor.Is it possible to do something like this with open maya? I would assume so, I'm seeing no reference to creating maya windows like the node editor in the API documentation.Thoughts?
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/5af628e9-65f8-44ff-9c38-e1bbfeb4176d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/CAPGFgA1jKsiwKEZbDE3LYeraqdP7MiFUcc0e465AHgGoSPXqTQ%40mail.gmail.com.
--
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/CAJ4oLs5020oddtb-w0dbSPFnbx9hX6qQo-mQ2tSccr748JcOAg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5af628e9-65f8-44ff-9c38-e1bbfeb4176d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1jKsiwKEZbDE3LYeraqdP7MiFUcc0e465AHgGoSPXqTQ%40mail.gmail.com.--
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_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJ4oLs5020oddtb-w0dbSPFnbx9hX6qQo-mQ2tSccr748JcOAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0SiVjahngAjEg2tQRYNM4yQ4kh8qKiR3RCxm60Lrzb5Q%40mail.gmail.com.