Jump to content

Blender To HKX Development Thread


Recommended Posts

Posted

Found something of interest. I was looking go build the HavokMax exporter I linked earlier and discovered it needed HavokLib, a library by the same author.  The library has code to create Havok classes and to serialize them, either to XML or to HKK if I'm reading it right.

 

Better yet, already has Python support. So that's maybe 90% of what I was trying to figure out done for me. It still needs a little head-scratching about axes and co-ordinate systems, but to help with that I have the HavokMax plugin which should serve as a decent example. (Everything gets rotated ny the inverse of the parent matrix, unless that parent is root, if I remember right. Not sure if it needs adjusting for parent translation vector or not, but easy enough to check).

 

On the downside, I need to work out how to persuade the sodding thing to build. I always have problems with CMake and Visual Studio. And once I can do that, I need to port the Python interface to work with Python 3 rather than 2.7.

 

So, we'll see where that goes.

Posted

I feel so bad for you dude. 

 

IDK why Bethesda built the CK and supports modding but didn't provide the necessary tools to create a simple streamlined uniform process for content creation.

 

I just found out tonight about the idiotic hoops you all need to go through to acquire older versions of 3DSMax and the related plugins, like the Havok one. Autodesk is just getting worse year by year, their policies becoming more draconian.

 

Very generous work you're doing here man. Hope you get more support.

Posted

I appreciate the kind words :)

 

Anyone comfortable with CMake and C++? Only way I can get this library to build is in Release mode, but then my test code doesn't work and I can't debug into it to find out what's needed.

Posted

 

22 hours ago, Murderdevil said:

I feel so bad for you dude. 

 

IDK why Bethesda built the CK and supports modding but didn't provide the necessary tools to create a simple streamlined uniform process for content creation.

 

I just found out tonight about the idiotic hoops you all need to go through to acquire older versions of 3DSMax and the related plugins, like the Havok one. Autodesk is just getting worse year by year, their policies becoming more draconian.

 

Very generous work you're doing here man. Hope you get more support.

  1. The reason you need a specific version of havok (Which only works on specific version(s) of max and the Havok tools) is because the game reads a specific version of havok. Trying to use anythin else will cause issues. I know you can run with a newer version of max but it's hell to get it working. 
     
  2. Havok isn't something beth has ownership over, and it would have probably created issues for them to just distribute the havok stuff. It's out of their hands. Beth did what they could and that's that. 
Posted

@DocClox Sounds like a similar build environment to nifly, which I had to deal with. Nifly was built with CMake but in the end I just nuked it and built it myself with VS. It was easy enough to do--the build process itself was straightforward.

 

If you can get it to build in release mode, that means some of the switches in the Release profile are what you need to get everything to link up. If you can figure out what they are and copy them over to the other profiles, that might get you unstuck. In my case it had to do with... dammit... can't dig it up. Something about debug log levels not matching between my code and their library.

 

Anyway if you want I can have a look and see what I can see. 

Posted
23 hours ago, TheBottomhoodofSteel said:

 

  1. The reason you need a specific version of havok (Which only works on specific version(s) of max and the Havok tools) is because the game reads a specific version of havok. Trying to use anythin else will cause issues. I know you can run with a newer version of max but it's hell to get it working. 
     
  2. Havok isn't something beth has ownership over, and it would have probably created issues for them to just distribute the havok stuff. It's out of their hands. Beth did what they could and that's that. 

 

1. I know this already. That's why I find it annoying Bethesda didn't compensate somehow with proprietary tools to allow users to make their own content without needing too many 3rd party softwares or plugins. As time goes on, a lot of stuff becomes unattainable, at least, easily. They ought to streamline the process. 

 

2. I wasn't blaming Bethesda, in fact I mentioned it's Autodesk, their outrageous prices, lack of legacy support, as well as screwing over education institutes recently by making it difficult for students to acquire Autodesk products. They've recently made changes that restrict what kind of educational institutes are eligible and they've also introduced a server based license that has limited seating per school, meaning if someone is using a seat, and the seats are maxed out, you have to wait until another user logs out of their Autodesk product. 

 

It limits the amount of content creators who could get their feet wet in modding/developing, not just for Bethesda titles, or NSFW mods, but in general. Many modders end up deciding to become professionals and Autodesk makes it difficult for more people to be exposed to development. I hope Blender can become Fallout 4s main mod tool, and by extension many other games.

Posted
9 hours ago, Bad Dog said:

Anyway if you want I can have a look and see what I can see. 

 

Thanks. That could be useful.

 

I've  got a couple more leads I want to chase down, and if they don't pan out, I'll send you what I've got.

Posted (edited)

OK, that did it. I got rid of ExternalProject_Add and instead added a configure_file() step to force the download of the library. Then I ignore the library's build instructions and build it myself.

 

This is what I get:

 

<?xml version="1.0"?>
<hkpackfile classversion="5" contentsversion="Havok-5.0.0-r1">
        <hksection name="__data__" />
</hkpackfile>

 

Breathtakingly unimpressive, I know, but then I haven't populated the struct yet - a null hkx file is exactly what I was aiming for.

 

Next step is to add some actual data :)

 

[edit]

 

Better yet ...

 

<?xml version="1.0"?>
<hkpackfile classversion="5" contentsversion="Havok-5.0.0-r1">
        <hksection name="__data__">
                <hkobject name="0x246DE2F4620" class="hkRootLevelContainer">
                        <hkparam name="namedVariants" numelements="0" />
                </hkobject>
                <hkobject name="0x246DE2FFB50" class="hkaAnimationContainer">
                        <hkparam name="skeletons" numelements="0" />
                        <hkparam name="animations" numelements="0" />
                        <hkparam name="bindings" numelements="0" />
                        <hkparam name="attachments" numelements="0" />
                        <hkparam name="skins" numelements="0" />
                </hkobject>
                <hkobject name="0x246DE2F4C30" class="hkxEnvironment">
                        <hkparam name="variables" numelements="0" />
                </hkobject>
                <hkobject name="0x246DE327E10" class="hkaAnimationBinding">
                        <hkparam name="animation" />
                        <hkparam name="transformTrackToBoneIndices" numelements="0" />
                        <hkparam name="blendHint">NORMAL</hkparam>
                </hkobject>
        </hksection>
</hkpackfile>

 

Any more than that, and the program crashes due to trying to iterate over empty containers. So next I really do need to add some bones.  I think I'll start with one of the cut-down skeletons I was using earlier. Then I can compare it with actual output and see what's there and what's not.

Edited by DocClox
Posted

OK. Got my C++ to read JSON (which turns out to more challenging than expected, due in no small part to my misuderstanding the current directory when debugging the exe), and then I ended doing a partial rewrite of the python side of the exporter, because it's probably easier to invert matrices there than it is to do it in C++.

 

So there's nothing stopping me from plugging some of those values into the library and see what it spits out.

 

I'll do that tomorrow.

  • 1 month later...
Posted
On 6/11/2021 at 6:34 PM, DocClox said:

OK. Got my C++ to read JSON (which turns out to more challenging than expected, due in no small part to my misuderstanding the current directory when debugging the exe), and then I ended doing a partial rewrite of the python side of the exporter, because it's probably easier to invert matrices there than it is to do it in C++.

 

So there's nothing stopping me from plugging some of those values into the library and see what it spits out.

 

I'll do that tomorrow.

 

Hi, I just want to ask if you made any progress here ?

Posted
19 hours ago, poblivion said:

Hi, I just want to ask if you made any progress here ?

 

I've got what I think are all the bits I need. I've got an exporter script for Blender that dumps animation date to a JSON file, I've got a C++ program that reads the JSON file, and I've got a test program that plugs some test numbers into HavokLib and gets plausible looking hkx files out the far end. I just haven't found the time and energy to plug the all together lately.

 

If anyone wants to take a crack at it, I can post what I have.

Posted
13 hours ago, DocClox said:

 

I've got what I think are all the bits I need. I've got an exporter script for Blender that dumps animation date to a JSON file, I've got a C++ program that reads the JSON file, and I've got a test program that plugs some test numbers into HavokLib and gets plausible looking hkx files out the far end. I just haven't found the time and energy to plug the all together lately.

 

If anyone wants to take a crack at it, I can post what I have.

Please do - I'd love to take a look at it. As far as I can tell, there isn't another way to animate w blender for fo4 yet (afaik)

  • 4 weeks later...
Posted (edited)

I would love to just download FO4 and get all the bits and pieces to try animating for it in Blender.
I stopped making SLAL animations for Skyrim 2 years ago, picked up Blender smut animation, gotten pretty good and comfy with it.
Wanna test my skills with it.

Issue is I never really did much FO4 modding, but I'm used to downloading this and that until it eventually works :P 

I'm assuming there are some decent blender rigs around for it? 

Edited by _SpaceHamster_
Posted
On 7/12/2021 at 9:35 AM, DocClox said:

 

I've got what I think are all the bits I need. I've got an exporter script for Blender that dumps animation date to a JSON file, I've got a C++ program that reads the JSON file, and I've got a test program that plugs some test numbers into HavokLib and gets plausible looking hkx files out the far end. I just haven't found the time and energy to plug the all together lately.

 

If anyone wants to take a crack at it, I can post what I have.

 

There is buzz on AAF discord about the possibility of this happening. Just in case you were wondering if there was anyone cheering for it.

 

No pressure!

 

?

  • 4 weeks later...
Posted

thats a nif importer (which is big) but is not related to HKX/animation importer.

There's a gay animator in my server interested in making animations for FO4. But i've suggested him to wait for animation tools for blender since he has 0 experience with 3DS Max

Posted
1 hour ago, Ulfberto said:

thats a nif importer (which is big) but is not related to HKX/animation importer.

There's a gay animator in my server interested in making animations for FO4. But i've suggested him to wait for animation tools for blender since he has 0 experience with 3DS Max

 

Oh, okay. I saw the comment about rigged bones and got excited. Still yes, great news!

Posted
1 hour ago, Ulfberto said:

i've suggested him to wait for animation tools for blender since he has 0 experience with 3DS Max

 

He's better of getting 3ds Max and the Havok tools for it.

Since there are Rigs for pretty much everything floating around, you need about an hour to learn how to do animations in max, while a toolset for blender isn't really in sight.

Posted
1 hour ago, Vader666 said:

 

He's better of getting 3ds Max and the Havok tools for it.

Since there are Rigs for pretty much everything floating around, you need about an hour to learn how to do animations in max, while a toolset for blender isn't really in sight.

the day before yesterday the guy finished the os-based exporter / importer for the blender. Opens a rig with any bones. Of course, he will never have all the havok capabilities, most likely, but it will probably be more convenient to animate bones and insert ready-made animations into max for export to hkx now than doing everything in max.

Posted
1 hour ago, South8028 said:

Opens a rig with any bones.

 

From what i've read it sounds pretty much like its the skinning only.

So you can import and export a mesh that is skinned to a rig.

 

While it should be possible to export a character animation into a .nif this sounds like a horrifing thing to actualy achieve.

If you really want to animate in blender and use max just as exporter, blender can export to fbx...

Posted
5 hours ago, Vader666 said:

 

From what i've read it sounds pretty much like its the skinning only.

So you can import and export a mesh that is skinned to a rig.

 

While it should be possible to export a character animation into a .nif this sounds like a horrifing thing to actualy achieve.

If you really want to animate in blender and use max just as exporter, blender can export to fbx...

Do you happen to know if its possible to use MAX rigs on blender at least? We can import rigged bodies using PyNifly, but its not as useful as an actual rig for animation.

Posted (edited)
9 hours ago, Vader666 said:

 

From what i've read it sounds pretty much like its the skinning only.

So you can import and export a mesh that is skinned to a rig.

 

While it should be possible to export a character animation into a .nif this sounds like a horrifing thing to actualy achieve.

If you really want to animate in blender and use max just as exporter, blender can export to fbx...

it is obvious that in fbx. In nif, animation of bones can still be exported in 2013 max, but this will not be supported by the engine at the level of character animation. The result is a pe anim game object with one or more kinematic animation sequences. It won't be a creature. At max (no version) there is no fully working importer. There is an import, but textures during import are displaced uncritically only for objects with simple geometry. For creatures, you will always have to manually finish uv, otherwise small seams will come out. So a good importer, also able to open a rig, is out of competition now. You no longer need to depend on third-party rigs made exclusively for myself beloved for your version of max. Finally, you can also work fully with custom bodies. Most likely, now I can move the seam on the neck up.

Edited by South8028
Posted
7 hours ago, Ulfberto said:

Do you happen to know if its possible to use MAX rigs on blender at least?

 

I have never used blender.

The rigs i used and made in max were all CAT rigs, no idea if this matters for blender.

My best guess would be to export a max rig to fbx import that into blender and see what happens.

 

3 hours ago, South8028 said:

there is no fully working importer

 

How do you define "fully working" ?

I was able to import skeletons and skinned meshes using the nif plugin for Max15 to build my own animation rigs.

Textures did work, but honestly who cares about textures in max ?

 

3 hours ago, South8028 said:

Finally, you can also work fully with custom bodies.

 

The more i read what you write, the less i get what you're talking about ?

Posted
6 minutes ago, Vader666 said:

 

I have never used blender.

The rigs i used and made in max were all CAT rigs, no idea if this matters for blender.

My best guess would be to export a max rig to fbx import that into blender and see what happens.

 

 

How do you define "fully working" ?

I was able to import skeletons and skinned meshes using the nif plugin for Max15 to build my own animation rigs.

Textures did work, but honestly who cares about textures in max ?

 

 

The more i read what you write, the less i get what you're talking about ?

I have 13 max and other versions don't make sense for fo4. I'm not just worried about textures in max, but uv. I do not know how in 15 max, but in 13 when using nif importer uv more or less high-poly models is displaced. Not much, but there is an offset. The same happens when exporting / importing from fbx via os. This worries me because I have a custom body (hybrid cbbe with welded vertices and vagina with zaz bones). I have long wanted to cut out the body, arms and head from the same mesh (with this importer for blender it becomes possible).I don’t know if I’ve written it now, or not. I write through Google translator. ) As for the bones. If the mesh is imported with bones (if these bones do not fall off), then this is the rig. Accordingly, all bones that will be with the base body, head and arms can be exported further to max. The author assures that the bones do not fall off.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...