Difference between revisions of "Internal Animation Format"
Jump to navigation
Jump to search
(Filled in field types) |
(Updated format (use Template:LLSD Field Entry)) |
||
Line 22: | Line 22: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| version | | {{LLSD Field Entry|name=version|llsd=integer|cpp=U16}} | ||
| | {{LLSD Field Entry|name=sub_version|llsd=integer|cpp=U16}} | ||
{{LLSD Field Entry|name=base_priority|llsd=integer|cpp=S32}} | |||
| | {{LLSD Field Entry|name=duration|llsd=real|cpp=F32}} | ||
{{LLSD Field Entry|name=emote_name|llsd=string|cpp=std::string}} | |||
| | {{LLSD Field Entry|name=loop_in_point|llsd=real|cpp=F32}} | ||
{{LLSD Field Entry|name=loop_out_point|llsd=real|cpp=F32}} | |||
| | {{LLSD Field Entry|name=loop|llsd=integer|cpp=S32}} | ||
{{LLSD Field Entry|name=ease_in_duration|llsd=real|cpp=F32}} | |||
| | {{LLSD Field Entry|name=ease_out_duration|llsd=real|cpp=F32}} | ||
{{LLSD Field Entry|name=hand_pose|llsd=integer|cpp=U32}} | |||
| | {{LLSD Field Entry|name=num_joints|llsd=integer|cpp=U32}} | ||
| | |||
| | |||
| | |||
| | |||
| | |||
|} | |} | ||
Line 52: | Line 41: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| joint_name | | {{LLSD Field Entry|name=joint_name|llsd=string|cpp=std::string}} | ||
| | {{LLSD Field Entry|name=joint_priority|llsd=integer|cpp=S32}} | ||
|} | |} | ||
Line 62: | Line 50: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| num_rot_keys | | {{LLSD Field Entry|name=num_rot_keys|llsd=integer|cpp=S32}} | ||
|} | |} | ||
Line 68: | Line 56: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| time | | {{LLSD Field Entry|name=time|llsd=integer|cpp=U32}} | ||
| | {{LLSD Field Entry|name=rot_angle_x|llsd=integer|cpp=U16}} | ||
{{LLSD Field Entry|name=rot_angle_y|llsd=integer|cpp=U16}} | |||
| | {{LLSD Field Entry|name=rot_angle_z|llsd=integer|cpp=U16}} | ||
| | |||
|} | |} | ||
Line 82: | Line 67: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| num_pos_keys || | {{LLSD Field Entry|name=num_pos_keys|llsd=integer|cpp=S32}} | ||
|} | |} | ||
Then, for each position key: | Then, for each position key: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| time | | {{LLSD Field Entry|name=time|llsd=integer|cpp=U32}} | ||
| | {{LLSD Field Entry|name=pos_x|llsd=integer|cpp=U16}} | ||
{{LLSD Field Entry|name=pos_y|llsd=integer|cpp=U16}} | |||
| | {{LLSD Field Entry|name=pos_z|llsd=integer|cpp=U16}} | ||
| | |||
|} | |} | ||
==Constraints== | ==Constraints== | ||
Line 102: | Line 86: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| num_constraints | | {{LLSD Field Entry|name=num_constraints|llsd=integer|cpp=S32}} | ||
|} | |} | ||
Line 108: | Line 92: | ||
{|{{LLSD Field Table}} | {|{{LLSD Field Table}} | ||
| chain_length | | {{LLSD Field Entry|name=chain_length|llsd=integer|cpp=U8}} | ||
| | {{LLSD Field Entry|name=constraint_type|llsd=integer|cpp=U8}} | ||
{{LLSD Field Entry|name=source_volume|llsd=uuid (?)|cpp=U8 array}} | |||
| | {{LLSD Field Entry|name=source_offset|llsd=string (?)|cpp=LLVector3}} | ||
{{LLSD Field Entry|name=target_volume|llsd=uuid (?)|cpp= U8 array}} | |||
| | {{LLSD Field Entry|name=target_offset|llsd=string (?)|cpp=LLVector3}} | ||
{{LLSD Field Entry|name=target_dir|llsd=string (?)|cpp=LLVector3}} | |||
| | {{LLSD Field Entry|name=ease_in_start|llsd=real|cpp=F32}} | ||
{{LLSD Field Entry|name=ease_in_stop|llsd=real|cpp=F32}} | |||
| | {{LLSD Field Entry|name=ease_out_start|llsd=real|cpp=F32}} | ||
{{LLSD Field Entry|name=ease_out_stop|llsd=real|cpp=F32}} | |||
| | |||
| | |||
| | |||
| | |||
| | |||
|} | |} |
Revision as of 23:28, 10 December 2007
Overview
From a programming perspective, there are several steps to uploading an animation from a BVH (BioVision Hierarchy) file:
- Read and parse the BVH file, creating an LLKeyframeMotion object containing the motion data.
- Gather input from the user (via the upload preview floater) for things like animation priority, facial expression, and looping; these settings are stored in the LLKeyframeMotion object.
- Serialize the LLKeyframeMotion object as LLSD.
- Upload the serialized data to the asset server.
Before other viewers can play an animation, they must:
- Download the serialized data from the asset server.
- Deserialize it to an LLKeyframeMotion object.
Relevant source files:
- linden/indra/llcharacter/llbvhloader.cpp
- linden/indra/llcharacter/llkeyframemotion.cpp.
Header
The first part of the animation data is a header describing various details about the animation as a whole. The elements, in order, are:
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
version | integer | U16 | ||
sub_version | integer | U16 | ||
base_priority | integer | S32 | ||
duration | real | F32 | ||
emote_name | string | std::string | ||
loop_in_point | real | F32 | ||
loop_out_point | real | F32 | ||
loop | integer | S32 | ||
ease_in_duration | real | F32 | ||
ease_out_duration | real | F32 | ||
hand_pose | integer | U32 | ||
num_joints | integer | U32 |
Joint Data
After the header is data for each joint in the skeleton:
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
joint_name | string | std::string | ||
joint_priority | integer | S32 |
Joint Rotation Keys
At the start of the rotation data is the total number of rotation keys:
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
num_rot_keys | integer | S32 |
Then, for each rotation key:
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
time | integer | U32 | ||
rot_angle_x | integer | U16 | ||
rot_angle_y | integer | U16 | ||
rot_angle_z | integer | U16 |
Joint Position Keys
At the start of the position data is the total number of position keys:
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
num_pos_keys | integer | S32 |
Then, for each position key:
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
time | integer | U32 | ||
pos_x | integer | U16 | ||
pos_y | integer | U16 | ||
pos_z | integer | U16 |
Constraints
After the joint data are a number of entries for joint constraints (whatever that means):
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
num_constraints | integer | S32 |
Then, for each joint constraint:
field name | description | LLSD type | C++ type | Note |
---|---|---|---|---|
chain_length | integer | U8 | ||
constraint_type | integer | U8 | ||
source_volume | uuid (?) | U8 array | ||
source_offset | string (?) | LLVector3 | ||
target_volume | uuid (?) | U8 array | ||
target_offset | string (?) | LLVector3 | ||
target_dir | string (?) | LLVector3 | ||
ease_in_start | real | F32 | ||
ease_in_stop | real | F32 | ||
ease_out_start | real | F32 | ||
ease_out_stop | real | F32 |