SAMDL - X-Hax/sa_tools GitHub Wiki
Note: The below was written before several changes occurred to SAMDL.
SAMDL
SAMDL is the model editor in SA Tools. It lets you view and edit hierarchical models, as well as inspect their properties, swap textures, swap meshes, and preview their animations.
Navigating the Editor
3D Viewport
The 3D Viewport (highlighted in magenta) is the primary window into the scene. You can use it to fly around and view the stage from various angles, select move and rotate objects within the scene, and various other tasks.
See 3D Editor Controls for default camera controls.
Model Graph
The Model graph (highlighted in Cyan) shows a list of everything inside of the model that can be edited, with the parent/child relationships intact. Child objects will inherit the pose (position, orientation, and scale) of their parent objects. You can select objects here and it will function in exactly the same way as if you had clicked it inside of the Viewport.
Inspector
Every object in the game world has many properties associated with it, and many times the game have properties that cannot be manipulated directly in 3d space via the viewport. For this reason, the Inspector (highlighted in green) will display as much information as possible about the currently selected object (In the case of multiple selected objects at once, it will display information that is common across the entire selection).
Loading Content
Loading a Model
Unlike SADXLVL2, which will provide a list of all the levels it can load that you can just select from, SAMDL is a much more discrete program, and at the moment, no such pre-defined list is supplied. Most models are self-contained and you can simply open the model file - however, SA(DX) character models are different. When working with SA character models, ensure you are opening the 'root' model (called 0.samdl for Sonic). This is important so that you get the entire model, for completeness' sake, and so that the animations can map onto the model hierarchy properly.
Loading a Texture
An untextured model, loaded in SAMDL You'll notice that when you open a model, its texture does not come with it. This is because, in the original source data, the texture file information is not included locally with the model data. We have not yet set up a full set of references to automatically handle this like we did with SADXLVL2, and really, that might be less appropriate for this tool since models are more likely to be generated ad-hoc. Because of that, if you would like to change the model's texture IDs or view the model with textures, you will need to load a texture file. For a list of texture files in the game, see this page on Sonic Retro
The same model, after textures have been loaded
Loading an Animation
Add info about loading animations here
- Don't forget to include the default hotkeys
Swapping pieces with the Model Library
Describe this
Model Import
If you are using Blender, instead of using SAMDL's import/export features it is recommended to open and save sa1mdl
and sa2mdl
files directly in Blender using Justin's Blender addon.
SAMDL can import and export models in DAE, OBJ and FBX formats using the Assimp library. Assimp support is experimental and may not work reliably.
The Import dialog has the following options:
Model Format: See Model Formats.
Import as:
- Nodes: Import the model as a hierarchy where each mesh is a node
- Single Model: Import all meshes as a single node
Import Root Node: Enable to import the root node in Collada, disable to import from the first child node. If the model is missing meshes, try toggling this option.
Legacy OBJ Import: Use old OBJ import instead of Assimp. Legacy OBJ import is more limited than Assimp and is only available for Basic single node models and the OBJ model format.