Have you read up on the MFloatPoint in the docs? It shouldn't be too
confusing to use.
http://help.autodesk.com/view/MAYAUL/2016/ENU/?guid=__cpp_ref_class_m_float_point_html

Assuming your verts are normal tuples and you want to convert them to
MFloatPoint,

import maya.OpenMaya as om
def findDiff(scan1_verts, scan2_verts):
    diff_list = om.MFloatPointArray()

    for v1, v2 in zip(scan2_verts, scan1_verts):
        p1 = om.MFloatPoint(*v1)
        p2 = om.MFloatPoint(*v2)
        diff_list.append(om.MFloatPoint(p2 - p1))

    return diff_list

​

Justin


On Sat, Dec 10, 2016 at 3:47 AM <s...@weacceptyou.com> wrote:

hello i have some python code that subtracts corresponding coordinates from
two separate lists and then appends the result to a new list:

def findDiff(scan1_verts, scan2_verts):

    diff_list=[]

    for (v1,v2) in zip(scan2_verts,scan1_verts):
        diff=(v1[0]-v2[0]),(v1[1]-v2[1]),(v1[2]-v2[2])
        diff_list.append(diff)

    return diff_list

what i want to know is if this can be done easily with the maya python API.
I later want to use setPoints to set the verts of a new piece of mesh with
this list. so for that reason i think they need to be OpenMaya.MFloatPoint
values or something.

sorry im so confused by how the API does things. If someone could show me
how to set it up i would really appreciate it.

thanks,
Sam

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/c471cb79-878e-4ab5-b75c-3ec1f79711a6%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2M-7tWOQXMbR6%2Bz_FL4a8JSBeiT9iryLw8cw7tSw3Xww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to