Hey guys, my first post. ive tried to search for my problem but it seems very unique and i cant find anyone who can fix it. I am attempting to create a basic auto rigger for a vehicle to use with udk. but im at the start. Im trying to create a joint at the center of a wheel, but when I use the code I have made, it spawns…
brilliant ! This is exactly what I needed, worked first time :P thank you. Just a quick question for this part -cmds.joint(p=piv[0:3]) what do the numbers mean in the [ ] ? i cant seem to find this in the maya docs
So when you xform the pivot you get 6 values in a list [x,y,z,x,y,z]. Since I just need xyz I say use from 0 upto but not including 3 for the list so I get xyz also called slicing. For more info: http://www.diveintopython.net/native_data_types/lists.html
try this: import maya.cmds as cmdsfor geo in cmds.ls(sl=True): piv = cmds.xform(geo, q=True, piv=True, ws=True) cmds.select(clear=True) cmds.joint(p=piv[0:3]) That will create a joint at the pivot.