User Properties |
User properties are arbitrary text data that can be associated with any object in the Shockwave 3D§ scene. You can specify, for example, a URL link to be followed when the user selects an object, or a sound to be played when a given light is on. User properties exported with a model can be accessed with scripts once they are loaded into Director§. If you do not implement their functionality by some other means, some user properties can also be used to control the output from the exporter.
User properties are specified as property name and property value pairs. Property names are associated with property values with the equal (=) sign. Property values are terminated with a semicolon (;). Property names are alphanumeric, starting with an alpha character. No spaces are allowed between the user property and the equal (=) sign, and between the equal (=) sign and the start of the property value.
There is no limit to the number of user properties. Currently, property values are restricted to 512 characters.
Syntax Examples:
MyProperty1=A Monster called Fred;
CharacterLifeForce=10 units;
sw3d_visibility=front;
The following user property names are reserved by Shockwave 3D and trigger the following described behaviors when the .w3d file is loaded into Director. The exporter should be used to assign these properties to a model and programmatically implement them at export.
Note: All strings starting with "sw3d_" are reserved for future use by user properties in Shockwave 3D.
|
Property |
Value |
Default |
Description |
|
sw3d_visibility |
front/back/ |
front |
Controls initial visibility of a model Note: If set to none, the model is streamed but not initially visible. To make the model visible, set model(1).visibility = #front |
The following user properties are available in 3D Studio MAX to control the export.
|
Property |
Value |
Default |
Description |
|
sw3d_stream_priority |
[Unsigned |
256 |
Specifies the relative stream priority of a model and any textures used by the model (0 indicating the highest priority, with larger numbers indicating a lower priority). Note: Priority 0 denotes inclusion in the initial Load Segment. |
|
sw3d_texture_stream_priority |
[Unsigned Integer: 0..1024] |
1024 |
Specifies the relative stream priority of a texture. This control allows you to override the priority given a texture after setting the sw3d_stream_priority user property on a model that uses the texture. |
|
sw3d_lod_adjust_normals |
true/false |
true |
When true, creates new normals to track the new surface curvature as a model is simplified. When false, uses normals from original model and generates no additional normals to track the simplified surfaces. Note: When sw3d_lod_adjust_normals is set to true, the new normals are calculated according to the values of sw3d_lod_minimum_crease_angle and sw3d_lod_max_normal_error. Hint: Set this value to false to obtain the smallest file size. |
|
sw3d_lod_minimum_crease_angle |
Integer value in 10ths of a degree |
750 (75.0 degrees |
Sets crease angle value. As an object is simplified the angles between the surfaces change. When the angles exceed this value, a hard edge is formed by introducing separate normals for each surface. A small value results in a more faceted, chunky model. A large value results in a more realistic, smoother model with occasional shading errors. Note: This is only used when sw3d_lod_adjust_normals is set to true. Hint: The default value seems to work well for most models, so you probably won't need to change it. |
|
sw3d_lod_max_normal_error |
Integer value in 10ths of a degree |
1350 (135.0 degrees |
Trades off file size for lighting quality. Large values result in smaller files with more lighting errors. Small values result in larger files with better lighting through the generation of additional normals. Note: This used only when sw3d_lod_adjust_normals is set to true. |
If you do not want to mirror the 3D Studio MAX user properties in your own exporter using similar text strings, here is how to implement them programmatically:
|
Property |
Procedure |
|
sw3d_stream_priority |
Set the streaming priority of model with a call to the IFXNode::SetPriority()method
on the IFXNode that points to the model. Do this after all other
model setup activities are completed, in particular texture
assignments. By default, texture priorities are set to four times the
model priority. Allowed values: 0-256. Note: Priority 0 denotes inclusion in the initial Load Segment. |
|
sw3d_texture_stream_priority |
Set the streaming priority of all textures used by a model with a call to the S3DsceneGraphUtils::NodeSetTexturePriorities() method after the call to IFXNode::SetPriority(). Allowed values: 0-1024. Note: Priority 0 denotes inclusion in the initial Load Segment. |
|
sw3d_lod_adjust_normals |
Normal adjustment during mesh compilation is enabled by default. To
turn it off, access a MRMGenParams structure and unset the
MRMGP_NORMALSMODE and MRMGP_CREASEANGLE bits. |
|
sw3d_lod_minimum_crease_angle |
Change the crease angle with a call to the IFXAuthorMRMParams::SetNormal() method with the floating point crease angle as the second parameter. The angle has a range from 0.0 to 180.0 degrees. |
|
sw3d_lod_max_normal_error |
Control normal deviation by assigning it to the NormalDeviation element of the IFXAuthorGeomCompilerParams structure, which is passed to the IFXAuthorGeomCompiler::Compile() method. The angle has a range from 0.0 to 180.0 degrees. |
|
sw3d_visibility |
Set a model's visibility by calling the IFXModel::SetVisibility() method with 0 (no visibility) or any combination of the gs_uFrontFaceVisibility and gs_uBackFaceVisbility flags, as defined in IFXModel.h. You should also pass the user property text value through to Director (sw3d_visibility=both/none/front/back;)on the node, by making sure it is in the user property text block that is attached to an IFXNode via IFXNode::SetUserPropertyList(). |
|
Neighbor mesh generation |
Save file space and speed export by disabling the generation of a neighbor mesh for a model. This means that the model cannot be used with the Shockwave 3D #sds (subdivision), #toon, or #inker modifiers. There is no way to tell if the resulting .w3d file has a neighbor mesh or not, so be sure to flag these files to avoid confusion and frustration in not being able to apply certain modifiers. |
What is load priority?
Load priority is the method used by a .w3d file to define the general ordering of models and textures in the data that is streamed. Load priority values are unsigned integers that range from 0 to 256 for models, and 0 to 1024 for textures. Models and textures with the highest load priority significance appear before those with lesser significance. Load priority significance increases as the value decreases.
How is load priority specified in the Shockwave 3D Exporter?
For a model, this is done by setting a sw3d_stream_priority assignment for the model's user properties. You can also set the steaming priority of model with a call to the IFXNode::SetPriority() method on the IFXNode pointing to the model. In the latter case, make sure to do this only after all other model setup activities are completed, in particular texture assignments.
For all textures used by a model, this is also done by setting a sw3d_texture_stream_priority assignment for the model's user properties. You can also set the streaming priority of all textures used by a model with a call to S3DSceneGraphUtils::NodeSetTexturePriorities() immediately after the call to IFXNode::SetPriority() in which you pass in the pointer to the same IFXNode.
What is the default load priority for all models in Shockwave 3D?
The default load priority of all models is 256. A model's default load priority is overridden if the sw3d_stream_priority user property is specified for the model, and its value is less than the default of 256. If there are multiple model instances using a common resource, the most significant priority value (that is, the numerically smallest load priority value) is used for the model resource geometry and any associated textures.
What is the default load priority for all textures used by all models in Shockwave 3D?
The default load priority of each texture is the most significant load priority specified for all of the models that use the texture, multiplied by 4. If all of the models using the texture have the default load priority of 256, then the default load priority of the texture will be 1024. If some of the models that use the texture don't have the default load priority and 10 is their most significant load priority, then the default load priority of the texture will be 40. A texture's default load priority is overridden if the sw3d_texture_stream_priority user property is specified for the texture, and its value is less than the calculated default.
How does load priority affect what's in the initial load segment for a Shockwave 3D file (for example, the ILS or what will have been loaded when the Lingo state reaches header loaded or 2)?
The load priority for a model and its textures only affects where the geometry update records and texture image data are placed in the .w3d file. All of the other types of data are placed in the ILS without respect to the load priority. This includes group nodes, model nodes, lights, materials, animations, motions, initial model resource definitions, initial texture definitions, etc. If the load priority for a model is 0, then its geometry update records and texture image data will be placed in the ILS. If the load priority for a model's textures is 0, then the texture image data is placed in the ILS, while the model is not (assuming the model does not also have a load priority of 0). An object will be in the ILS if its load priority equals 0.
Does the texture image data required for a model appear in the Shockwave 3D file before or after the associated geometry update records?
By default, if the exporter is set to save the textures, some of a model's geometry update records will appear before the texture image data used by the model. However, if a load priority for the textures is specified that is more significant than the model's load priority, the texture image data will appear before the geometry update records.
Are material colors, vertex colors, and face colors saved by the Shockwave 3D Exporter?
Only material colors are saved by the exporter. The vertex and face colors are not saved because they are not currently supported by the .w3d file format.
§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.