This is a guide to the Misfit Model 3D scripting language. It includes only functions that are specific to Misfit Model 3D. Standard lua control structures and functions are not documented here.
For more information on using the scripting language, you may also want to review the Scripting Guide.
Descritption: Get the filename of the model
Arguments:Notes: If the model does not have a filename this function will return an empty string.
Descritption: Save the model as a specified format.
Arguments:Notes: Existing files will not be over-written. If writing the file in the specified format would cause an over-write, a number is added to the filename and incremented until the filename is unique.
Descritption: Get the number of vertices in the model.
Arguments:Notes: None
Descritption: Get the number of faces (polygons (triangles)) in the model.
Arguments:Notes: None
Descritption: Get the number of polygon groups in the model.
Arguments:Notes: None
Descritption: Get the number of bone joints in the model.
Arguments:Notes: None
Descritption: Get the number of textures in the model.
Arguments:Notes: None
Descritption: Get the ID of a group from its name.
Arguments:Notes: None
Descritption: Get the name of the specified group.
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Get the ID of a texture from its name.
Arguments:Notes: In most circumstances the name of the texture is the filename without its full path or extension. The exeption to this is if the model did not have textures explicitly associated with it and the model filter had to guess at texture file names. In this case the texture name will be the texture filename including the extension, but without the full path.
Descritption: Get the name of the specified texture.
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Get the filename of the specified texture.
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Create a rectangular mesh.
Arguments:Notes: None
Descritption: Get the number of vertices in the model.
Arguments:Notes: None
Descritption: Move a vertex to a new position
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Add an image file to a model as a texture.
Arguments:Notes: None
Descritption: Assign a texture to a group.
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Set the UV texture coordinates for a vertex of a polygon
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Texture coordinates are from 0.0 to 1.0. The origin (0.0, 0.0) is the lower-left corner of the texture, not the upper-right corner.
Descritption: Rotate the selected vertices and bone joints around the origin.
Arguments:Notes: Rotation is around the origin. If you want to rotate around an arbitrary point (x0,y0,z0) you can use the following steps:
Descritption: Translate the selected vertices and bone joints.
Arguments:Notes: None
Descritption: Scale the distance between selected vertices and bone joints.
Arguments:Notes: None
Descritption: Apply an arbitrary 4x4 matrix to the selected vertices and joints.
Arguments:Notes: The m13, m14, m15 elements are the translation elements.
Descritption: Any selected vertcies that share coordinates into one vertex.
Arguments:Notes: This does not weld all verticies into one. It only welds vertices that are very, very close to each other.
Descritption: Invertes the normals on any selected faces (polygons (triangles)). Effectively this turns objects inside-out so that light reflects off the opposite sides of the faces.
Arguments:Notes: None
Descritption: Assigns all selected faces to a group specified by name. The group is created if it does not exist.
Arguments:Notes: None
Descritption: Adds selected faces to an existing group.
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Creates a new animation
Arguments:Notes: Animation IDs are unique to their type, but can be the same for two different types. In other words, the first skeletal animation and the first frame animation are always zero (0). This is why you must use an animation type/mode string when you specify an animation ID.
Descritption: Sets the current animation from a mode string and an ID value.
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
You can set frame animation vertex positions or skeletal animation keyframes directly using functions below. You only need to use this function if you want to use matrix transformations to manipulate several animated primitives at once; for example, translating or rotating many vertex positions at one time.
Descritption: Sets the current animation from a mode string and a name string.
Arguments:Notes: You can set frame animation vertex positions or skeletal animation keyframes directly using functions below. You only need to use this function if you want to use matrix transformations to manipulate several animated primitives at once; for example, translating or rotating many vertex positions at one time.
Descritption: Sets the current frame of the current animation.
Arguments:Notes: You can set frame animation vertex positions or skeletal animation keyframes directly using functions below. You only need to use this function if you want to use matrix transformations to manipulate several animated primitives at once; for example, translating or rotating many vertex positions at one time.
Descritption: Get the number of animations of a specified type.
Arguments:Notes: None
Descritption: Get the name of an animation.
Arguments:Notes: None
Descritption: Get the frame count of an animation.
Arguments:Notes: None
Descritption: Change the name of the specified animation.
Arguments:Notes: None
Descritption: Change the frame count of the specified animation.
Arguments:Notes: None
Descritption: Change the animation speed.
Arguments:Notes: None
Descritption: Clear an animation frame so that all primitives are in their default position and orientation.
Arguments:Notes: None
Descritption: Copy an animation frame to another frame so that each frame is identical.
Arguments:Notes: None
Descritption: Move an animation from one index to another. This changes the order in which animations are listed.
Arguments:Notes: Animation indices and IDs are the same thing. If you move an animation its ID changes to its new index position. Other animation IDs may be changed as well if they appear after the old or new animation index.
Descritption: Create a new animation that is a copy of an existing animation.
Arguments:Notes: None
Descritption: Split an animation into two separate animations at a specified frame.
Arguments:Notes: None
Descritption: Join two animations together into one.
Arguments:Notes: In case the above argument descriptions are unclear, animation 2 will be appended to animation 1.
Descritption: Convert a skeletal animation to a frame animation.
Arguments:Notes: The two animations will complete in the same amount of time. The existing animation may be resampled if the frame count of the new animation is different from the existing animation. The new animation's frames per second will be changed to make the two animations compelte in the same amount of time.
In other words: frame_count1 * fps1 = frame_count2 * fps2
Descritption: Set a keyframe for a specified animation, frame, and joint. Keyframe may be rotation or translation.
Arguments:Notes: None
Descritption: Deletes a keyframe for a specified animation, frame, and joint. Keyframe may be rotation or translation.
Arguments:Notes: The joint will have its default position or orientation after calling this function. If there are rotation and translation keyframes, you must call this function twice to delete both; once with isRotation true, and once with isRotation false.
Descritption: Deletes a keyframe for a specified animation, frame, and joint. Keyframe may be rotation or translation.
Arguments:Notes: None
Descritption: Selects all primitives (vertices, faces, and bone joints)
Arguments:Notes: None
Descritption: Selects all vertices
Arguments:Notes: None
Descritption: Selects all faces
Arguments:Notes: None
Descritption: Selects all faces of all groups
Arguments:Notes: None
Descritption: Selects all vertices
Arguments:Notes: None
Descritption: Selects specified vertex
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Selects specified face
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Selects faces of specified group
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Selects specified joint
Arguments:Notes: IDs of any type are integers from zero to count-1 inclusive. Negative numbers are invalid.
Descritption: Unselects all primitives (vertices, faces, bone joints)
Arguments:Notes: None
Descritption: Send a message string to the debug log.
Arguments:Notes: None
Descritption: Send a message string to the warning log.
Arguments:Notes: None
Descritption: Send a message string to the error log.
Arguments:Notes: None