Archive for January, 2018

Get the locations of points on a curve, pointPosition(), Maya, Python

Posted by:

So Autodesk documentation on this is sparse and a bit inaccurate.

In order to get this function to work you need to separate out the parameters at the ‘.’ (something I am finding is a common thread among many of maya’s library functions)

This is the way to do it:

 

Note that this won’t work:

pointA = cmds.pointPosition(str(selectedCurve.cv[1]), world = True)

Because the .cv[1] is not separated out.

This however will work:

pointA = cmds.pointPosition(str(selectedCurve) + ‘.cv[0]’, world = True)#this is just another way of converting a ...

Continue Reading →
0

Format for getting text from a textField, Maya, GUI, Python

Posted by:

I felt that it wasn’t immediately obvious how you go about doing this and It took a bit of research to figure out how it worked (and how it didn’t — as some tutorials that I followed seemed to maybe not be 100% sure of how it worked either)

 

There are two parts to this, one is in the GUI and the other is in the code that you want to use the info for:

Continue Reading →
0

Create Null Above Object, Constrain Null To Secondary Object, Control Constraint With Attribute on Original Object, Maya, Python Script

Posted by:

I frequently have to have an object follow another object but that original object still has to be able to be controlled in the “local space” of the parent object, but then sometimes be independent of the parent object.  Think an IK hand control.

Anyway, I have to do this so often that I thought I would write a script so I never have to do it again.

Continue Reading →
0