Python & RMS
|
Introduction
The tutorial, Python: Parsing MoCap Data,
presented two python classes ( |
|
|
|
When used with an approriate interface with Maya the primitives generated by
|
|
|
Standalone Testing of the MoCapRMan Class
The code for the Step 1
The following scripts,
MoCapDB.py,
MoCapRMan.py and
MayaProjUtils.py
should be saved in the same directory, for example, /Users/jdoe/Documents/mocap_test Step 2
Download and unzip a sample TXT mocap data file from, Step 3
Make a directory named 'RIB_Archive' in the 'mocap_test' directory. Step 4Save the following python script in the 'mocap_test' directory as 'simple_test.py'. from MoCapRMan import MoCapRMan
scale = 0.01
# The following path and name of the mocap TXT will require editing.
datapath = '/Users/jdoe/Documents/mocap_test/handspring.txt'
spread = 1
steps = 1
pnt_width = 0.3
cache = 'Compute'
mo = MoCapRMan('anyname', datapath, scale)
rib = mo.writePoints(spread,steps,pnt_width,cache)
print rib
Open simple_test.py in Cutter and choose control+e, alt+e or Apple+e to execute the file.
Cutter's Process Monitor window will echo the path to the rib archive file created by
'mo'.
Step 5
The following rib file can be used to render the archive. Display "untitled" "it" "rgba"
Format 640 360 1
Projection "perspective" "fov" 20
ShadingRate 1
Translate 0 0 100
Rotate -30 1 0 0
Rotate 0 0 1 0
Scale 1 1 -1
WorldBegin
ReadArchive "PATH_TO_ARCHIVE"
WorldEnd
|
MoCapRMan, Maya & RMS
The easiest way to use
MoCapDB.py,
MoCapRMan.py and
MayaProjUtils.py
should be moved to the directory from which the users custom python scripts are sourced
by Maya. The interface is implemented by the following scripts. |
Maya Workflow
1. Create a proxy object, for example, a poly cube. |
© 2002- Malcolm Kesson. All rights reserved.