Ejemplo n.º 1
0
def gear_MirrorPose_Execute():

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

    ani.mirror(xsi.Selection)
Ejemplo n.º 2
0
def gear_MirrorPose_Execute():

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

    ani.mirror(xsi.Selection)
Ejemplo n.º 3
0
def mirrorSel(in_mousebutton, in_keymodifier):

    # Left and Middle click
    if in_mousebutton in [0, 1]:
        ani.mirror()

    # Right click - Do nothing
    elif in_mousebutton == 2:
        return
Ejemplo n.º 4
0
def gear_MirrorAnimation_Execute():  # controlers

    if not xsi.Selection.Count:
        gear.log("No selection", gear.sev_error)
        return
    ## Miquel Shed added:
    else:
        controlers = XSIFactory.CreateActiveXObject("XSI.Collection")
        controlers.AddItems(xsi.Selection)
    ##end of the addition

    # Get First and Last Frame
    frames = fcv.getFirstAndLastKey(controlers)
    if not frames:
        gear.log("No Key on selection, cannot perform mirror animation",
                 gear.sev_error)
        return

    # UI
    ui_prop = xsi.ActiveSceneRoot.AddProperty("CustomProperty", False,
                                              "Mirror Animation")
    pOffset = ui_prop.AddParameter3("offset", c.siInt4, 0, None, None, False,
                                    False)
    pConsiderTime = ui_prop.AddParameter3("considerTime", c.siBool, False,
                                          None, None, False, False)
    pFrameIn = ui_prop.AddParameter3("frameIn", c.siInt4, frames[0], None,
                                     None, False, False)
    pFrameOut = ui_prop.AddParameter3("frameOut", c.siInt4, frames[1], None,
                                      None, False, False)

    layout = ui_prop.PPGLayout
    layout.AddGroup("Options")
    layout.AddItem(pOffset.ScriptName, "Offset")
    layout.AddItem(pConsiderTime.ScriptName, "Consider Time")
    layout.AddRow()
    layout.AddItem(pFrameIn.ScriptName, "Frame In")
    layout.AddItem(pFrameOut.ScriptName, "Frame Out")
    layout.EndRow()
    layout.EndGroup()

    rtn = xsi.InspectObj(ui_prop, "", "Mirror Animation", c.siModal, False)

    frame_offset = pOffset.Value
    considerTime = pConsiderTime.Value
    frame_in = pFrameIn.Value
    frame_out = pFrameOut.Value

    xsi.DeleteObj(ui_prop)

    if rtn:
        return

    # Mirror
    ani.mirror(controlers, True, frame_offset, considerTime, frame_in,
               frame_out)

    return
Ejemplo n.º 5
0
def mirrorSel(in_mousebutton, in_keymodifier):

    # Left and Middle click
    if in_mousebutton in [0, 1]:
        ani.mirror()

    # Right click - Do nothing
    elif in_mousebutton == 2:
        return
Ejemplo n.º 6
0
def gear_MirrorAnimation_Execute():  # controlers

    if not xsi.Selection.Count:
        gear.log("No selection", gear.sev_error)
        return
    ## Miquel Shed added:
    else:
        controlers = XSIFactory.CreateActiveXObject("XSI.Collection")
        controlers.AddItems(xsi.Selection)
    ##end of the addition

    # Get First and Last Frame
    frames = fcv.getFirstAndLastKey(controlers)
    if not frames:
        gear.log("No Key on selection, cannot perform mirror animation", gear.sev_error)
        return

    # UI
    ui_prop = xsi.ActiveSceneRoot.AddProperty("CustomProperty", False, "Mirror Animation")
    pOffset = ui_prop.AddParameter3("offset", c.siInt4, 0, None, None, False, False)
    pConsiderTime = ui_prop.AddParameter3("considerTime", c.siBool, False, None, None, False, False)
    pFrameIn = ui_prop.AddParameter3("frameIn", c.siInt4, frames[0], None, None, False, False)
    pFrameOut = ui_prop.AddParameter3("frameOut", c.siInt4, frames[1], None, None, False, False)

    layout = ui_prop.PPGLayout
    layout.AddGroup("Options")
    layout.AddItem(pOffset.ScriptName, "Offset")
    layout.AddItem(pConsiderTime.ScriptName, "Consider Time")
    layout.AddRow()
    layout.AddItem(pFrameIn.ScriptName, "Frame In")
    layout.AddItem(pFrameOut.ScriptName, "Frame Out")
    layout.EndRow()
    layout.EndGroup()

    rtn = xsi.InspectObj(ui_prop, "", "Mirror Animation", c.siModal, False)

    frame_offset = pOffset.Value
    considerTime = pConsiderTime.Value
    frame_in = pFrameIn.Value
    frame_out = pFrameOut.Value

    xsi.DeleteObj(ui_prop)

    if rtn:
        return

    # Mirror
    ani.mirror(controlers, True, frame_offset, considerTime, frame_in, frame_out)

    return