Пример #1
0
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 )