Query object ?

44 views
Skip to first unread message

Christopher.

unread,
Jun 6, 2015, 7:27:04 PM6/6/15
to python_in...@googlegroups.com
What is Query ? 
I know Query means to ask a question, how would this be used for example with, polySphere() radius ?

Justin Israel

unread,
Jun 6, 2015, 7:42:18 PM6/6/15
to python_in...@googlegroups.com

For commands that state they are "queryable", it means you can pass a q=True and the a True value to the param you want to query.

The polySphere command has the example of what you want right at the bottom, so make sure you read the docs:
http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/polySphere.html

Although I think they have a typo in their comment vs the examples

r = cmds.polySphere( 'mySphere', q=True, r=True )


On Sun, 7 Jun 2015 11:27 AM Christopher. <crestchr...@gmail.com> wrote:
What is Query ? 
I know Query means to ask a question, how would this be used for example with, polySphere() radius ?

--
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/811f4572-49b5-412b-91dd-09d0bc23d7a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher.

unread,
Jun 6, 2015, 7:55:25 PM6/6/15
to python_in...@googlegroups.com
I know there are examples, what is the query doing for the radius of the sphere ?


On Saturday, June 6, 2015 at 7:42:18 PM UTC-4, Justin Israel wrote:

For commands that state they are "queryable", it means you can pass a q=True and the a True value to the param you want to query.

The polySphere command has the example of what you want right at the bottom, so make sure you read the docs:
http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/polySphere.html

Although I think they have a typo in their comment vs the examples

r = cmds.polySphere( 'mySphere', q=True, r=True )


On Sun, 7 Jun 2015 11:27 AM Christopher. <crestchr...@gmail.com> wrote:
What is Query ? 
I know Query means to ask a question, how would this be used for example with, polySphere() radius ?

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

Christopher.

unread,
Jun 6, 2015, 7:57:53 PM6/6/15
to python_in...@googlegroups.com
From my understanding if there was a sphere created, it's simply telling the new sphere I create to make the radius the same as the old sphere, correct ?

kevco...@gmail.com

unread,
Jun 6, 2015, 8:03:04 PM6/6/15
to python_in...@googlegroups.com
it's not doing anything to the radius, It's simply asking what the radius of "mySphere" is, so the command returns the radius, and then your storing that in the variable "r".

Justin Israel

unread,
Jun 6, 2015, 8:43:07 PM6/6/15
to python_in...@googlegroups.com
The point of the "query" mode of a command is to query for the value of something. That is different that "create" or "edit" modes, where "create" will create something, and "edit" will edit the value of an existing something. 

On Sun, Jun 7, 2015 at 12:03 PM <kevco...@gmail.com> wrote:
it's not doing anything to the radius,  It's simply asking what the radius of "mySphere" is, so the command returns the radius, and then your storing that in the variable "r".

--
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/eb0bfacd-aa73-4974-a223-f2e06e3cf758%40googlegroups.com.

Crest Christopher

unread,
Jun 6, 2015, 9:07:46 PM6/6/15
to python_in...@googlegroups.com
Ahh, thanks !

Saturday, June 06, 2015 8:03 PM
it's not doing anything to the radius, It's simply asking what the radius of "mySphere" is, so the command returns the radius, and then your storing that in the variable "r".

Saturday, June 06, 2015 7:57 PM
From my understanding if there was a sphere created, it's simply telling the new sphere I create to make the radius the same as the old sphere, correct ?

On Saturday, June 6, 2015 at 7:55:25 PM UTC-4, Christopher. wrote:
--
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/DJniSEGhfbg/unsubscribe.
To unsubscribe from this group and all its topics, 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/80c07456-67c5-49b3-8201-3a0a57cbafc1%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages