--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f119d42e-75bf-44b5-88bf-d39e660e1aed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
you can make it a LOT easier of you just stay in pymel and skip maya.cmds. here is an example of what you’re doing:
import pymel.core as pm
# make pynodes out of each locator or transform
loc1=pm.PyNode('locator1')
loc2=pm.PyNode('locator2')
loc3=pm.PyNode('locator3')
# get the World space position of each locator
# each of these returns a Point
pt1=loc1.getTranslation(space='world')
pt2=loc2.getTranslation(space='world')
pt3=loc3.getTranslation(space='world')
# to get vectors subtract one point from another
# returns a Vector
vec1=pt2 - pt1
vec2=pt3 - pt1
# .cross() is a method on any vector
cross = vec1.cross(vec2).normal() # add .normal() to normalize
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/df047714-b73d-4af9-badc-6c10179cc4ee%40googlegroups.com.
--
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/Fbk_J8KVzaQ/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/CABPXW4igxQVyBuiaLuSQ8BjSeFWmMZygBxGGnm2XbYFapykfPA%40mail.gmail.com.