How to fix SR4 SDK weapon templates(for Maya)

If you decided to try some weapon templates from SDK package and add them to the game, you'll get something like this. Pretty good, yeah? Pistols became really big in our times. But what was happened there?

8MWh4cG.jpg


See this stats? There is a blatant lie, model was made with inches as system units and now it's bigger more then 2.54 that it should be. Also model has some transform that rotate it.

dS7COgB.png


So how to fix it? I guess there are many ways to do it but I will be scale it.

Save skin weights Select mesh
F3->Skin->Export Weight maps...

Unbind skin
F3->Skin->Unbind Skin

Unfreeze mesh transform
okvUX5q.png


Scale mesh and root_bone in the attribute editor to 0.393 (1/2.54=0.393)

Freeze transform for both of them
Modify->Freeze transform

Bind skin. Select root_bone, than add mesh to selection
F3->Skin->Bind Skin

Load weights. Select mesh
F3->Skin->Import weights maps...
Maya save weights map as a simple texture, so if UV was mirrored you need to fix
F3->Skin-Paint Skin weights

O9mC1jh.jpg


That all, almost. For proper result you need to place tags in right position. Muzzle_Flash, shell_eject, gunmag_handle... Pretty simple, yeah? Not really, now you are taking step on the territory of pure magic.
FXnhSXI.png

First of all you need to mark some tag in game. Open weapon_costumes.xtbl table for you weapon(Flow754's weapon clone tool creating it ) And find <Constant_Effects/> section and replace it with something like this
Code:
<Constant_Effects>
                <Constant_Effect>
                    <Effect>vfx_lighter_flame</Effect>
                    <Weapon_Prop_Point>muzzle_flash</Weapon_Prop_Point>
                    <Condition>always on</Condition>
                   </Constant_Effect>
</Constant_Effects>

<Weapon_Prop_Point>
there is a section with tag's name muzzle_flash where <Effect> vfx_lighter_flame will be working when always on.

You can see position of your tag in game now. And you can see that position of your tag in editor and game is not the same. Experiments have shown that the position of tag is calculated from the origin of the maya's coordinates and you need to multiply tag's position on 2.54. Maybe that isn't right but I didn't find more precise way to calculate it.

Note: I guess you can create your own tags (Ctrl+G in Maya) with unique names and attach some effects on them. But it still needs to be checked
 
Last edited:
Back
Top