Skip to content

variants: robes without skin, the robe's own bones and attachments, the body's animation scale; check and repair for robe nodes under torso_g - #112

Merged
plenarius merged 2 commits into
mainfrom
fix/variants-rigid-custom-bones
Oct 23, 2026
Merged

plenarius merged 2 commits into
mainfrom
fix/variants-rigid-custom-bones

Conversation

@plenarius

Copy link
Copy Markdown
Owner

Found while making Layonara's missing brownie robes and cloaks: 340 models, robes for both brownie phenotypes and cloaks. They were checked in game against the human versions, front and back.

variants

  • Robes with no skin (backpacks, pieces hung on bones) are refitted instead of refused.

  • The robe's own bones and attachments are placed at their offsets scaled to the body:

    • flaps, coat tails and skirt panels;
    • capes on shoulder pads;
    • backpack pieces.

    Across and front to back the scale is the chest's; up and down it is the hip height. What hangs from them is scaled the same way. Before, they kept the human's size, and a cape reached below a brownie's feet.

  • Only body bones the template lacks still come from the skeleton, or stay out (a wemic's robes have no legs).

  • A bone's axis now comes from its child bones only. These no longer set it:

    • a child under 2 cm from the joint (it tipped Beamdog's HD robe 30);
    • the robe's own bones;
    • meshes that are no bone (a backpack's pieces turned the torso backward).
  • Each mesh uses its own node's transform, not the first node of its name. A server's robe 202 has two Cloak_Base.

  • A cloak built from the skeleton takes body bones beside the torso (neck_g) from the skeleton.

  • The body's animation set and scale. A robe on the source body's animations (a_ba, a_ba_coat, a_fa_skirt) gets the target body's set at the target's animation scale, as Bioware's race versions of robes 20 and 21 have (pmd0_robe020: a_da_coat at 0.66). At scale 1, brownie robes floated over their heads in game.

Fit accuracy against Bioware's and the hand-made versions is the same as v4.13.0 or better:

v4.13.0 now
Brownie bone copies 2.02 / 2.20 cm 2.01 / 2.17 cm
Stock robes, skin 3.42 cm 3.41 cm
Stock robes, bone copies 2.65 cm 2.61 cm
Cloaks unchanged unchanged

check robe_torso_turn, repair --fix-robe-turns

On a worn robe, the game draws a node whose parent is torso_g as if it had no rotation. This was found in game and is written up as plenarius/nwn-mdl-spec#9 (MDL-NODE-050).

  • The check reports such nodes in robes.
  • The repair (part of --all) puts the rotation into the node's geometry and its children's placement, leaving the node unrotated. The model is drawn as it was built.
  • Left alone: body bones, dummies with nothing under them, and nodes the robe's own animations turn.
  • Results: nothing in the base game is flagged. Layonara's 608 affected robe files were fixed the same way in layonara/nwn-haks#36 and checked in game.

New tests cover each fix; they fail without it. Neither change touches the decompiler, writer, parser or compiler, so the Python port needs nothing.

Not in this PR: cleanmodels-qt doesn't offer --fix-robe-turns as a Clean fix of its own yet; it only gets it through All Fixes.

…chments

A robe of bone copies and attachments alone (a backpack) is refitted instead
of refused. Bones of the robe's own that neither the template nor the
skeleton has (flaps, coat tails, skirt panels), and the nodes of its other
meshes the template lacks (a cape on shoulder pads), are placed at their
offsets scaled to the body, chest across and hip height up and down, and
what hangs from them is scaled the same; before, a human's cape reached
below a brownie's feet. Only body bones the template lacks still come from
the skeleton or stay out (a wemic's robes have no legs).

A bone's axis comes from its child bones only: a child under 2 cm from the
joint (the belt_g of Beamdog's HD robe 30), the robe's own bones and meshes
that are no bone (a backpack's pieces) no longer set it. Each mesh is read
and written through its own node's transform, not the first node of its
name (a server's robe 202 has two Cloak_Base). A cloak built from the
skeleton takes body bones beside the torso (neck_g) from the skeleton.

A robe on the source body's animations (a_ba, a_ba_coat, a_fa_skirt) gets
the target body's set at the target's animation scale, as Bioware's race
versions of robes 20 and 21 have (pmd0_robe020: a_da_coat at 0.66), or the
target's skeleton when there is no such set. Named at scale 1, the human
animations floated a brownie's robe over its head (checked in game).
…o_g drawn unturned

On a worn robe the game draws a node whose parent is torso_g as if its
orientation were the identity (nwn-mdl-spec MDL-NODE-050, found in game: a
server's robe 202 has a cape panel on a shoulder pad turned 180 degrees,
and it stood up above every wearer's shoulder). The check reports such
nodes in robes; the repair, part of --all, puts the turn into the node's
vertices, normals and tangents and its children's placement, with the
node at the identity, which is drawn as modelled. Body bones (turned by
the animations, skins bind to them), dummies with nothing under them, and
nodes the robe's own animations turn are left alone.
@plenarius
plenarius merged commit 5c2c147 into main Oct 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant