Exemple #1
0
def getSymmetryMap(obj, logWarning=True):

    allSymmetryMaps = xsi.FindObjects(
        None, "{2EBA6DE4-B7EA-4877-80FE-FC768F32729F}")

    for map in allSymmetryMaps:
        if map.Parent3DObject.IsEqualTo(obj):
            return map

    if logWarning:
        xsi.LogMessage("No Symmetry Map for " + obj.FullName, c.siWarning)

    return False
Exemple #2
0
def gear_RemoveUnusedEnvCls_Execute():

    # This method is named based and doesn't provide a perfect result but should work in most of the case.

    # Return All the Pnt Cluster from the active scene
    point_clusters = xsi.FindObjects(None,
                                     "{E4DD8E40-1E1C-11D0-AA2E-00A0243E34C4}")

    # Search for unused EnvelopWeightCls
    delete_objs = XSIFactory.CreateObject("XSI.Collection")
    for cls in point_clusters:

        if cls.Name.startswith("EnvelopWeightCls"):
            delete = True
            for prop in cls.Properties:
                if prop.Type == "envweights":
                    delete = False

            if delete:
                delete_objs.Add(cls)

    # Delete
    if delete_objs.Count:
        xsi.DeleteObj(delete_objs)