Python Resources

Updated on Feb 5 2022

Python In Houdini Examples

Deborah R. Fowler



Python in Houdini Example - Mocap data parsing

Updated May 9  2013
Updated July 11  2018



Mocap data parsing
- related to Exercise 3 for 705 is motion capture data parsing. Here are some simple examples of using the copy node (for example, a mace). You must create your own commented python script as the first part of this exercise.

NOTE: This is an exercise in scripting - you can bring in mocap data more easily by importing an fbx

This example is modified slightly from Nate Usiak's work in VSFX 705 in 2012
and inspired by Malcolm Kesson's site www.fundza.com.

To process data into a format suitable for Houdini a script written by Nate Usiak is given here.

This takes data from ascii txt format as found at http://accad.osu.edu/research/mocap/mocap_data.htm.
Thanks to the Motion Capture Lab of the Advanced Computing Center for the Arts and Design, Ohio State University.
This quarter, data from bvh format will be used.

 
Once that data is parsed ...

To take the resulting data into Houdini you must create a digital asset.

 

1. File->New Operator Type – brings up a dialogue box.

           

2. Hit Accept – an Edit Operator Type Properties window appears

            In the Basic tab be sure to set Minimum Inputs and Maximum Inputs to zero.

                        set the Label to be something unique (maybe include your name)

            In the Parameters tab set up two variables, one for the data files, one for velocity

                        (these parameters will be used in the code tab – they must match

                        I’ve used mocapFiles and velocityScale)

            In the Code tab place the script (courtesy of Nate Usiak found here)

                        make sure your parameters for source_file and velocity_scale match the code

                        ie. what is in quotes should be the names you used above ie. mocapFiles and velocityScale

 

3. Throw down a geo node

See my powerpoint for step by step screensnaps

A similar technique is used with python parsing and into mel. The sample script is here (by Sorya Serei)