示例#1
0
def gear_SymmetrizeSelection_Execute():

    if not xsi.Selection.Count:
        gear.log("No selection", gear.sev_error)
        return

    subComp = xsi.Selection(0)
    if subComp.Type not in [
            "pntSubComponent", "edgeSubComponent", "polySubComponent"
    ]:
        gear.log("Invalid Selection", gear.sev_error)
        return

    elements = subComp.SubComponent.ElementArray
    mesh = subComp.SubComponent.Parent3DObject

    mirror_elements = geo.getSymSubComponent(elements, subComp.Type, mesh)
    if not mirror_elements:
        return

    points = []
    points.extend(elements)
    points.extend(mirror_elements)

    sub_type = subComp.Type.replace("SubComponent", "")
    xsi.SelectGeometryComponents(mesh.FullName + "." + sub_type + str(points))
示例#2
0
def gear_SelectUnnormalizedPoints_Execute():

    if not xsi.Selection.Count:
        gear.log("No selection", gear.sev_error)
        return

    mesh = xsi.Selection(0)

    # Check input
    if mesh.Type not in ["polymsh", "crvlist", "surfmsh"]:
        gear.log("Invalid selection", gear.sev_error)
        return

    # Get Envelope
    envelope_op = ope.getOperatorFromStack(mesh, "envelopop")
    if not envelope_op:
        gear.log("There's no envelope on " + mesh.Fullname, gear.sev_error)
        return

    unNormPntId = env.getUnnormalizedPoints(envelope_op)

    # Select Pnt
    if unNormPntId:
        gear.log("There is " + str(len(unNormPntId)) +
                 " unnormalized point(s)")
        gear.log(mesh.FullName + ".pnt" + str(unNormPntId))
        xsi.SelectGeometryComponents(mesh.FullName + ".pnt" + str(unNormPntId))
    else:
        gear.log("There is no unnormalized point", gear.sev_warning)
示例#3
0
def gear_SelectWeightMapPoints_Execute():

    if not xsi.Selection.Count:
        gear.log("No selection", gear.sev_error)
        return

    wmap = xsi.Selection(0)
    if wmap.Type not in ["wtmap"]:
        gear.log("Select a Weight Map", gear.sev_error)
        return

    obj = wmap.Parent3DObject
    points = wei.getWeightMapPoints(wmap)

    if points:
        xsi.SelectGeometryComponents(obj.FullName + ".pnt" + str(points))
    else:
        gear.log("There is no points in the Weght map", gear.sev_warning)
示例#4
0
def gear_SelectShapePoints_Execute():

    if not xsi.Selection.Count:
        gear.log("No selection", gear.sev_error)
        return

    shape = xsi.Selection(0)

    # Check input
    if shape.Type not in ["clskey"]:
        gear.log("Invalid selection", gear.sev_error)
        return

    points = sha.getShapePoints(shape)

    if not points:
        gear.log("There is no point deformed by this shape", gear.sev_warning)
        return

    mesh = shape.Parent3DObject
    xsi.SelectGeometryComponents(mesh.FullName + ".pnt" + str(points))