/
Asset hooks
Asset hooks
Users can define new hooks that get called whenever the following assets are registered: Animation Clip, Agent Type and Variations.
Variations
This callback will always be called when any python code registers the variations.
Users can register a new callback as shown below. The "v" object is an Atoms.Variations object, you can get the agent type names as shown below.
from Atoms.constants import JSON_KEYS, JSON_VERSION, VARIATION_CALLBACKS def cbk(v): print(v.getAgentTypeNames()) VARIATION_CALLBACKS.append(cbk)
Agent Types and Animation Clips
This callbacks will always be called when any python code registers an animation clip or agent type.
The callback arguments are: the event name, the actions (0 for deletion, 1 for registration) and the SimulationEvent python object for the registered asset. The latter is an object of the classes that you can see when creating a new AgentType or Animation Clip in script mode instead of GUI mode.
Atoms updates all the scripts in the scenes automatically, so you should get this being called straight away.
from Atoms.constants import EVENT_TYPES, ASSET_CALLBACKS def cbk(name, action, asset): print(name, action, asset) def at_cbk(name, action, asset): print(name, action, asset) ASSET_CALLBACKS[EVENT_TYPES.ANIMATION_CLIP_EVENT] = [cbk] ASSET_CALLBACKS[EVENT_TYPES.AGENT_TYPE_EVENT] = [at_cbk]
, multiple selections available,
Related content
Extending Atoms UI and Variation UI buttons
Extending Atoms UI and Variation UI buttons
More like this
Simulation events
Simulation events
More like this
Agents Helper Tool
Agents Helper Tool
More like this
Blueprint module
Blueprint module
More like this
Behaviour module
Behaviour module
More like this
Adding custom metadata
Adding custom metadata
More like this
Copyright © 2017, Toolchefs LTD.