Beispiel #1
0
def gear_CopyEnvWithGator_Execute():

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

    meshes = []
    for item in xsi.Selection:
        if item.Type == "#Group":
            for member in item.Members:
                if member.Type == "polymsh":
                    meshes.append(member)
                else:
                    gear.log("Invalid Selection : %s" % member.FullName,
                             gear.sev_warning)
        elif item.Type == "polymsh":
            meshes.append(item)
        else:
            gear.log("Invalid Selection : %s" % item.FullName,
                     gear.sev_warning)

    if not meshes:
        gear.log("Invalid Selection", gear.sev_error)
        return

    # Pick Session for the sources
    source_meshes = XSIFactory.CreateObject("XSI.Collection")
    while True:
        picked = uit.pickSession(c.siGenericObjectFilter, "Pick Source Mesh",
                                 False)
        if not picked:
            break

        if picked.Type in ["#Group"]:
            for member in picked.Members:
                if ope.getOperatorFromStack(member, "envelopop"):
                    source_meshes.AddItems(member)
                else:
                    gear.log("No Envelope on " + member.Name, gear.sev_warning)
        else:
            if ope.getOperatorFromStack(picked, "envelopop"):
                source_meshes.Add(picked)
            else:
                gear.log("No Envelope on " + picked.Name, gear.sev_warning)

    if not source_meshes:
        gear.log("Invalid Picking", gear.sev_error)
        return

    # Process
    for mesh in meshes:
        env.copyEnvelopeWithGator(mesh, source_meshes)
Beispiel #2
0
def gear_CopyEnvWithGator_Execute():
     
    # Check Selection
    if not xsi.Selection.Count:
        gear.log("No selection", gear.sev_error)
        return
    
    meshes = []
    for item in xsi.Selection:
        if item.Type == "#Group":
            for member in item.Members:
                if member.Type == "polymsh":
                    meshes.append(member)
                else:
                    gear.log("Invalid Selection : %s"%member.FullName, gear.sev_warning)
        elif item.Type == "polymsh":
            meshes.append(item)
        else:
            gear.log("Invalid Selection : %s"%item.FullName, gear.sev_warning)
        
    if not meshes:
        gear.log("Invalid Selection", gear.sev_error)
        return

    # Pick Session for the sources
    source_meshes = XSIFactory.CreateObject("XSI.Collection")
    while True:
        picked = uit.pickSession(c.siGenericObjectFilter, "Pick Source Mesh", False)
        if not picked:
            break

        if picked.Type in ["#Group"]:
            for member in picked.Members:
                if ope.getOperatorFromStack(member, "envelopop"):
                    source_meshes.AddItems(member)
                else:
                    gear.log("No Envelope on " + member.Name, gear.sev_warning)
        else:
            if ope.getOperatorFromStack(picked, "envelopop"):
                source_meshes.Add(picked)
            else:
                gear.log("No Envelope on " + picked.Name, gear.sev_warning)

    if not source_meshes:
        gear.log("Invalid Picking", gear.sev_error)
        return

    # Process
    for mesh in meshes:
        env.copyEnvelopeWithGator(mesh, source_meshes)
Beispiel #3
0
def gear_CopyEnvWithGator_Execute():

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

    source_meshes = XSIFactory.CreateObject("XSI.Collection")
    while True:
        picked = uit.pickSession(c.siGeometryFilter, "Pick Source Mesh", False)
        if not picked:
            break

        if not ope.getOperatorFromStack(picked, "envelopop"):
            gear.log("No Envelope on " + picked.Name, c.siWarning)
            continue

        source_meshes.Add(picked)

    if not source_meshes:
        return

    for mesh in xsi.Selection:
        env.copyEnvelopeWithGator(mesh, source_meshes)
Beispiel #4
0
def gear_CopyEnvWithGator_Execute():

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

    source_meshes = XSIFactory.CreateObject("XSI.Collection")
    while True:
        picked = uit.pickSession(c.siGeometryFilter, "Pick Source Mesh", False)
        if not picked:
            break

        if not ope.getOperatorFromStack(picked, "envelopop"):
            gear.log("No Envelope on " + picked.Name, c.siWarning)
            continue

        source_meshes.Add(picked)

    if not source_meshes:
        return

    for mesh in xsi.Selection:
        env.copyEnvelopeWithGator(mesh, source_meshes)