SI_Shape

Specifies a shape: vertex positions, normals, colors, and (for version 3.5 and beyond) texture coordinates.

For versions 3.5 and later, TEX_COORD_UV# indicates that the shape contains a set of UVs. TEX_COORD_UV0, … TEX_COORD_UVn extends the SI_Shape template. The name of the UV domain follows the TEX_COORD_UV ID.

There are two possible layouts for the information:

Ordered—used to define an original shape

Indexed—used to specify shape animation in SI_ShapeAnimation

 

This template corresponds to the CSLShape class.

Limitations

This template changed between version 3.0 and 3.5. Version 3.0 (and previous versions) does not support the texture UV coordinate information, but version 3.5 and beyond does.

 

For a mesh, the original shape definition is in the SI_Shape template named “SHP-<objectName>-ORG” that occurs outside of the SI_ShapeAnimation template. This is true only for meshes.

For a NURBS or patch surface, the original shape is defined by the SI_NurbsSurface or SI_PatchSurface.

Introduced

2.0

Template

// Ordered form used to define original shape 
SI_Shape SHP-<objectName>-ORG
{
   <nbShapeArrays>,
   <layout>,

   // Arrays for each element (vertex positions, 
   // normals, colors, texure UV coordinates) being 
   // described in the template. There are always at 
   // least two (one for positions and normals each)
   <nbElements>,
   <elements>,
   <value_array1>,
   ...
   <value_array[nbElements]>,

}
// Indexed form used in SI_ShapeAnimation to specify shape animation 

SI_Shape SHP-<objectName>-<shapeIndex>
{
   <nbShapeArrays>,
   <layout>,

   // Arrays for each element (vertex positions, 
   // normals, colors, texure UV coordinates) being 
   // described in the template. There are always at 
   // least two (one for positions and normals each)
   <nbElements>,
   <elements>,
   <index1><value_array1>,
   ...
   <index[nbElements]><value_array[nbElements]>,

}

Members

Member

Type

Description

nbShapeArrays

int

Number of arrays in the template. There is one array for every kind of information.

For example, a simple cube without any texture projections or color indices contains 2 arrays: one for POSITION (the array of vertex positions) and one for NORMALS (the index of normals).

layout

char *

Specifies how the information is laid out in the template. Possible values are:

• ORDERED = Defines an original shape.

• INDEXED = Specifies shape animation in SI_ShapeAnimation.

nbElements

int

Number of this kind of element in the array. For example, there is one array of position values for each vertex in the template.

elements

char *

Specifies what kind of information appears in this section. Possible values are:

• POSITION = Array of positions for vertices.

• NORMAL = Array of normals information (see ni below).

• COLOR = Template contains Color information (see ci below).

• TEX_COORD_UV# = Template contains texture UV coordinates information (see uvi below). The number sign (#) represents the number of the texture UV coordinates starting at 0.

Note: The TEX_COORD_UV# element is only available in v3.5 and beyond.

If more than one of these is present, use a vertical bar to separate the strings (for example, "NORMAL|COLOR|TEX_COORD_UV0|TEX_COORD_UV1").

Note: Vertex positions are always present in a SI_PolygonList template (see vi below).

material

char *

Name of the material.

Note: This is only available in v3.5 and beyond.

index

int

Index (zero-based) of an element (position, normal, color, or uv coordinate) in the corresponding array of the original shape.

Note: This is used for indexed forms in shape animation templates only .

value_arrayi

array of ints

The structure of the array depends on what element was specified for this block of data:

• For POSITION, value_arrayi takes the form: <posxi>,<posyi>,<poszi>.

• For NORMAL, value_arrayi takes the form: <xi>,<yi>,<zi>.

• For COLOR, value_arrayi takes the form: <ri>,<gi>,<bi>,<wi>.

• For TEX_COORD_UV#, value_arrayi takes the form: <ui>,<vi>.

Note: The TEX_COORD_UV# element is only available in v3.5 and beyond.

Example

SI_Mesh MSH-superlow_scene.sphere37
   SI_Shape SHP-superlow_scene.sphere37-ORG {
       3,
       "ORDERED",
       3,
       "POSITION",
       0.164448,-8.263903,-0.94169,
       0.905932,-7.565758,0.607855,
       1.435514,-5.374897,1.758833,

       3,
       "NORMAL",
       0.138088,-0.923712,0.357335,
       0.350603,-0.761782,0.544762,
       0.533405,-0.203967,0.8209,

       3,
       "TEX_COORD_UV1",
       <texture space 1 name>
       1.0,0.0,
       -0.0,0.0,
       1.0,0.1,
       ...

       3,
       "TEX_COORD_UVn",
       <texture space n name>
       1.0,0.0,
       -0.0,0.0,
       1.0,0.1,
   }

   SI_TriangleList
   {
       1,
       "NORMAL|TEX_COORD_UV0|...|TEX_COORD_UV2",
       "superlow_scene.mat88",
       0,1,2,
   }
}


Autodesk Crosswalk v3.2