active pane

133 views
Skip to first unread message

kevco...@gmail.com

unread,
Jan 31, 2015, 1:56:19 PM1/31/15
to python_in...@googlegroups.com
hey guys,

I'm feeling really stupid, but I'm having a hell of a time querying the active view pane. Why does this not return the activePane? it sure seems like it should

cmds.paneLayout('viewPanes', query=True, activePane=True)

thanks
Kev

kevco...@gmail.com

unread,
Jan 31, 2015, 2:37:36 PM1/31/15
to python_in...@googlegroups.com, kevco...@gmail.com
ok, I'm not having a good day, :( lol.

could someone please explain why this isnt working either?

set = cmds.sets(name='sillySet', empty=True)
object = cmds.polyCube(name='sillyCube')[0]
cmds.sets(set, edit=True, addElement=object)

#RuntimeError: The argument provided is NOT a set #


didn't feel the need to start a new threat for this, hope that's cool.
Thanks
Kev

damon shelton

unread,
Jan 31, 2015, 3:36:28 PM1/31/15
to python_in...@googlegroups.com, kevin cortez

For the panelayout query are you getting a result?  Also if you are running from script editor then it will most likely never be active.

For the sets, I believe the objects should be first and the set should be the value for addElement

--
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/e104dbb5-d349-4b3b-96f1-b6c5f4e4dd1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kevco...@gmail.com

unread,
Jan 31, 2015, 4:08:45 PM1/31/15
to python_in...@googlegroups.com, kevco...@gmail.com
ahaha, oh geeze.

Thanks Damon, I honestly dont think I would have ever figured that out.

Kev

kevco...@gmail.com

unread,
Jan 31, 2015, 4:35:12 PM1/31/15
to python_in...@googlegroups.com, kevco...@gmail.com
oh btw, the activePane query returns None.

so how best to query the activePane, err from the script editor?

Justin Israel

unread,
Jan 31, 2015, 4:36:42 PM1/31/15
to python_in...@googlegroups.com, kevco...@gmail.com

Did you check the docs? The signature for the sets() function shows the selection list as being first.

http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/sets.html

That translates to meaning that it accepts one or more (or even a list of) items to be operated on, or the current selection if none are given.

Then the doc for the specific addElement action says: Adds the selected items to the *given set*

And at the bottom of the doc page, there are examples of the function being used to add and remove items from sets.

Hope the helps for future usage issues.


--
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/deaf8ccd-3b49-4dec-8248-1be2d8164bd6%40googlegroups.com.

AK Eric

unread,
Jan 31, 2015, 5:23:58 PM1/31/15
to python_in...@googlegroups.com, kevco...@gmail.com
For querying the panel, I've had good luck with:
string $currentPanel = `playblast -activeEditor`;
or

string $currentPanel = `getPanel -withFocus`;
These are panels, not the specific pane. Not sure if that helps ;)  The playblast one is always limited to something that can render.

And I hate the Python syntax for sets, I always get it wrong the first time.  I know in PyMel the 'fixed' it to read a bit more logically.
Reply all
Reply to author
Forward
0 new messages