Import/Export Rig File FormatThis page is intended to explain the file format for the Import Rig and Export Rig commands within Layout in LW8, so that 3rd parties can create or read the rig files with custom applications. A “*.rig” file currently contains information about a hierarchy of bones (if a bone was selected before export command) or a specific object’s bones (if an object was selected prior to export). IK/FK settings and information such as targets and goals are included. The itemshape custom object is included as well. Expressions are not currently supported in LW 8.0. The rig file is an ascii text file. There are, at this time, 6 data card types contained within a rig file. The only nesting of one card inside another occurs with the itemshape custom object data card. Because an itemshape custom object(s) is specific to a null object, it is contained within that null object’s data card. Comment lines may be included in the file, at any place. Comment lines must simply begin with “**” (two asterisks). Lines in the rig file can be up to 256 characters long. Blank lines should not occur within a rig file unless they represent an empty character string. The types of data cards, and the order that they appear in the rig file are listed below. The format of each is explained after that.
To accompany this documentation, an example screenshot, a LW8 scene file, and rig file are provided. The header data card begins with
“BeginHeaderDataCard” text, and ends with “EndHeaderDataCard”. The header data card contains one named
field (“Version”), which is 4 lines long.
The first line is the version number, currently 2.0. The second line is the creation date for
the file (not used for anything, but shown on the panel when imported into
LW8). The third line contains the
file descriptor text (shown on the panel when imported into LW8). The fourth line contains the file’s path
(not used for anything currently). An
example of the header data card follows.
** Version 2.00 File Created on: Mon Mar 22
20:47:46 2004 Export/Import Rig File Format
Example C:\My
Documents\ImportExportFileFormatEx\ImpExpFileFormatExample.rig ** EndHeaderDataCard The
bone data card begins with “BeginBoneDataCard” text, and ends with
“EndBoneDataCard”. The bone data card
contains many fields in both text and numerical format, they are explained in
the table that follows, and are also
shown in the example bone data card
below. NOTE:
Bone hierarchies are written in the rig file in a similar fashion as they are
displayed within the SceneEditor, that is, when the SceneEditor has children
hierarchies fully expanded for view.
Thus if the “no_children” field for a bone is > 0, then the
children of that bone’s data cards immediately follow. Thus grandchildren of a bone may be listed before some other children
of that same bone, exactly as if they were listed in the SceneEditor. The included example of a LW8 scene
demonstrates this. See the
SceneEditor window within the example screenshot
for an example of this concept. Table
of bone data card fields (must be in order, must exist, or format error will
occur on import) follows.
BeginBoneDataCard LWItemID 40000000 bonename Bone1 no_children 2 restlength 1.802 prestposition -0.063112 0 -0.149333 prestrotation 3.65937 0 0 wrestposition -0.063112 0 -0.149333 pivot 0 0 0 pivotrotation 0 0 0 right -0.868921 0 0.494951 up 0 1 0 forward -0.494951 0 -0.868921 scale 1 1 1 boneflags 21 fallofftype 5 strength 1 weightmapname minrange 0 maxrange 1 jointcompamounts 1 1 muscleflexamounts 1 1 target 0 goal 0 limitsflag 0 hpbmin -3.14159 -3.14159 -3.14159 hpbmax 3.14159 3.14159 3.14159 no_tags 0 no_custom_obj_servers 0 controller 3 0 0 itemflags 1 goalstrength 1 stiffness 1 1 1 lookahead 0.033 color 1 EndBoneDataCard The Number
of Targets Data Card The
number of targets data card begins with “BeginNumTargetsDataCard” text, and ends with “EndNumTargetsDataCard”. The
data card contains 1 line, and not distinct fields, only one integer giving
the number of targets witching the rig file that are listed below. If a bone has a target that is a bone
within the rig being imported, it is NOT included in this number. Here
is an example of the Number of Targets Data Card: BeginNumTargetsDataCard 1 EndNumTargetsDataCard The
Null Object Data Card (for targets or goals) The null object data card begins with
“BeginNullDataCard” text, and ends with “EndNullDataCard”. The null object data card contains many
fields in both text and numerical format, they are explained in the table that follows, and are also shown
in the example of a null object data card. NOTE: Null objects are written in the rig file in
2 places, after the number of targets data card and after the number of goals
data card. If either of these are
zero, then no null object data cards would follow. As exported and imported currently, null object do not have
children. Table of null object data card fields (must be in
order, must exist, or format error will occur on import) follows.
Null
Object Data Card Example: The below example has one itemshape data card
within it. BeginNullDataCard LWItemID 10000002 bonename Target prestposition 0 0 0 prestrotation 0 0 0 wrestposition -3.31512 0 -2.72242 pivot 0 0 0 pivotrotation 0 0 0 right 1 0 0 up 0 1 0 forward 0 0 1 scale 0 0 0 itemflags 1 color 10 no_itemshapes 1 ** BeginItemShapeDataCard ItemShapeTime 0 ItemShapeOpacity 1 ItemShapeScale 1 ItemShapeAxis 1 ItemShapeFill 0 ItemShapeShape 8 ItemShapeFlags 0 ItemShapeSelectedColor 0 0 0 ItemShapeUnselectedColor 0 0 0 ItemShapeTextColor 0 0 0 ItemShapeLable Bone1 ItemShapeDescription None Bone6 ItemShapeSelfItemName Target ItemShapeLinkToName EndItemShapeDataCard ** EndNullDataCard The number of targets data card begins with “BeginNumGoalsDataCard” text, and ends with “EndNumGoalsDataCard”. The
data card contains 1 line, and not distinct fields: only one integer giving
the number of goals within the rig file that are listed below. Here is an example of the Number of Goals Data
Card: BeginNumGoalsDataCard 1 EndNumGoalsDataCard The
ItemShape Custom Object Data Card The null object data card begins with
“BeginBoneDataCard” text, and ends with “EndBoneDataCard”. The null object data card contains many
fields in both text and numerical format, they are explained in the table that follows, and are also shown in
the example of a null object data card. NOTE: Null objects are written in the rig file in
2 places, after the number of targets data card and after the number of goals
data card. If either of these are
zero, then no null object data cards would follow. As exported and imported currently, null object do not have
children. Table of itemshape custom object data card fields
(must be in order, must exist, or format error will occur on import) follows.
ItemShape
Custom Object Data Card Example: BeginItemShapeDataCard ItemShapeTime 0 ItemShapeOpacity 1 ItemShapeScale 1 ItemShapeAxis 1 ItemShapeFill 0 ItemShapeShape 8 ItemShapeFlags 0 ItemShapeSelectedColor 0 0 0 ItemShapeUnselectedColor 0 0 0 ItemShapeTextColor 0 0 0 ItemShapeLable Bone1 ItemShapeDescription None Bone6 ItemShapeSelfItemName RThighBone ItemShapeLinkToName HipBone EndItemShapeDataCard Summary In order to be sure one fully understands the rig file format, several examples should be generated by the user, exporting a variety of LW scenes so that the resultant files can be examined closely and compared to what item was selected and what entities were contained within the scene upon export.
|