151
Help / Re: x2mdl/x2mm3d download (2021)
« on: April 15, 2021, 04:27:09 AM »
Critical Fix / mdl2x.exe added to ZIP
(http://www.swordofmoonlight.net/holy/x2mdl.zip)
I've patched x2mdl.exe to fix a problem I created by not testing code that I added to add a dummy part to merge control-points into their parent when there isn't a mesh in the part... This is likely to happen for a base CP except historically hard body animations omit this CP (implicitly defining it as 0,0,0) and a soft body animation historically only has one part, so it will necessarily have a mesh unless it's something like KF2's Fire Elemental that uses an SFX instead.
The bug happens because the part array is reallocated and that caused it to automatically deallocate any memory attached to it (I'd forgotten it used C++ destructors.)
Edited: I'm sure I meant to add the reason for this merge code was the arm.mdl model needs every part to map to a specific part of the arm, so the CP has to be merged into the hand or it will think the CP is the hand. Note that there is a fake CP in the arm.mdl file, but it's not a real CP, so it's not technically required.
Also I worked all day on this and merging parts for soft-body animations. Although I know that there is a way to have multi-part soft-body animations (and each part can be driven separately) no models have ever used that facility and I haven't explored it enough to unravel its inner workings.
I'd been trying to make KF2's skeletons walk. Their animation is pretty dopey as walking animations go, I think it's definitely something that should be improved on. But I was just trying to add a base CP so they can actually move off their spawn point. I'm not very good at this kind of animation (no real experience) and thought it might be easier to coordinate to move the CP independently of the body, so I added a new "joint", raised off the ground, and this showed that the hybrid system I'd setup didn't work correctly for joints that aren't bound to 0,0,0.
I plan to rebuild the skeleton animations as hard (aka skeletal) animations, and then improve their walk cycle under better conditions. I think probably KF2's walking patterns are just straight lines, however I've tried to modulate them to be less robotic for my project. I'm not sure why, at low/chaotic framerates KF2 gets away with a lot I think that just doesn't read at a smooth 60 fps.
EDITED: While I was uploading the source code I was reminded recently I modified mdl2x (not x2mdl) to write out material names in the X file (which it should've always done) and so I felt like may as well add that program to the pot since the source code is saved alongside it I think. Note, mdl2x writes Microsoft's X files in the "format" SOM's tools understand. (X is a virtually dead format which suffered I think because of its attachment to Microsoft and because no one used Microsoft's library to read/write them so there are so many different "dialects" of it and most programs have their own "dialect" of it instead of being written against the file format itself, e.g. its specification.)
EDITED: If you set D3DXF_FILEFORMAT=1 as a command-line "environment variable" mdl2x will write text files.
(http://www.swordofmoonlight.net/holy/x2mdl.zip)
I've patched x2mdl.exe to fix a problem I created by not testing code that I added to add a dummy part to merge control-points into their parent when there isn't a mesh in the part... This is likely to happen for a base CP except historically hard body animations omit this CP (implicitly defining it as 0,0,0) and a soft body animation historically only has one part, so it will necessarily have a mesh unless it's something like KF2's Fire Elemental that uses an SFX instead.
The bug happens because the part array is reallocated and that caused it to automatically deallocate any memory attached to it (I'd forgotten it used C++ destructors.)
Edited: I'm sure I meant to add the reason for this merge code was the arm.mdl model needs every part to map to a specific part of the arm, so the CP has to be merged into the hand or it will think the CP is the hand. Note that there is a fake CP in the arm.mdl file, but it's not a real CP, so it's not technically required.
Also I worked all day on this and merging parts for soft-body animations. Although I know that there is a way to have multi-part soft-body animations (and each part can be driven separately) no models have ever used that facility and I haven't explored it enough to unravel its inner workings.
I'd been trying to make KF2's skeletons walk. Their animation is pretty dopey as walking animations go, I think it's definitely something that should be improved on. But I was just trying to add a base CP so they can actually move off their spawn point. I'm not very good at this kind of animation (no real experience) and thought it might be easier to coordinate to move the CP independently of the body, so I added a new "joint", raised off the ground, and this showed that the hybrid system I'd setup didn't work correctly for joints that aren't bound to 0,0,0.
I plan to rebuild the skeleton animations as hard (aka skeletal) animations, and then improve their walk cycle under better conditions. I think probably KF2's walking patterns are just straight lines, however I've tried to modulate them to be less robotic for my project. I'm not sure why, at low/chaotic framerates KF2 gets away with a lot I think that just doesn't read at a smooth 60 fps.
EDITED: While I was uploading the source code I was reminded recently I modified mdl2x (not x2mdl) to write out material names in the X file (which it should've always done) and so I felt like may as well add that program to the pot since the source code is saved alongside it I think. Note, mdl2x writes Microsoft's X files in the "format" SOM's tools understand. (X is a virtually dead format which suffered I think because of its attachment to Microsoft and because no one used Microsoft's library to read/write them so there are so many different "dialects" of it and most programs have their own "dialect" of it instead of being written against the file format itself, e.g. its specification.)
EDITED: If you set D3DXF_FILEFORMAT=1 as a command-line "environment variable" mdl2x will write text files.