def setup_asm_posture(self, asm, sim, target, **kwargs): if not super().setup_asm_posture(asm, sim, target, **kwargs): return False if 'locked_params' not in kwargs or 'surfaceHeight' not in kwargs['locked_params']: surface_height = get_surface_height_parameter_for_object(target) self.asm.set_parameter('surfaceHeight', surface_height) return True
def setup_asm_posture(self, asm, sim, target, **kwargs): result = super().setup_asm_posture(asm, sim, target, **kwargs) if result and ('locked_params' not in kwargs or 'surfaceHeight' not in kwargs['locked_params']): surface_height = get_surface_height_parameter_for_object(target, sim=sim) self.asm.set_parameter('surfaceHeight', surface_height) return result
def setup_asm_posture(self, asm, sim, target, **kwargs): if not super().setup_asm_posture(asm, sim, target, **kwargs): return False if 'locked_params' not in kwargs or 'surfaceHeight' not in kwargs[ 'locked_params']: surface_height = get_surface_height_parameter_for_object(target) self.asm.set_parameter('surfaceHeight', surface_height) return True
def _anim_overrides_internal(self): params = {'isParented': self.parent is not None, 'heightAboveFloor': slots.get_surface_height_parameter_for_object(self)} if self.is_part: params['subroot'] = self.part_suffix params['isMirroredPart'] = True if self.is_mirrored() else False overrides = AnimationOverrides(params=params) for component_overrides in self.component_anim_overrides_gen(): overrides = overrides(component_overrides()) if self._anim_overrides is not None: return overrides(self._anim_overrides()) return overrides
def setup_asm_default(self, asm, *args, **kwargs): result = super().setup_asm_default(asm, *args, **kwargs) if self.target is not None: surface_height = get_surface_height_parameter_for_object( self.target, sim=self.sim) asm.set_parameter('surfaceHeight', surface_height) if self._original_carry_target is not None: param_overrides = self._original_carry_target.get_param_overrides( self.DIRTY_DISH_ACTOR_NAME, only_for_keys=(self.ITEMS_PARAM, )) if param_overrides is not None: asm.update_locked_params(param_overrides) return result
def setup_asm_default(self, asm, *args, **kwargs): result = super().setup_asm_default(asm, *args, **kwargs) if self.target is not None: surface_height = get_surface_height_parameter_for_object(self.target) asm.set_parameter('surfaceHeight', surface_height) if self.target.parent is not None: asm.set_actor('surface', self.target.parent) if self._original_carry_target is not None: param_overrides = self._original_carry_target.get_param_overrides(self.DIRTY_DISH_ACTOR_NAME, only_for_keys=(self.ITEMS_PARAM,)) if param_overrides is not None: asm.update_locked_params(param_overrides) return result
def get_asm(self, use_cache=True, **kwargs): idle_component = self.owner.get_component(IDLE_COMPONENT) if idle_component is None: logger.error('Trying to setup an object animation {}, {} on an object {} with no Idle Component.', self, self.asm_key, self.owner) return asm = idle_component.get_asm(self.asm_key, self.actor_name, use_cache=self._use_asm_cache and use_cache, **kwargs) if self.target is not None: if self.target_name is not None: asm.add_potentially_virtual_actor(self.actor_name, self.owner, self.target_name, self.target) if self.use_surface_height: surface_height = get_surface_height_parameter_for_object(self.target) asm.set_parameter('surfaceHeight', surface_height) return asm
def _anim_overrides_internal(self): params = { 'isParented': self.parent is not None, 'heightAboveFloor': slots.get_surface_height_parameter_for_object(self) } if self.is_part: params['subroot'] = self.part_suffix params['isMirroredPart'] = True if self.is_mirrored() else False overrides = AnimationOverrides(params=params) for component_overrides in self.component_anim_overrides_gen(): overrides = overrides(component_overrides()) if self._anim_overrides is not None: return overrides(self._anim_overrides()) return overrides
def surface_height(self) -> str: return get_surface_height_parameter_for_object(self._obj)
def surface_height(self) -> str: return get_surface_height_parameter_for_object(self._obj)