Polyset Data Type
 
 
 

Syntax:

polyset <name> ( <component list> );

Reference:

<name>

Purpose:

A polyset is a polygonal mesh. It may be instanced as an object in the MODEL Section. A polyset may be specified as a literal or as a variable. If specified as a variable, it must have a name. Any of the following components may be specified between the parentheses:

Like a patch and a face, all components are specified using a keyword = value form. Components are separated by commas, and may be in any order. Not all components are optional. With the exception of the shader component, if components are specified multiple times, the last specification is used. Multiple shader components may be present in the polyset definition and be used by individual polygons. Components not specified take on their default value.

Example:

polyset Poly_1 (
 active = ON,
 motion_blur = ON,
 smooth = ON,
 doublesided = ON,
 opposite = OFF,
 shader = (DefaultShader ),
 shader = (ShaderNumber2 ),
 casts_shadow = TRUE,
 vertices = ((cv((-11.89838, 4.210732, 0.0), 1)),
 (cv((-2.174469, -7.479493, 0.0), 1)),
 (cv((-13.28751, -8.289707, 0.0), 1)),
 (cv((-2.174469, 6.409883, 0.0), 1)) ),
 texture_vertices = (
 st( 0.125000, 0.850394 ),
 st( 1.000000, 0.055118 ),
 st( 0.000000, 0.000000 ),
 st( 1.000000, 1.000000 ) ),
 vertex_normals = (
 norm( 0.000000, 0.000000, 1.000000 ),
 norm( 0.000000, 0.000000, 1.000000 ),
 norm( 0.000000, 0.000000, 1.000000 ),
 norm( 0.000000, 0.000000, 1.000000 ) ),
 polygons = (
 polygon ((0, 1, 2),(0, 1, 2),(0, 1, 2), 0 ),
 polygon ((1, 0, 3),(1, 0, 3),(1, 0, 3), 1 )
 )
); /* end of polyset ‘Poly_1’ */

active

Syntax:

active = <scalar>

Range:

0 (FALSE) or not 0 (TRUE)

Default:

TRUE

Purpose:

A Boolean flag that controls whether the polyset is visible or not.

Comments:

This component may be animated. This is provided so you no longer have to scale objects in an animation to 0 or translate them outside the scene for frames in which they shouldn’t appear.

Example:

active = FALSE

casts_shadow

Syntax:

casts_shadow = <scalar>

Range:

0 (FALSE) or not 0 (TRUE)

Default:

TRUE

Purpose:

A boolean that controls whether or not this polyset will cast a shadow.

Comments:

This component may be animated.

NoteA surface with transparent or semi-transparent shading will not cast a shadow when RayCasting.

Example:

casts_shadow = FALSE

clusters

Syntax:

clusters = (<cluster matrix list>),

Range:

N/A

Default:

None.

Purpose:

A list of cluster matrices that affect the current surface.

Comments:

A cluster matrix describes the initial position of the matrix (4X4 scalars), the type of cluster effect (JOINT or LEAF), JOINT level (or 0 if the type is LEAF), and translate, rotate, scale as 3 scalar tuples.

Example:

 clusters = (
 clm( CL_r_peak,
 1.0      ,  0.0      ,  0.0      ,  0.0      ,
 0.0      ,  1.0      ,  0.0      ,  0.0      ,
 0.0      ,  0.0      ,  1.0      ,  0.0      ,
 0.283681 ,  0.0285822, -0.5841172,  1.0      ,
 LEAF, 0,
 0.0      ,  0.0      ,  0.0      ,
 0.0      ,  0.0      ,  0.0      ,
 1.0      ,  1.0      ,  1.0      ),
 clm( CL_knot45_section0_Rwrist,
 1.0      ,  0.0      ,  0.0      ,  0.0      ,
 0.0      ,  1.0      ,  0.0      ,  0.0      ,
 0.0      ,  0.0      ,  1.0      ,  0.0      ,
 0.283681 ,  0.0285822, -0.5841172,  1.0      ,
 LEAF, 0,
 0.0      ,  0.0      ,  0.0      ,
 0.0      ,  0.0      ,  0.0      ,
 1.0      ,  1.0      ,  1.0      ) 
 clm( CL_cluster#10,
 1.0      ,  0.0      ,  0.0      ,  0.0      ,
 0.0      ,  1.0      ,  0.0      ,  0.0      ,
 0.0      ,  0.0      ,  1.0      ,  0.0      ,
 0.283681 ,  0.0285822, -0.5841172,  1.0      ,
 JOINT, 3,
 -0.2398842, -0.0303474,  0.0      ,
 0.0      ,  0.0      ,  0.0      ,
 1.0      ,  1.0      ,  1.0      )              ),

doublesided

Syntax:

doublesided = <scalar>

Range:

0 (FALSE) or not 0 (TRUE)

Default:

TRUE; that is, the patch will be doublesided.

Purpose:

The scalar will be interpreted as a Boolean, with 0 being FALSE and any other value TRUE. If doublesided is FALSE, rendering proceeds more quickly, but only one side of the surface is rendered. For most objects other than closed surfaces, doublesided = TRUE is desirable. The reader is warned that with the raytracer, rays may strike the object from any direction.

Comments:

This component may be animated.

Example:

doublesided = FALSE

light_list

Syntax:

light_list = ( <light>, <light>, … <light> )

Range:

Each light given must have been defined; literals may not be used.

Default:

See below.

Purpose:

Each item referenced must be the name of a previously declared light data item, or an array element of type light (see the Light Data Type for more information). Literals may not be used. This lists the lights to be used by this polyset. If light_list is omitted or if it is specified and is empty, all nonexclusive lights are used to illuminate the polyset. If light_list is specified, and the list contains defined lights, then all instances of those lights in the scene, and only those, will be used for this polyset. This enables situations where you may want 10 lights on a particular object, for example, but only two lights on the rest of the scene.

Comments:

This component may not be animated.

Example:

light_list = ( spot01, spot02, flood, globallight )

motion_blur

Syntax:

motion_blur = <scalar>

Default:

ON

Range:

0 (OFF) or non-zero (ON)

Purpose:

If motion_blur_on is set for the file, this flag indicates that motion blur should be calculated for this object.

Example:

motion_blur = ON

motion_blur_shading_samples

Syntax:

motion_blur_shading_samples = <scalar>

Default:

3 - for bump or displacement mapped objects

1 - for all other objects

Range:

>= 3 for bump or displacement mapped objects

> 0 for all other objects

Purpose:

If motion_blur_on is set for the file, this flag indicates the number of samples done for shading of motion-blurred objects.

Example:

motion_blur_shading_samples = 1

motion_blur_texture_sample_level

Syntax:

motion_blur_texture_sample_level = <scalar>

Default:

3

Range:

0-5

Purpose:

If motion_blur_on is set for the file, this flag indicates the level of sampling done for texturing of motion-blurred objects. A 0 indicates no extra samples (lowest quality) and 5 means highest quality motion-blurred textures. Note, this flag does not apply to bump or displacement mapping.

Example:

motion_blur_texture_samples = 3

norm

Syntax:

norm( <scalar>, <scalar>, <scalar> )

Purpose:

Part of a polyset vertex normal list. The 'norm()' specifies the vertex normal coordinate.

Example:

norm( 0.000000, 0.000000, 1.000000 )

opposite

Syntax:

opposite = <scalar>

Range:

0 (FALSE) or not 0 (TRUE)

Default:

FALSE

Purpose:

To reverse the sense of direction of the normal for the polyset.

Comments:

This component may be animated. If doublesided is FALSE (for example, for faster execution), opposite can be used to reverse the orientation of the backfacing and frontfacing parts of the polyset. This may be done in order to correct potential visibility problems.

Example:

opposite = TRUE

particle_collisions

Syntax:

particle_collisions = BOUNDING_BOX_COLLISIONS | OFF | GEOMETRY_COLLISIONS

Range:

As above

Default:

OFF

Purpose:

To define which objects collide with particles.

Example:

particle_collisions = BOUNDING_BOX_COLLISIONS

polygon_areas

Syntax:

polygon_areas = ( <scalar>, ... <scalar>)

Default:

none

Purpose:

A list of areas, one per polygon, to be used in particle emission calculations.

Comments:

This component may not be animated. As particle emission rates depend on the area of a polygon, the area list component allows the initial areas of polygons to be set and made constant. The area list is indexed by the polygon number, so that polygon 0 in the polyset would use the first element of the area list.

Example:

polygon_areas = ( 0.2, 0.3, 2.4 )

polygon

Syntax:

polygon( (<integer>, <integer>, <integer>), [(<integer>, <integer>, <integer>),] [(<integer>, <integer>, <integer>)] [, <integer>])

Purpose:

Part of a polyset declaration. The integers represent indexes into the vertex, texture vertices, and vertex normals arrays that must accompany a polyset declaration. Additionally, the last parameter indicates which shader of those specified in the shader declarations should be used for this polygon.

Example:

polygon ((0, 1, 2),(3, 4, 5),(6, 7, 8), 0 )

The above example indicates that the polygon should use vertices number 0, 1, and 2 for position, texture vertices number 3, 4, and 5 for texture coordinates, and vertex normals 6, 7, and 8 for normals.

The trailing 0 indicates that the first shader declared in the polyset should be used to shade the polygon.

Note that the texture vertex and vertex normal data is optional. If the texture vertex information is not specified then 0, 0 will be used as texture coordinates. If the vertex normal data is not specified (and the vertex_normals list is not specified in the polyset), then the normals will be computed prior to rendering.

polygons

Syntax:

polygons = ( <polygon>, <polygon>, ... <polygon )

Range:

Any list of valid polygons.

Default:

None. Must be specified.

Purpose:

To describe the connectivity of previously declared vertices in the polyset.

Example:

 polygons = (
 polygon ((0, 1, 2), (0, 1, 2), (0, 1, 2), 0)
 polygon ((1, 3, 4), (1, 3, 4), (1, 3, 4), 1)
 )

shader

Syntax:

shader = (<shader>)

or

shader = ( <shader>, <shader>, … <shader> )

Range:

The shaders given may be variables or array elements of type shader (see Shader Data Type for more information). Note that there is no such thing as a literal shader.

Default:

None. Must be specified.

Purpose:

This specifies which shading characteristics are assigned to the surface.

Comments:

This component may be animated. If a list of shaders is specified, they will be visible in the order given.

Note also that multiple occurrences of the shader component may occur in a polyset definition. This allows multiple shaders to be assigned to the polyset. The shader used for any given polygon is specified as part of the polygon definition.

Example:

shader = (pink)
shader = (blue)

smooth

Syntax:

smooth = <scalar>

Range:

0 (OFF) or not 0 (ON)

Default:

ON

Purpose:

To enable the user to smooth or flat shade a polyset.

This component is animatable.

Example:

smooth = ON

st

Syntax:

st( <scalar>, <scalar> )

Purpose:

Part of a polyset texture vertex list. The 'st()' specifies the texture coordinate.

Example:

st( 0.34, 0.322 )

texture_vertices

Syntax:

texture_vertices = ( <st>, ... [<st>] )

Range:

Any collection of valid polyset texture vertices.

Default:

None. Must be specified.

Purpose:

Defines the texture vertex array for the polyset. The first texture vertex encountered is considered texture vertex 0 for the purposes of the polygon indices later in a polyset declaration, the second texture vertex encountered is considered vertex 1, and so on..

Comments:

This component must be specified before the 'polygons' component.

Example:

texture_vertices = (
 st( 0.125000, 0.850394 ),
 st( 1.000000, 0.055118 ),
 st( 0.000000, 0.000000 ),
 st( 1.000000, 1.000000 ) ),

vertex_normals

Syntax:

vertex_normals = ( <normal>, [<normal>] )

Range:

Any collection of valid polyset vertex normals.

Default:

None. Must be specified.

Purpose:

Defines the vertex normal array for the polyset. The first vertex normal encountered is considered vertex normal 0 for the purposes of the polygon indices later in a polyset declaration, the second vertex normal encountered is considered vertex normal1, and so on..

Comments:

This component must be specified before the 'polygons' component.

Example:

vertex_normals = (

norm( 0.000000, 0.000000, 1.000000 ),

norm( 0.000000, 0.000000, 1.000000 ),

norm( 0.000000, 0.000000, 1.000000 ),

norm( 0.000000, 0.000000, 1.000000 ) ),

vertices

Syntax:

vertices = ( (<cv> [, <st>] [, <norm>]), (<cv> [, <st>] [, <norm>]), ... (<cv> [, <st>] [, <norm>]) )

Range:

Any collection of valid polyset vertices.

Default:

None. Must be specified.

Purpose:

Defines the vertex array for the polyset. The first vertex encountered is considered vertex 0 for the purposes of the polygon indices later in a polyset declaration, the second vertex encountered is considered vertex 1, and so on.

In version 7, it is now also possible to write the vertex normals and texture coordinates in separate lists of items, and index them separately by polygons. Because of this, Alias no longer places texture coordinates in the vertex definitions, though compatibility is maintained for older SDL files using this format.

Comments:

This component must be specified before the 'polygons' component. The <cv>s and <st>s are implicitly paired by the syntax, and this pairing is maintained.

Example:

vertices = ((cv((-11.89838, 4.210732, 0.0), 1)),
 (cv((-2.174469, -7.479493, 0.0), 1)),
 (cv((-13.28751, -8.289707, 0.0), 1)),
 (cv((-2.174469, 6.409883, 0.0), 1)) ),

The equivalent of this example with vertex normals and texture coordinates is:

vertices = ((cv(( 0.0 , -0.5 , 0.0 ),  1.0 ), st( 0.0 , 0.0 ), norm (1.0, 0.0, 0.0)), and so on.