[python] get camera panel in maya

40 views
Skip to first unread message

gnn

unread,
Jul 23, 2017, 5:16:56 PM7/23/17
to Python Programming for Autodesk Maya
Hello all,
Is it possible to choose a specific camera in panels?
i'd tryed this:

perspPanel = cmds.getPanel( withLabel='Persp View')
cameraFound
= 'camera1'
cmds
.modelPanel( perspPanel, edit=True, replacePanel=cameraFound )

but i've got this error:
# Error: RuntimeError: file <maya console> line 3: modelPanel: Object 'camera1' not found. #
even if the camera1 exist...

Justin Israel

unread,
Jul 23, 2017, 7:33:20 PM7/23/17
to Python Programming for Autodesk Maya
Using the wrong parameter to modelPanel maybe?

    cmds.modelPanel( perspPanel, edit=True, camera=cameraFound )

You were trying to replace it with another panel but providing it a camera.

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/8a70f2a1-b6cc-44e8-ba93-6062b1a56fc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmanue

unread,
Jul 24, 2017, 2:18:26 PM7/24/17
to python_in...@googlegroups.com
doh! thank you very much Justin, one more time :)

2017-07-24 1:33 GMT+02:00 Justin Israel <justin...@gmail.com>:
Using the wrong parameter to modelPanel maybe?

    cmds.modelPanel( perspPanel, edit=True, camera=cameraFound )

You were trying to replace it with another panel but providing it a camera.

Justin


On Mon, Jul 24, 2017 at 9:16 AM gnn <tanu...@gmail.com> wrote:
Hello all,
Is it possible to choose a specific camera in panels?
i'd tryed this:

perspPanel = cmds.getPanel( withLabel='Persp View')
cameraFound
= 'camera1'
cmds
.modelPanel( perspPanel, edit=True, replacePanel=cameraFound )

but i've got this error:
# Error: RuntimeError: file <maya console> line 3: modelPanel: Object 'camera1' not found. #
even if the camera1 exist...

--
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.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/ElZoOGbP-yE/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAPGFgA0RrtwzzPzNsynRyaeDvVsUuMOZ%2BtGmhi8N2OC6hrx42w%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages