예제 #1
0
 def event_handler_swap_carry(event_data):
     nonlocal got_callback
     if got_callback:
         logger.warn(
             'Animation({}) calling to start a carry multiple times',
             event_data.event_data.get('clip_name'))
         return
     got_callback = True
     arb_exit = animation.arb.Arb()
     original_carry_posture.append_exit_to_arb(arb_exit,
                                               None,
                                               carry_nothing_posture,
                                               carry_nothing_var_map,
                                               exit_while_holding=True)
     carry_nothing_posture.append_transition_to_arb(
         arb_exit, original_carry_posture, in_xevt_handler=True)
     ArbElement(arb_exit).distribute()
     original_carry_posture.target.transient = True
     original_carry_posture.target.clear_parent(sim.transform,
                                                sim.routing_surface)
     original_carry_posture.target.remove_from_client()
     arb_enter = animation.arb.Arb()
     locked_params = final_posture.get_locked_params(None)
     if carry_nothing_posture is not None:
         carry_nothing_posture.append_exit_to_arb(
             arb_enter, final_posture_state, final_posture,
             final_var_map)
     final_posture.append_transition_to_arb(arb_enter,
                                            carry_nothing_posture,
                                            locked_params=locked_params,
                                            in_xevt_handler=True)
     ArbElement(arb_enter).distribute()
 def normal_carry_callback():
     arb = animation.arb.Arb()
     self.append_transition_to_arb(arb,
                                   source_posture,
                                   locked_params=locked_params,
                                   in_xevt_handler=True)
     ArbElement(arb).distribute()
 def normal_carry_callback():
     arb = animation.arb.Arb()
     self.append_exit_to_arb(arb,
                             dest_state,
                             dest_posture,
                             var_map,
                             exit_while_holding=True)
     ArbElement(arb).distribute()
예제 #4
0
 def event_handler_exit_carry(event_data):
     nonlocal exited_carry
     exited_carry = True
     arb = animation.arb.Arb()
     old_carry_posture.append_exit_to_arb(arb,
                                          None,
                                          new_posture,
                                          var_map,
                                          exit_while_holding=True)
     new_posture.append_transition_to_arb(arb,
                                          old_carry_posture,
                                          in_xevt_handler=True)
     ArbElement(arb, master=sim).distribute()
예제 #5
0
 def event_handler_enter_carry(event_data):
     nonlocal got_callback
     if got_callback:
         logger.warn(
             'Animation({}) calling to start a carry multiple times',
             event_data.event_data.get('clip_name'))
         return
     got_callback = True
     arb = animation.arb.Arb()
     locked_params = new_posture.get_locked_params(None)
     old_carry_posture = sim.posture_state.get_aspect(track)
     if old_carry_posture is not None:
         old_carry_posture.append_exit_to_arb(arb, new_posture_state,
                                              new_posture, var_map)
     new_posture.append_transition_to_arb(arb,
                                          old_carry_posture,
                                          locked_params=locked_params,
                                          in_xevt_handler=True)
     ArbElement(arb).distribute()
 def _event_handler_start_pose(self, *args, **kwargs):
     arb = animation.arb.Arb()
     self.asm.request(self._state_name, arb)
     ArbElement(arb).distribute()
예제 #7
0
 def _reset_reference_arb(self):
     if self._reference_arb is not None:
         reset_arb_element = ArbElement(animation.arb.Arb())
         reset_arb_element.add_object_to_reset(self)
         reset_arb_element.distribute()
     self._reference_arb = None
예제 #8
0
 def start_carry(*_, **__):
     idle_arb = animation.arb.Arb()
     carry_posture.asm.request(carry_posture._state_name, idle_arb)
     ArbElement(idle_arb).distribute()