That's brilliant, thanks Carlos.

How do you find such things? I haven't customised marking menus before,
where would suggest I start looking for the default scripts, such as this
one?

On 5 February 2016 at 11:26, Carlos Rico <[email protected]> wrote:

> Without looking anything first thing to mind is to have a look at the
> default Marking Menu "ChangePanelType". The thing is it is MEL.
>
> # python code
> import maya.mel as mel
> mel.eval("switchPanelToType GraphEditor")
>
> You can have a look at "switchPanelToType" maybe to see how it is done in
> MEL and translate to python. Cheers.
>
>
>
>
> *Carlos Rico Adega*-------------------------------------
> <http://www.vimeo.com/16765581> LinkedIn
> <http://www.linkedin.com/pub/carlos-rico/6/58/325>
> [email protected]
>
> 2016-02-05 12:08 GMT+01:00 Marcus Ottosson <[email protected]>:
>
>> Hi all,
>>
>> Within each panel, I can go:
>>
>> - Panels -> Panel -> Graph Editor
>>
>> ..or..
>>
>> - Panels -> Panel -> Script Editor
>>
>> ..etc.
>>
>> But I can't find a way to do this programmatically, to the currently
>> active panel. I'm looking for something like this.
>>
>> ```python
>> # psuedo code
>> panel = cmds.getPanel()
>> cmds.setPanel(panel, "GraphEditor")
>> ```
>>
>> Any ideas?
>>
>> --
>> *Marcus Ottosson*
>> [email protected]
>>
>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC2_zaqpj4WwLeXO7z0RLAUEk%3DZAaV5ECmBmxGo5JBA-g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC2_zaqpj4WwLeXO7z0RLAUEk%3DZAaV5ECmBmxGo5JBA-g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFzJ14VkTTr-49v26magu93b6MMsptyGbfhDWiUsXVxTJwcxFw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFzJ14VkTTr-49v26magu93b6MMsptyGbfhDWiUsXVxTJwcxFw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAEocV7yaJoo_ES_0kPuGa9PSCGh9qPor3uUwB6xbzCKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to