예제 #1
0
파일: util.py 프로젝트: applekey/wizard
def get_selected_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ((fMin[0], fMin[1], fMin[2]), (fMax[0], fMax[1], fMax[2]))
예제 #2
0
파일: util.py 프로젝트: applekey/wizard
def get_selected_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
예제 #3
0
def get_selected_bounding_box(remote):
    """return the axis-aligned bounding box of the selected objects as two 3-tuples (min, max)"""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
예제 #4
0
파일: util.py 프로젝트: applekey/mm-api
def get_selected_bounding_box(remote):
    """return the axis-aligned bounding box of the selected objects as two 3-tuples (min, max)"""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
예제 #5
0
def to_world_xyz(remote, x, y, z):
    """convert point from scene to world coords"""
    vScene = mmapi.floatArray(3)
    vScene[0] = x
    vScene[1] = y
    vScene[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToWorld(vScene)
    remote.runCommand(cmd2)
    vWorld = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToWorld(ckey, vWorld)
    return (vWorld[0], vWorld[1], vWorld[2])
예제 #6
0
파일: convert.py 프로젝트: applekey/wizard
def to_world_xyz(remote, x,y,z):
    """convert point from scene to world coords"""
    vScene = mmapi.floatArray(3)
    vScene[0] = x
    vScene[1] = y
    vScene[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToWorld(vScene)
    remote.runCommand(cmd2);
    vWorld = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToWorld(ckey, vWorld)
    return (vWorld[0],vWorld[1],vWorld[2])
예제 #7
0
파일: convert.py 프로젝트: jiapei100/mm-api
def to_scene_xyz(remote, x,y,z):
    """convert a 3D point from World space to Scene space"""
    vWorld = mmapi.floatArray(3)
    vWorld[0] = x
    vWorld[1] = y
    vWorld[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToScene(vWorld)
    remote.runCommand(cmd2);
    vScene = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToScene(ckey, vScene)
    return (vScene[0],vScene[1],vScene[2])
예제 #8
0
파일: util.py 프로젝트: applekey/wizard
def get_face_selection_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
    else:
        return ( (0,0,0), (0,0,0) )
예제 #9
0
def to_scene_xyz(remote, x, y, z):
    """convert a 3D point from World space to Scene space"""
    vWorld = mmapi.floatArray(3)
    vWorld[0] = x
    vWorld[1] = y
    vWorld[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToScene(vWorld)
    remote.runCommand(cmd2)
    vScene = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToScene(ckey, vScene)
    return (vScene[0], vScene[1], vScene[2])
예제 #10
0
파일: util.py 프로젝트: applekey/wizard
def get_face_selection_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ((fMin[0], fMin[1], fMin[2]), (fMax[0], fMax[1], fMax[2]))
    else:
        return ((0, 0, 0), (0, 0, 0))
예제 #11
0
파일: util.py 프로젝트: applekey/mm-api
def get_face_selection_bounding_box(remote):
    """return the axis-aligned bounding box of the selected faces as two 3-tuples (min, max). Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
    else:
        return ( (0,0,0), (0,0,0) )
예제 #12
0
def get_face_selection_bounding_box(remote):
    """return the axis-aligned bounding box of the selected faces as two 3-tuples (min, max). Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
    else:
        return ( (0,0,0), (0,0,0) )
예제 #13
0
def to_scene_f(remote, f):
    """convert a scalar dimension from World space to Scene space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2)
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
예제 #14
0
파일: convert.py 프로젝트: applekey/wizard
def to_world_f(remote, f):
    """convert scalar from scene to world coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2);
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
예제 #15
0
def to_scene_f(remote, f):
    """convert scalar from world to scene coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2)
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
예제 #16
0
파일: convert.py 프로젝트: jiapei100/mm-api
def to_scene_f(remote, f):
    """convert a scalar dimension from World space to Scene space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2);
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
예제 #17
0
def to_world_f(remote, f):
    """convert scalar from scene to world coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2)
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
예제 #18
0
def to_world_f(remote, f):
    """convert a scalar dimension from Scene space to World space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2)
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
예제 #19
0
파일: convert.py 프로젝트: jiapei100/mm-api
def to_world_f(remote, f):
    """convert a scalar dimension from Scene space to World space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2);
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
예제 #20
0
파일: convert.py 프로젝트: applekey/wizard
def to_scene_f(remote, f):
    """convert scalar from world to scene coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2);
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
예제 #21
0
파일: util.py 프로젝트: applekey/wizard
def get_face_selection_centroid(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return ( vCentroid[0], vCentroid[1], vCentroid[2] )
    else:
        return ( 0,0,0 )
예제 #22
0
파일: util.py 프로젝트: applekey/wizard
def get_face_selection_centroid(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return (vCentroid[0], vCentroid[1], vCentroid[2])
    else:
        return (0, 0, 0)
예제 #23
0
파일: util.py 프로젝트: applekey/mm-api
def get_face_selection_centroid(remote):
    """return the geometric centroid of the selected faces as a 3-tuple. Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return ( vCentroid[0], vCentroid[1], vCentroid[2] )
    else:
        return ( 0,0,0 )
예제 #24
0
def get_face_selection_centroid(remote):
    """return the geometric centroid of the selected faces as a 3-tuple. Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return ( vCentroid[0], vCentroid[1], vCentroid[2] )
    else:
        return ( 0,0,0 )