Skip to content

mexCostume

UnclePunch edited this page Aug 5, 2022 · 9 revisions

About

mexCostume is an optional symbol that exists in the fighter costume .dat file. It is an m-ex feature that allows you to add "accessories" to a fighter's model. They are separate from the fighter's models and are attached to the fighter during gameplay. These accessories are unique because they can have dynamic physics applied to them.

mexCostume can also be used to define custom visibility and material lookup tables for the fighter's model (more info to be added later).

Installing Template File

  • Download the template mexCostume symbol here.

  • Open your fighter costume .dat in HSDRaw.

  • Select Edit->Add Node->From DAT File ↓

    image

Accessory

Preparing Your Model

  1. Ensure your accessory model has two joints at the root of the skeleton.

    • Joint_0, known as the attach joint, will be attached to the fighter during gameplay. Any edits made to this joint's position, scale, or rotation will not appear in game, as they will be overwritten with the current values of the fighter's joint it is attached to.

    • Joint_1, known as the offset joint, will be used to offset the accessory from Joint_0 (the fighter's position). This is to ensure the accessory sits nicely on the fighters body.

    • Example: ↓ (attach joint and offset joint may be in the same position for you, that is fine and will be addressed in the coming steps)

      image

  2. Recommended: Include a low poly version of the accessory in the model.

Importing Your Model

  • Import your accessory model onto the RootJoint node. ↓

    image

Attaching Your Model

  • Find a suitable joint to attach your accessory to (Hint: Select a joint in the hierarchy to see it's position). It may take some trial an error to see which bone works best for the location of the accessory. Ensure the joint comes after Joint_4!

    image

  • Highlight Array_X_(MEX_CostumeAccessory) and view the property window. Change the AttachBone to the joint index you chose.

    image

Offsetting Your Model

Now that the AttachBone is set, the accessory will be moved to that joint's position in-game. We are going to emulate that in HSDRaw so we can accurately offset the model.

  • Move the viewport tab to the right side of the window: ↓

    ezgif-3-23d2bf55ee

  • Open the fighter model and the accessory model and select Render in Viewport for both: ↓

    image

  • Both the fighter model and accessory model should be visible in the viewport.

    image

  • Select the fighter's joint to highlight it in the viewport and hide all objects belonging to the fighter.

    image

    image

  • Open the accessory model's tab and begin manually moving Joint_0 on the accessory to the fighter's joint you selected earlier. This is a tricky process and will require trial and error and slight adjustments.

    image

  • Once the accessory's Joint_0 is at the fighter's joint's position, show all meshes belonging to the fighter.

    image

  • Select the accessory's Joint_1 and adjust its position, scale and rotation to best line up with the fighter's body

    image

Visibility Tables

We must also define which meshes belong to the high poly model, and which belong to the low poly model. Note: if your model does not contain a low poly version of the accessory, use the high poly mesh index in the low poly table.

  • Expand the LookupTable node to find the 4 different visibility tables:

    NVIDIA_Share_2022-08-05_00-34-30

  • Expand each table 3 more times to find the LookupEntry node and adjust Count to the number of meshes that belong to this version of the model. After doing so, expand the Entries dropdown with the arrow and begin defining the mesh indices. (If the number of entries does not match the count, click another node and click the LookupEntry node again to refresh it). Use the high poly model for MetalPoly and set Count to 0 for MetalMainModel.

    image

Setting Up Dynamics

If your accessory model is rigged for physics, you must define the amount of dynamic joints as well as initialize some parameters per joint.

  • Highlight Array_X_(MEX_CostumeAccessory) and view the property window. Change DynamicCount to the amount of joint chains that will behave dynamically. For example, Marths cape is comprised of 3 joint chains:

    image

  • Add a DynamicDesc for each joint chain:

    NVIDIA_Share_2022-08-04_23-41-46

    image

  • Set the bone index for each joint chain. This will be the first joint in the chain that should move:

    image

  • Add a set of parameters for each joint in the chain that should move. Warning: These parameter values are largely unresearched, so currently its best to copy values from similar existing dynamic joints (Marth and Ganon's cape, Jigglypuff's bandana, Links cap, etc). Example:

    image

    image

    image

Material Lookup

  • TBD

Visibility Lookup

  • TBD