コード例 #1
0
def ik_to_fk(build_tmp_geo=True, apply_=True):
    """Switch IK to FK.

    Args:
        build_tmp_geo (bool): build tmp geo
        apply_ (bool): apply the change to gimbal ctrl
    """
    refresh.reload_libs(filter_='fkik')
    system.get_selected_system().apply_ik_to_fk(build_tmp_geo=build_tmp_geo,
                                                apply_=apply_)
コード例 #2
0
def toggle_ik_fk(refresh_=1, build_tmp_geo=False, apply_=True):
    """Toggle between IK/FK.

    Args:
        refresh_ (int): refresh code level
        build_tmp_geo (bool): build tmp geo
        apply_ (bool): apply switch
    """
    if refresh_:
        refresh.reload_libs(filter_=None if refresh_ == 2 else 'fkik')
    system.get_selected_system().toggle_ik_fk(build_tmp_geo=build_tmp_geo,
                                              apply_=apply_)
コード例 #3
0
def fk_to_ik(pole_vect_depth=10.0, build_tmp_geo=True, apply_=True):
    """Switch FK to IK.

    Args:
        pole_vect_depth (float): distance of pole vector from elbow
        build_tmp_geo (bool): build tmp geo
        apply_ (bool): apply the change to gimbal ctrl
    """
    refresh.reload_libs(filter_='fkik')
    system.get_selected_system().apply_fk_to_ik(
        pole_vect_depth=pole_vect_depth,
        build_tmp_geo=build_tmp_geo,
        apply_=apply_)
コード例 #4
0
 def _context__Keyframe(self, menu):
     menu.setStyleSheet('background-color:DimGrey; color:white')
     try:
         _system = system.get_selected_system(class_=self.system)
     except ValueError as _exc:
         menu.add_label(_exc.message)
     else:
         _nodes = _system.get_ctrls()
         menu.add_action('Select nodes', wrap_fn(cmds.select, _nodes))
コード例 #5
0
    def _execute_switch(self, mode):
        """Execute switch ik/fk mode.

        Args:
            mode (str): transition to make
        """
        _system = system.get_selected_system(
            class_=self.system, error=HandledError)
        _system.exec_switch_and_key(
            switch_mode=mode,
            switch_key=self.ui.SwitchKey.isChecked(),
            key_mode=self._read_key_mode())
コード例 #6
0
 def _callback__Keyframe(self):
     _system = system.get_selected_system(
         class_=self.system, error=HandledError)
     cmds.setKeyframe(_system.get_key_attrs())