PyMel orientJoint() usage

344 views
Skip to first unread message

Tom Whitzer

unread,
Nov 18, 2017, 2:11:28 PM11/18/17
to Python Programming for Autodesk Maya
I am curious if anyone could provide me with an example of the the orientJoint() function in PyMel. I have been searching online to see how to properly use it, and the information that I am getting seem a bit muddied. I can't tell if orientJoint is actually a function or if it is a flag that I call when I create a joint. Sorry if this is an obvious thing to know. 

Some of the code that I was trying was: 

from pymel.core import *

parent = selected()[0].root()
orientJoint(parent)

Simon Anderson

unread,
Nov 19, 2017, 5:07:33 AM11/19/17
to Python Programming for Autodesk Maya
Can I ask why use pyMel, when you have a much faster and more pythonic API, om2?

Marcus Ottosson

unread,
Nov 19, 2017, 6:18:36 AM11/19/17
to python_in...@googlegroups.com

the information that I am getting seem a bit muddied

What information have you been getting? Also, where are you finding that function? Your example doesn’t work for me, and looking through the source doesn’t bring anything up.

Can I ask why use pyMel, when you have a much faster and more pythonic API, om2?

For what? We don’t even know what it is he’s trying to accomplish? What if it’d actually be slower, and less Pythonic? There’s no way of telling at the moment. Or are you just generally touting “om2” (which I presume means maya.api.OpenMaya) as a replacement for anything involving PyMEL?


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/bf176251-d9db-4792-a460-9e89f7232ea3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

haggi

unread,
Nov 19, 2017, 7:10:53 AM11/19/17
to python_in...@googlegroups.com

That's because Pymel is not PyAPI. Pymel simplifies the work with non-api related tasks a lot.

And you can combine the simplified Pymel MObject with the python API.

With a pure api access you have to make a MSelectionList get the current MObject etc. With pymel you can access the MObject or MFn directly.

haggi

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

Tom Whitzer

unread,
Nov 19, 2017, 11:23:17 AM11/19/17
to python_in...@googlegroups.com
Thank you both for getting back to me. I found the information on it here. I am working on a script that creates joints at the positions of selected objects. I have have the joint creation finished, but I want to orient the joints after they are created. 


I am using PyMel, because I am familur with python and trying to learn how to code for Maya.

Tom

On Sun, Nov 19, 2017 at 7:10 AM, haggi <ha...@haggi.de> wrote:

That's because Pymel is not PyAPI. Pymel simplifies the work with non-api related tasks a lot.

And you can combine the simplified Pymel MObject with the python API.

With a pure api access you have to make a MSelectionList get the current MObject etc. With pymel you can access the MObject or MFn directly.

haggi


Am 19.11.2017 um 11:07 schrieb Simon Anderson:
Can I ask why use pyMel, when you have a much faster and more pythonic API, om2?

On Sunday, 19 November 2017 06:11:28 UTC+11, Tom Whitzer wrote:
I am curious if anyone could provide me with an example of the the orientJoint() function in PyMel. I have been searching online to see how to properly use it, and the information that I am getting seem a bit muddied. I can't tell if orientJoint is actually a function or if it is a flag that I call when I create a joint. Sorry if this is an obvious thing to know. 

Some of the code that I was trying was: 

from pymel.core import *

parent = selected()[0].root()
orientJoint(parent)
--
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.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3767f103-8ea3-aa50-0601-205629bfd567%40haggi.de.

For more options, visit https://groups.google.com/d/optout.



--
------------------------------------
Tom Whitzer
Reply all
Reply to author
Forward
0 new messages