Point Constraint skip Axis parameter issue.

571 views
Skip to first unread message

tushar sankhala

unread,
Oct 8, 2014, 1:15:18 PM10/8/14
to python_in...@googlegroups.com
Hi,

I am writing an automated constraint string for one of the animator friend.

I am having an issue in the skip axis parameter of the point constraint command.

Try1:

myString = 'x'

cmds.pointConstraint( 'sph1', 'sph2', skip=[myString])   WORKS

Try 2:
myString = 'x'
myString += ","
myString += 'y'


cmds.pointConstraint( 'sph1', 'sph2', skip=[myString])   # Error: RuntimeError: file <maya console> line 1: Invalid argument for the skip flag. Specify x, y, or z. # 

Tried Different version of the input Like Putting them in single quotes or double quotes:

myString = '"x"'
myString += ","
myString += '"y'"

Can someone help?

Thanks in advance.

Tushar

kevco...@gmail.com

unread,
Oct 8, 2014, 2:56:43 PM10/8/14
to python_in...@googlegroups.com
Hi,

the arguments need to be seperate strings within a list. How you have it, your passing in a list that looks like ["x,y"]. You need your list to look like ["x","y"]

try something like this:

skipList = ['x']
skipList.append('y')

cmds.pointConstraint( 'sph1', 'sph2', skip=skipList )

tushar sankhala

unread,
Oct 8, 2014, 3:15:38 PM10/8/14
to python_in...@googlegroups.com
Thanks for your reply 

i tried it and it works.

Thanks :) 


--
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/rcOx4_r23eo/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/3e0afeab-d4be-4c15-9dc8-e75e5c193b21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tushar sankhala

unread,
Oct 8, 2014, 3:22:54 PM10/8/14
to python_in...@googlegroups.com, kevco...@gmail.com
hi,

Your solution worked but i have one confusion 

how does that works when i have only one element like

myString = 'x'

cmds.pointConstraint( 'sph1', 'sph2', skip=[myString])

and this works,

problem comes when i have two axis to skip...

Thanks
Tushar

kevco...@gmail.com

unread,
Oct 8, 2014, 4:03:30 PM10/8/14
to python_in...@googlegroups.com, kevco...@gmail.com
myString = 'x'
cmds.pointConstraint( 'sph1', 'sph2', skip=[myString])

This works because your string is passed within a list to the argument.

skip=[myString] is not the same as skip=myString

so you were passing it skip=["x"] which of course works, but you needed to append another string to your list, instead of add to the string itself. which was giving you skip=["x,y"]


Hope that helps

kevco...@gmail.com

unread,
Oct 8, 2014, 4:17:25 PM10/8/14
to python_in...@googlegroups.com, kevco...@gmail.com
sorry let me clarify. skip="x" would have worked too. since it's just one argument. But if you read the docs, it says multiple arguments need to be passed in as a list or tuple.
Reply all
Reply to author
Forward
0 new messages