So sorry for the late reply!

I used xform as you listed above, and it still did not work when trying to
access the variable normally.

However, I used pointPosition as you listed above and it worked flawlessly.
I am sure that I am just not experienced enough in Python and whatever I am
doing to access the variable is just not jiving.

Thank you so much for the solution, you have helped me overcome a major
obstacle in developing the script!


On Thu, Jul 17, 2014 at 11:13 PM, Justin Israel <[email protected]>
wrote:

> These two calls return the same results, which is a list of x,y,z floats:
>
> cmds.xform("locator1", q=True, worldSpace=True, t=True)
> cmds.pointPosition("locator1", world=True)
>
> Are you sure you called xform with the query=True flag? Otherwise it
> wouldn't return anything (or actually returns None).
>
>
> On Fri, Jul 18, 2014 at 4:05 PM, Brian Powyszynski <
> [email protected]> wrote:
>
>> Justin,
>>
>> Probably the latter.
>>
>> I tried the xform command, but I was just following a tutorial and the
>> variable I tried to store it in returned None when I did a print.
>>
>> It's altogether possible that I did not store/access the variable
>> correctly or that print does not display what I want. I'm a longtime Maya
>> user who is new to Python, but not new to programming, if that gives you
>> any sense of where I am at with this.
>>
>> I think pointPosition
>> <http://download.autodesk.com/us/maya/2010help/CommandsPython/pointPosition.html>
>>  looks
>> promising, but I have not tried it yet and I am not sure if it will work
>> with a locator.
>>
>> Any thoughts on which approach I should pursue?
>>
>>
>> On Thu, Jul 17, 2014 at 5:01 PM, Justin Israel <[email protected]>
>> wrote:
>>
>>> Hey Brian,
>>>
>>> Was the xform command not working for you? Sounds like it would give you
>>> the info that you need. Have you tried it, or are you just asking ahead of
>>> time about possible approaches?
>>>
>>>
>>> On Fri, Jul 18, 2014 at 7:43 AM, Brian Powyszynski <
>>> [email protected]> wrote:
>>>
>>>> Hey everyone, this is my official, first post!
>>>>
>>>>
>>>>   Is there an easy way to get the location of, say, a Locator and store
>>>> it in variable, then create a polygon primitive at that location?
>>>>   I am creating an stair script and I want to run a handrail from one
>>>> Locator to another, I am probably going to create a curve between the two
>>>> Locators, then I will create a small quad at one end or the other and
>>>> extrude along curve.
>>>>
>>>>   Creating the curves and polys is not a problem for me. Rather, I am
>>>> having difficult storing/accessing the Locator position for this.
>>>>
>>>>   Should I use xform to get some of that info, or is there a better way
>>>> to get the XYZ of a vertex/CV?
>>>>
>>>> Thanks in advance!
>>>>
>>>> --
>>>> 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/db1e9467-0870-4248-ac14-c129d182c29d%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/python_inside_maya/db1e9467-0870-4248-ac14-c129d182c29d%40googlegroups.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 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/zhDUNsTDvns/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA05jSqqfqKm0P%2Bn-WYYq-0d9nAzBBK60X8dYpRySe8JEQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA05jSqqfqKm0P%2Bn-WYYq-0d9nAzBBK60X8dYpRySe8JEQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> *Brian Powyszynski      *
>> (469) 258-9826
>> *brianpow.com* <http://brianpow.com>
>>
>>  --
>> 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/CAF9ZAOcr48yNO1YXrfXbQ5YHNomVQiPuDooULxVF7w4qScyBHw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAF9ZAOcr48yNO1YXrfXbQ5YHNomVQiPuDooULxVF7w4qScyBHw%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 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/zhDUNsTDvns/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2qYkwu_zL45TC%2B-W9RbPsFUUWN0jvOnvwPW3J_K0393A%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2qYkwu_zL45TC%2B-W9RbPsFUUWN0jvOnvwPW3J_K0393A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Brian Powyszynski      *
(469) 258-9826
*brianpow.com* <http://brianpow.com>

-- 
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/CAF9ZAOdvMQyYaNx36uODs4cxYsfhtZpf1VMCFb06GPSyU-75eQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to