Animation Cache Modifier 

Strand animation modifier allows you to import external animations previously exported from Ornatrix. These animations can be either accessed directly from .oxh files every time the file loads up or animation is requested, or they can be stored into 3dsmax memory and saved with .max files.

A group of strand animation modifiers may be layered on top of each other to combine multiple animations onto a same hair/guides object. One important thing to remember is that the topology of the animated object must be the same as the topology of the object receive animation from this modifier.

A typical use for this modifier would be to be able to store previously computed hair dynamics onto a network server and then during network rendering have each slave simply load animations from the same file(s). Not only does this save a lot of size in .max files, but it also allows you to update animations without having to touch the original hair scenes.

Sample usage would include adding dynamics onto a guide object, calculating a simulation, exporting a .oxh file with animation option on. Then one would remove the dynamics modifier and add an Ox Strand Animation modifier instead. In this modifier you can now load the exported .oxh file and animation would be restored.

 

Parameters 

  • Strand Group
    This parameter works the same as in other operators, you can isolate the effect of the Animation to a particular Strand Group.
  • Overwrite Input
    When this option is on, the loaded hair data by this operator completely overwrites any input strands making this operator only output the loaded animated hair. This is useful if you want to completely capture and cache the state of your hair stack in a particular position.
  • Apply Amount
    Determines the intensity of the effect, can be used to blend animation.
  • File Name
    This is where you can load .abc file exported using the Alembic Export. This parameter also allows you to specify a new .abc file to save when using the Record functionality. There are two buttons next to the file path text box. One allows opening of an existing Alembic file, and another is to save new Alembic files if you plan to record current hair state or animation.
    File name can contain "#" characters to denote a sequence format, ex. MyHair.###.abc. If such characters are encountered multiple .abc files will be loaded matching the sequence numbering, ex. MyHair.01.abc, MyHair.02.abc, MyHair.03.abc, etc. Timing inside the .abc files will be used to animate the resulting hair.
  • Time Offset and Time Scale
    You can use those two parameters to control the delay and playback speed of the animation.
 

On-Demand Alembic Sequence Loading 

As outlined above, the File Name parameter can contain # characters in which case a sequence of Alembic files can be loaded each containing individual animation frames. The loading of these files happens on demand. This means that, if for example, you have three files:
  1. myfile.000.abc
  2. myfile.001.abc
  3. myfile.002.abc
    then myfile.001.abc and myfile.002.abc will not be loaded until this modifier is evaluated on frames 1 and 2 respectively.

Such loading allows saving memory and processing power when rendering scenes containing heavy hair data sequences.

 

Recording 

The recording section in the Modify Panel allows you to capture one or more frames of static or animated hair and save them to an external _ Alembic.abc_ file. This state will then be used with this operator or with any other Animation Cache node which references the same .abc file.

The recording process will capture hair positions, widths, UV coordinates, strand groups, and any strand data. Current 3dsmax animation range will be recorded. Therefore, before recording make sure you change the animation range to match your desired recorded results.

To begin recording press the Record Active Time Range button. During recording you can see a progress bar and press Cancel to stop the recording process at any time. Any data already recorded will be saved.

 

Recording File Sequences 

If the target Alembic file name has "#" characters in its name then a sequence of per-frame files will be produced instead of a single Alembic file. For example, if the file name specified is Animation.###.abc and there are three frames being recorded you will end up with three files: Animation.000.abc, Animation.001.abc, Animation.002.abc. The digits within the file name will reflect the frame being recorded within the scene. This sequence of files will be loaded by this operator as an animation (read above for more).

 

MaxScript Access 

You may use standard properties exposed by showProperties myModifier to access and change this modifier.

 

Recording 

To record a time range into the modifier use the following MaxScript command:

strandAnimationModifier.Record startFrame endFrame

 

Examples 

You can find examples on usage of this modifier by examining the unit tests in Test_AnimationModifier.ms.

Missing Something? Let us know if this page needs more information about the topic.