When a model file is opened, two tabs appear in the side panel. If the model includes animations, you'll find an animation bar at the bottom of the window, complete with controls for selecting and playing animations.
In the Model Editor, you can also work with any embedded materials and textures packed into the model file, allowing you to select and modify these resources conveniently.
Often times models that come in glTF and FBX format will use PNG and sometimes JPG files for textures. These image files are slow-loading because mipmaps have to be generated at load time. They also use more video memory because they get stored in an uncompressed pixel format in memory. You can optimize these models by selecting the Tools > Convert Texture to DDS menu item. This will convert all image files into optimized DDS textures using the appropriate compression format for each image. The resulting texture files will load faster and usually use less video memory.
When you are done with this step, save the model as a Leadwerks MDL file, since other model file formats may not support DDS textures.
In order for a 3D model to be reactive to physical collisions with other objects, it must have a collision shape set. You can assign a collision shape by selecting the top-most node in the model hierarchy. In the Physics properties, there is a drop-down box you can use to select a collider shape. The editor will attempt to choose the best size to make the collider fit the model, but you can adjust the offset, rotation, and size of the collider manually if it is necessary.
A box or convex hull collider works best for most objects.
The Mesh collider just uses the object's own geometry for the collision shape. This provides an exact match between visual and physical geometry, but it may not be ideal for detailed models, since more details shapes will cause the physics system to slow down. Additionally, objects using a mesh collider are always static in the world. Other objects can bump off of them, but the object using the mesh collider will remain still in the world.
For more complex shapes, the convex decomposition tool may be a better choice than a mesh collider. To open the tool, select the Tools > Convex Decomposition menu item. A window will open with many settings you can adjust to get the right shape. The resulting collider will be made of multiple objects, but each object will be a convex hull shape. With a little experimentation you can get a collider shape that matches the mesh geometry closely but isn't too complex.
Since the resulting collider is made of convex hulls, the object will be physically reactive in the world.
When you are done adjusting the collision shape, save the model as a Leadwerks .mdl file. Other model file formats do not support collider shapes.
If you have modeled a low-poly version of an object for collision and have it stored in another file, you can load this by selecting the File > Load Collider menu item. This will load another model as a mesh collider.
The model editor interface includes a tool for reducing mesh detail. To access this tool, select the Tools > Mesh Reduction menu item. When this tool is active, a wireframe overlay will be displayed on the model, for easy viewing of the mesh topology.
The slider at the top of the window allows you to adjust the detail, to try to reach a desired number of polygons.
Once you have reduced the mesh to your liking, you can press the Apply button to apply your changes to the base model, or press Add LOD to add the reduced detail mesh as a new level-of-detail model. LODs are reduced detail versions of a model that are swapped out when the viewer is further away, since not as much detail is visible from a distance. Using models with LODs can help improve rendering performance and framerates in complex scenes with many detailed objects.
When you are done adding LODs, save the model as a Leadwerks .mdl file. Other model file formats do not support LODs.
If you have modeled a low-poly version of an object and have it stored in another file, you can load as an LOD by selecting the File > Load LOD menu item. This will load another model and add the geometry as a new LOD.
You can generate an imposter for any 3D model, but these are usually used with trees. An imposter is a set of images drawn from one direction that are adjusted based on the angle between the object and the viewer. This can reduce complex objects to just a single plane made up of two triangles, greatly increasing the rendering performance of large scenes with many objects.
To run this operation, select the Tools > Generate Imposter menu item. It may take a few moments to complete the task. The resulting imposter mesh will be added as the last LOD shown in the model hierarchy. The editor will save three array textures, storing the base color, normals, and metallic-roughness values for each pixel, when viewed from a series of different angles.
When you are done adding an imposter, save the model as a Leadwerks .mdl file. Other model file formats do not support this feature.
The model editor provides tools for common animation operations.
Animations can be selected in the model panel, and two properties will be shown in the area below.
Name: The name of the animation. Animation sequences are often missing names, so adding them here can help identify which sequence is which.
Speed: This adjusts the default playback speed of the animation.
After making changes to a model's animation properties, you should save the model as a Leadwerks MDL file. At this time, only Leadwerks MDL files will include animation information when they are saved.
Sometimes a 3D model file will come with all animations stored in a single sequence. The extract animation tool allows you to copy part of an animation sequence into a new sequence.
You can set the first and last frames to include, and press the Apply button to add a new sequence with those frames. If the Trim this sequence checkbox is checked, then the existing animation sequence will be modified instead.