Python API

It is possible to start simulation from Python. This section is mostly for TDs and Tech Animators.

Here's an example:

simulator = BroTools.BroDynamics.modules.chain.SimulatorModule(), **simulationParameters)

simulationParameters should be a dict that contains:

  • preserveAnimation - boolean - preserfe animation or not
  • simulationProperties - a dict of simulation properties. These are directly fed into either nParticle of nHair object, so you can use any. For a list of existing properties refer to json files in BroTools\BroDynamics\config folder (chain_properties.json and point_properties.json)
  • shiftDistance - float - distance to shift additional locator for
  • collisionMode - boolean - collision mode on or off
  • dontRefresh - boolean - refresh or not
  • colliders - list of objects to turn into colliders
  • skipControls - int - number of controls to skip
  • skipFrames - int - number of frames to skip
  • aimRotation - boolean - match rotations or not
  • matchPositions - boolean - match translations or not
  • debugMode - boolean - use debug mode or not
  • deleteNucleus - boolean - delete nucleus after simulation or leave it
  • up - list showing which axis is up ([x,y,z])
  • axis - list showing which axis is front ([x,y,z])