URCHN Arkipelago Difference between revisions of "Roach Walk Sim"

Difference between revisions of "Roach Walk Sim"

From URCHN Arkipelago
Line 42: Line 42:
  
 
== Autowalk UI parameters ==
 
== Autowalk UI parameters ==
 +
[[File:Autowalkui.png]]
 +
This UI appears in the 3D View when the autowalker has successfully been loaded.
 +
* Generate: Use this button only once, to create the rigged roaches where the Player objects exist.
 +
* restrict: This button hides all but the selected cockroach for speed. TODO: this does not actually speed up the file :/. It is a toggle, press again to reveal the other cockroaches.
 +
* sim all: when checked, the below buttons apply to all roaches in the scene, when unchecked, only to selected roaches.
 +
* start and end: this is the scene preview start and end frames, used by the Bake To Curves function to define the start and end of your sim.
 +
* stride length: the distance moved to take a single step.
 +
* step height: the height of a step.
 +
* leg knee: the amount of rotation of the knee during a step. goes from 0.0 (no motion) to 1.0 (default motion) to higher (more than default motion.
 +
* leg hip: the amount of motion of the hip joint during a step, similar to leg knee.
 +
* foot reach: spreads the feet out or in along the length of the roaches body.
 +
* foot spread: spreads the feet out or in along the width of the roaches body.
 +
 +
* body bounce: amount of up and down motion of the body during a step.
 +
* body yaw: amount of left to right yaw rotation of the body during a step.
 +
* body height: offsets the body up or down.
 +
* body tilt: tilts the body forward or backward (head down or head up)
 +
* body offset: offsets the body forward or backward relative to where the feet are.
 +
 +
* thorax curl: counter motion of the thorax during a step
 +
* abdomen curl: counter motion of the abdomen during a step
 +
 +
* foot1/foot2/foot3: defines the pattern of the walk: on/off/on or off/on/off gives standard "alternating tripod" insect pattern. on/on/on or off/off/off gives the "bipedal run" that cockroaches do at high speed. Other gaits also possible, but don't match known (to me) insect walk patterns.

Revision as of 18:41, 16 December 2011

Intro

This is the documentation for the current crowd sim setup for cockroaches in act I. This is the second try at simming the cockroaches, the first 'bitrotted' due to changes in the Blender api. This uses much the same method, but a different implementation. The original script was split into boids crowds simming and walking, both done in Python. The new one uses the Game Engine for the crowd, but Python for the walk.

Game Engine Boids

insert text here (from Tal's presentation?)

Python Walk Engine

The python walk engine uses a simple method based on the ant autowalker. This method starts off at a rest position in frame 1 of the simulation, and walks based on distance traveled- that is the walk is driven by the motion, based on a basic parameter of stride length: when a foot has moved back (relative to the body) by one half of a stride, it steps forward (the step taking it the other half of the stride). Thus a foot will execute one step during a motion of one stride of the body. Since the cockroach has 3 sets of legs, the script can pick a pattern of primary and secondary legs. For each set, one side is primary and the other is secondary. The primary steps based on the stride, and the secondary (essentially) steps while the primary is static and vice-versa.

What you need to start a sim

You need:

  • A Ground mesh that the roaches walk on, with the custom property __floor on the object. This can be created by making a dense mesh, parallel and over the ground, Turning on face/projection snapping, and moving it slightly in the top view. Meshlab (an external program) can then be used to simplify the dense mesh.
  • A sim result. This consists of Objects with the name Player.### (where ### represents numbers, e.g. Player.001) The capitalisation is significant. These objects should have animation representing the overall motion of the cockroach over the ground. Please note you do not need to use the Game Engine simulation: hand animated objects are also O.K.
  • Working reference desk (so you need certain filepaths set up) In a scene file, you should have the property 'library' with the value '../../library.json' as a custom property on your scene. In addition, you need the reference desk addon enabled (this can be found in tubeSVN/lib/python/addons/refdesk.py) and installed.

Steps

Create the ground mesh

As seen above, simply create the collision plane, typically done before any sim, and add the __floor property to it.

Create the Player objects

This can be done by hand animating empties or cubes, or by using the GE way.

Import the autowalker

If you have refdesk setup, you should be able to go to the 3D View Tools, find Reference Desk, and import Roach Crowd. You'll get an Autowalk_ui section in the Tools area.

Generate the roaches

Click generate in the autowalk UI and it should make cockroaches where the Player objects are.

tweak settings, observe, retweak

Use the UI to tweak parameters, and use the Live or Anim Update buttons to view the results, and retweak to satisfaction.

Bake to Curves

When satisfied, bake the animation into curves.

Autowalk UI parameters

Autowalkui.png This UI appears in the 3D View when the autowalker has successfully been loaded.

  • Generate: Use this button only once, to create the rigged roaches where the Player objects exist.
  • restrict: This button hides all but the selected cockroach for speed. TODO: this does not actually speed up the file :/. It is a toggle, press again to reveal the other cockroaches.
  • sim all: when checked, the below buttons apply to all roaches in the scene, when unchecked, only to selected roaches.
  • start and end: this is the scene preview start and end frames, used by the Bake To Curves function to define the start and end of your sim.
  • stride length: the distance moved to take a single step.
  • step height: the height of a step.
  • leg knee: the amount of rotation of the knee during a step. goes from 0.0 (no motion) to 1.0 (default motion) to higher (more than default motion.
  • leg hip: the amount of motion of the hip joint during a step, similar to leg knee.
  • foot reach: spreads the feet out or in along the length of the roaches body.
  • foot spread: spreads the feet out or in along the width of the roaches body.
  • body bounce: amount of up and down motion of the body during a step.
  • body yaw: amount of left to right yaw rotation of the body during a step.
  • body height: offsets the body up or down.
  • body tilt: tilts the body forward or backward (head down or head up)
  • body offset: offsets the body forward or backward relative to where the feet are.
  • thorax curl: counter motion of the thorax during a step
  • abdomen curl: counter motion of the abdomen during a step
  • foot1/foot2/foot3: defines the pattern of the walk: on/off/on or off/on/off gives standard "alternating tripod" insect pattern. on/on/on or off/off/off gives the "bipedal run" that cockroaches do at high speed. Other gaits also possible, but don't match known (to me) insect walk patterns.