def dependent_block(self):
     if not self.journal.deferring:
         with consume_exceptions('Distributor', 'Exception raised during a dependent block:'):
             self.journal.start_deferring()
             try:
                 yield None
             finally:
                 self.journal.stop_deferring()
     else:
         yield None
Beispiel #2
0
 def handle_events(self):
     global _nested_arb_depth
     if not self._default_handlers_registered:
         self._register_default_handlers()
         self._default_handlers_registered = True
     sleep = _nested_arb_depth == 0
     _nested_arb_depth += 1
     event_context = consume_exceptions(
         'Animation', 'Exception raised while handling clip events:')
     event_records = self.arb.handle_events(event_context=event_context)
     _nested_arb_depth -= 1
     return (event_records, sleep)
Beispiel #3
0
 def on_reset(self):
     if self._resetting:
         return
     try:
         self._resetting = True
         super_interactions = list(self._super_interactions)
         for interaction in super_interactions:
             with consume_exceptions('SIState', 'Exception raised while clearing SIState:'):
                 interaction.on_reset()
         if self._super_interactions:
             logger.error('Super Interactions {} should be empty after a reset. List will be cleared.', self._super_interactions, owner='mduke')
             self._super_interactions.clear()
     finally:
         self._resetting = False
Beispiel #4
0
 def on_reset(self):
     if self._resetting:
         return
     try:
         self._resetting = True
         super_interactions = list(self._super_interactions)
         for interaction in super_interactions:
             with consume_exceptions('SIState', 'Exception raised while clearing SIState:'):
                 interaction.on_reset()
         while self._super_interactions:
             logger.error('Super Interactions {} should be empty after a reset. List will be cleared.', self._super_interactions, owner='mduke')
             self._super_interactions.clear()
     finally:
         self._resetting = False
def _cache_thread_specific_info():
    global _cached_runtime_slots, _enable_cache_count, _cached_object_manager, _cached_valid_objects
    _cached_runtime_slots = {}
    _enable_cache_count += 1
    try:
        if _enable_cache_count == 1:
            with sims4.callback_utils.invoke_enter_exit_callbacks(
                    sims4.callback_utils.CallbackEvent.
                    POSTURE_GRAPH_BUILD_ENTER,
                    sims4.callback_utils.CallbackEvent.POSTURE_GRAPH_BUILD_EXIT
            ), consume_exceptions():
                yield None
        else:
            yield None
    finally:
        _enable_cache_count -= 1
        if not _enable_cache_count:
            _cached_object_manager = None
            _cached_valid_objects = None
            _cached_runtime_slots = None
def _cache_thread_specific_info():
    global _cached_runtime_slots, _enable_cache_count, _cached_object_manager, _cached_valid_objects
    _cached_runtime_slots = {}
    _enable_cache_count += 1
    try:
        if _enable_cache_count == 1:
            with sims4.callback_utils.invoke_enter_exit_callbacks(sims4.callback_utils.CallbackEvent.POSTURE_GRAPH_BUILD_ENTER, sims4.callback_utils.CallbackEvent.POSTURE_GRAPH_BUILD_EXIT), consume_exceptions():
                yield None
        else:
            yield None
    finally:
        _enable_cache_count -= 1
        if not _enable_cache_count:
            _cached_object_manager = None
            _cached_valid_objects = None
            _cached_runtime_slots = None