How to add model panel to layout created in designer in maya

36 views
Skip to first unread message

Sudeepth Patinjarayil

unread,
May 16, 2017, 6:15:46 AM5/16/17
to Python Programming for Autodesk Maya

I am creating a script in i want to place a model panel in a grid layout created in QtDesigner.


enter image description here


model panel has to be placed in the red area. I tried


cmds.setParent(self.LAY_grid_modelEditor)
cmds.modelPanel('testEditor', cam='persp')
cmds.setParent('..')


but getting the error


# RuntimeError: setParent: Object '<PySide.QtGui.QGridLayout object at 0x000000A49BF80F88>' not found.


I am using PySide in Maya 2015.


Any Help...

Justin Israel

unread,
May 16, 2017, 7:34:47 AM5/16/17
to Python Programming for Autodesk Maya

What is the value of self.LAY_grid_modelEditor? Am I assuming correctly that it is a PySide object? If so, the cmds.setParent() call, being the Maya cmds api, is expecting a string path to the Maya UI object.

Maybe my old post on this related topic will help?
http://justinfx.com/2011/11/20/mixing-pyqt4-widgets-and-maya-ui-objects/
See the comments section for PySide specific info.

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/7cb2efc4-a921-4077-abc6-2f8f9c4381b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sudeepth Patinjarayil

unread,
May 16, 2017, 8:06:05 AM5/16/17
to Python Programming for Autodesk Maya
Thank Justin. I have seen that but didn't look at the comments.


On Tuesday, May 16, 2017 at 5:04:47 PM UTC+5:30, Justin Israel wrote:

What is the value of self.LAY_grid_modelEditor? Am I assuming correctly that it is a PySide object? If so, the cmds.setParent() call, being the Maya cmds api, is expecting a string path to the Maya UI object.

Maybe my old post on this related topic will help?
http://justinfx.com/2011/11/20/mixing-pyqt4-widgets-and-maya-ui-objects/
See the comments section for PySide specific info.

Justin


On Tue, May 16, 2017, 10:15 PM Sudeepth Patinjarayil <psud...@gmail.com> wrote:

I am creating a script in i want to place a model panel in a grid layout created in QtDesigner.


enter image description here


model panel has to be placed in the red area. I tried


cmds.setParent(self.LAY_grid_modelEditor)
cmds.modelPanel('testEditor', cam='persp')
cmds.setParent('..')


but getting the error


# RuntimeError: setParent: Object '<PySide.QtGui.QGridLayout object at 0x000000A49BF80F88>' not found.


I am using PySide in Maya 2015.


Any Help...

--
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.
Reply all
Reply to author
Forward
0 new messages