[eINFO] What I did to export my Blender 2.49 model into Havok format. (Long, enabled ingame!!)

By on September 7, 2010 5:53:31 AM from Elemental Forums Elemental Forums

Civfreak

Join Date 03/2006
+20

Ok so like many others I’ve been wondering for a while if it is possible to export Blender made models into Elemental’s Havok format (.hkb).

Update: I have managed to import my model inside the game and they have even kept the textures that I originally placed using UV Mapping! This wasn't all figured out by me though, Heavenfall has helped inmensely so I want to give him my thanks for taking the time to contribute even though he doesn't even use Blender! Thanks

Note on UVMap: The UV get flipped when you convert your model, so the only thing you need to do is Rotate your texture file. In my case the only thing I did was open the file with MSPaint and chose "Flip Vertically" and that corrected the texture.

This guide was made in Windows XP and it is for people who have Blender and DON’T have access to 3DSMax or Maya, although I'm willing to bet its somewhat similar.

There are quite a few steps to carry out in order to successfully change Blender’s format and you will need to download a couple of things as well.

Let’s start by pointing you in the direction of the tools/programs I downloaded:

 Look for Free to Download – Download Now (File size 445 MB)

 You will need to fill out some information before you are allowed to download.

Same here, you will need to fill out some information if you want to download the tools, they ask for your name and what you will download this tool for etc.

Ok so now that you got those two installers start off by installing Autodesk Softimage, simple. Now what I did next was install the Havok tools, look for the Havok installer and run it. Click next, agree to the terms of usage (after reading them!) then I left the Havok Animation and Havok Physics boxes checked as seen below:

Click next and you will be asked what components you wish to install. Since what we downloaded was Softimage, which according to Autodesk was previously known as XSI, we scroll down the list till we see the Xsi check boxes. Now since I wasn’t really sure what exact version of Softimage it was, I checked them all as seen in the next screenshot:

After clicking next it’ll ask you for the tools Destination, I just left it as default as seen below:

Click next and in my case I got a window saying “Could not find a suitable XSI 6.0 installation directory. Please choose one.”  Don’t worry, what I did was look for the directory where Softimage was installed and navigated down to the addons folder by clicking the Browse button:

Click ok and before pressing next, I suggest you copy the destination folder path seen bellow. Note that you need to copy the destination folder that applies to YOU, not sure if it neccessarly will be same as mine:

I suggest this because it will say to choose a directory for each of the versions of Xsi we checked at the start. So copy it and you can just paste the destination folder every time it asks you. After doing that you will start installing:

Afterwards it finishes installing that’s it, you should have a Havok folder in your Start>All Programs menu. Also you should have a “HavokContent Tools” folder in your Softimage Addons.

Exporting from Blender

Great so you did all that crap but how do I send a model from Blender to Havok format? Ok so first thing you will need to do is find a model that you want to export from Blender.

After playing around with these tools for 2 days I have discovered that there are different ways that you could export your Blender Model. I have used two formats that have worked so far, Softimage XSI and Autodesk FBX. I'm going to go ahead and recommend that you use Autodesk FBX since by trial and error I have learned that it is the least problematic. Regardless, in this guide I will give examples for both XSI and FBX formats and will label it properly.

So back to Blender, open up whatever model you wish to export and navigate your way to the Export menu by clicking the File > Export menu as shown in the picture below. As you can see I marked both formats that I've had success with so far, but remember I recommend that you use FBX since it will be less problematic from my experience.

Exporting Using Autodesk FBX Format

One thing I learned by trial and error using FBX format is that I needed to export my lights as well as my model. If I didn't the model would appear black ingame. Currently I don't know if there is a workaround this but remember to select the model as well as the lights. When selecting the FBX format as the export you get a screen with some options that looks like this:

You could leave this in the defaults settings and it should work, but I have made it a habit of clicking off "Enable Animation" if I am adding props for the Tile Editor since they don't require to be animated. (And as of the moment of writing this, I'm not sure how to add animations). Another thing to note is the "Selected Objects" and "Scene Objects". The default is Selected Objects so you need to make sure that you click the things you want to export, for example if you have 2 Objects in your scene, a character and a weapon you need to click them both to export them. Also remember to add lights to the export if you dont want your models to be dark when you get them in game.

Next press the "Export" in the lower right of the  box and then choose a folder to export to, somewhere you can find it easily (Like the desktop). Now click Export again and Blender should have created the new file at the specified location so remember name of the file and now you can close Blender.

Exporting using Softimage XSI

If you choose to Export as XSI, you do not get a pop up box with options, instead you just specify a folder to which you want to save the file to and just press Export and that should do it. So save the file to a location thats easy to remember and then you can close Blender.

Converting to Havok Format:

Now start up SoftimageModTools 7.5, say no to the update and Close the Netview window. Now to be honest I got no friggin idea how to use this program, I just used it to convert it to Havok format and heres how.

First thing you want to do is Import the model that you just converted to either ".FBX" or “.xsi”. In my case I placed the files in my desktop for easy access. First I'll give an example of importing an ".FBX" file then I'll give the ".XSI" example. Importing these two types of formats is slightly different, let's begin.

Importing FBX file

To import FBX files you will notice that it is different from XSI because instead of going to File>Import you need to go to the "Crosswalk" subfolder as seen in the picture below:

When you click on "Import FBX" another box will open so you can browse for the location of the file you wish to import. In this case I saved it in the desktop so I pressed the Up button in the upper left corner and navigated my way to the desktop as seen below:

Select the file and just click ok, and you get another set of options that you can leave as default and it should work. Here I have also made it a habit to turn off animation for static things like Props for the Tile Editor, just to try and minimize the room for error.

Press OK and yesssss your file should be loaded and you should be able to see it in the 4 viewports! Now Skip the XSI Import and go to the Havok Content Tool section to see the next step.

Importing XSI Format

 

To import go to the File menu at the top left then scroll down to Import, this will open another nested menu, in this menu look for “dotXSI…” and click that, example below:

For the next screen I deselected Animation because my model didn’t have any animation, but if someone wants to play around with that feel free to let us know:

Press OK! So now that that’s out of the way you need to find the file you exported from Blender, in my case I placed it in the desktop. So to navigate there I pressed the Up button in the upper left corner of the browser window and looked for my Desktop. Example below:

In my case my file was called Bano.xsi, press Ok and viola!, you should get your model in the viewports as seen below:

So tbh I don’t even know how to move the model around, I just know how to zoom in or out so if you don’t know about this program (like me) then don’t touch anything lol.

Havok Content Tools

Now that we successfully loaded the model the format that we chose won't make a difference and the steps will be the same. Next we need to make use of them Havok tools we installed earlier. If you look closely at the top toolbar you can see that there is a Havok Button!:

Now click that and select “Show Havok Toolbar” and you’ll open a toolbar like this:

So what interests us in this Toolbar is "Export and process scene" that is circled in the screenabove. Once we click this we will get the “Havok Content Tools – Filter Manager”. Now I wouldn’t have known wtf to do here if it wasn’t for Heavenfall’s screenshot in the “60 Days later “ thread, so thank you very much for that!

After some trial and error I have learned that the Filter Manager is extremely important and I recommend that you read the Havok User Guide that can be found by going to Start>Programs>Havok>User Guide. This guide contains some tutorial and explains in details all the tools that are found in the Filter Manager. I highly recommend you read it and try the tutorials, thanks to them I managed to import my animations into Havok format, although I haven't gotten them ingame yet. Maybe you can do it and teach me how

Anyways in the next screen what I did was add “Write to Platform” to the configuration set on the right side. If you don’t add anything the tool won’t do nothing, so just add Write to Platform for now. Example inc:

After you click add then it should be in the list in the right and now you need to do an important step if you want to load your models in game. If you highlight "Write to Platform" the format menu on the right will have 2 Options "Tagfile" and "Packfile". The only difference I know is that Tagfile changes the output format to .HKT and Packfile makes it .HKX. I initially ignored these and just left it as tagfile but my models wouldn't load in game with .HKT, and thanks to Heavenfall yet again, he pointed me in the right direction by telling me to use "Packfile" and thats what I did and turned out to be the right thing to do!

Another thing to know is that you can change the destination folder if you click the 3 dots button in the File Name Box. I usually select my desktop for easy of access but in this example I left it as the default path. Example inc:

Now click “Run Configuration” and the file should be created and you should see the destination file in the log window as seen below:

Now you have a newly created havok format model which you can find wherever you might've stored it! Now you can open up that newly created file using Havok Preview Tool to see how it looks like and Importing them to the game just requires you to change somethings in the XML to match for your newly created filename.

Pinned, Locked Post 37 Replies +1
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 5:53:46 AM from Elemental Forums Elemental Forums

Adding your Creations to Elemental: War of Magic

Ok if you're like me it wont suffice just to see my model in the Havok Preview tool. I want to see the fruits of my labor in game. NOW. Ok maybe it won't be right this instant but getting them in game won't be much longer. As of this moment I've practiced the most adding Props to be used in the Tile Editor, since I need to figure out animation still. You can also add your model to an unit and I will also explain that as well.

 

Adding extra "Props" to the Tile Editor

The great thing about adding Props is that it increases the already impressive possibilities of creating unique Tiles that can be made. The possibilities are limitless and taking into account that tiles can be used for a lot of things you can go crazy and build just about anything. So what are the steps required to add these new Props into the game? Glad you want to know cause here it goes in 3 easy steps!

Step 1: Place the Model you wish to export in the Props folder

If you followed the steps in the original post you should have a file that is ".HKX" format. As Heavenfall pointed in another thread, Elemental doesn't seem to have a problem reading HKX files so you can just put them in the folder with no worries. The files should be placed in the "GFX>HKB>Props" folder as well as the corresponding textures.

IMPORTANT: The correpsonding textures should also be placed in the same folder as the model but Elemental flips the UV's so you need to compensate for this. The workaround I do for this is I edit the image with MSPaint and I Flip the Image Vertically then save again and that fixes the UV.

Step 2: Create an XML file

With a text editor like Notepad++ just open a new blank document and what I did was open the "Coreprops.xml" in the "Data\English\Core Tiles\Props" folder and copy the format. Then I copied an existing Prop and just modified it to my liking. This new XML file you are creating needs to be placed in a folder that gets read by the game, for example (for Windows XP) the "My Documents>My Games>Elemental>Units" folder. The Data>English folder should also work. The code that I copied from the Coreprops was the following:

<?xml version="1.0" encoding="iso-8859-1" ?>
<PropTypes>
    <DataChecksum NoParse="1">
        <Ignore>DisplayName</Ignore>
        <Translate>DisplayName,TerrainName</Translate>
    </DataChecksum>

 <PropModelType InternalName="Tombstone1">
     <DisplayName>Tombstone1</DisplayName>
     <Tag>Kingdom</Tag>
     <Tag>Structure</Tag>
     <Tag>Prop</Tag>
     <Thumb>gfx\\hkb\\Props\\Thumbnails\\Tombstone1.PNG</Thumb>
     <Model>gfx\\hkb\\Props\\Tombstone1.hkx</Model>
     <Category>Structure</Category>
 </PropModelType>

</PropTypes>

In the above code I changed the Internal Name, Display Name, Thumb Path and Model path. That is all you need to change every time you add a new prop to your game. So everytime you add a new one, copy and paste the green text and change the information accordingly. In the previous example I added one of the tombstones seen in the picture below.

Note: I believe that blank spaces matter in XML, so if you try copy pasting my code and it doesn't work it might be due to blank spaces. Maybe try using the Coreprops.xml file for that or manually inputting the code above and taking into account that the blank spaces match.

Step 3: Load Elemental and check your Prop in the tile Editor!

Finally time to see your model in action! Click on the tiles and scroll alllll the way down and your new prop should be down at the bottom. If you want to make it faster deselect Empire Misc and Favorites since the prop we added belongs to the Kingdom group. Some of my models are lying upside down sometimes but thats not a problem since you can rotate them and move them using the Tile Editor tools!

Here is a result of the props I've added so far as seen inside the game, they are basically aimed to be used by Ravenx's Undead Rising Mod and I'm sure he will find cool ways to use em so stay tuned to that .

More to come on adding your models to units!

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 6:05:53 AM from Elemental Forums Elemental Forums

That's great work man. Excellent job!!! Now we just need to get Heavenfall or someone to take a look and figure out what we're missing. Then it'll be time to animate some Draconians

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 6:19:03 AM from Elemental Forums Elemental Forums

I'm going out on a very stretching limb here, but I think you need to "write to platform" as Packfile, not tagfile. That will create a hkx file I THINK. That hkx file can then be plugged right into the xml of your mods.

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 11:49:54 AM from Elemental Forums Elemental Forums

Quoting Heavenfall,
I'm going out on a very stretching limb here, but I think you need to "write to platform" as Packfile, not tagfile. That will create a hkx file I THINK. That hkx file can then be plugged right into the xml of your mods.

Thank you! I did just what you said and it indeed does change my file to hkx and I plugged it in just like it was and bingo I managed to load my model onto the game yessssssssssssssssssssssss! You are awesome I luv u!

Heres my sovereign bathroom in action lol:

I also increased the scale and funny things happened:

 Edit: Forgot to mention that the model is flipped, the wall next to the tub should be on the right foot, so thats another thing to take into consideration. Also the model's smoothing was also lost while importing/exporting and it is yet another thing that would need tweaking.

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 11:55:06 AM from Elemental Forums Elemental Forums

Nice!

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 3:34:26 PM from Elemental Forums Elemental Forums

For the record, I've not gotten any effect to stay when exported to HKX, except texture and UV maps for that texture. That is in 3d max, of course. I've not even gotten animations to work - I fear they need a separate animation file that is somehow linked up through bones. Of course for city tiles you can just do animations in the tile editor, but for weapons for example, I don't think we can do animations at the moment.

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 3:42:19 PM from Elemental Forums Elemental Forums

Ok so I went and deleted all that unnecessary equipment that was floating around and this time I attempted to import the draconian model I've been working on for the DragonLance mod. Since this is an initial test I went deleted everything except the mesh itself, I'm not too confident with my animations just yet.

This time exporting the model as XSI was giving me problems so I tried the .FBX format and that worked since Softimage has import options for that format as well so keep this in mind! I was surprised to see that my model had kept its texture(sorta) when I opened it up in the Havok preview tool, but in game the texture gets all fubared. Not sure why that would happen but here are the pics of the very first draconian in the world of Elemental!

As you can see in this attempt I forgot to toss the texture file in the same folder as the model, so I got this blank model. Another interesting thing is that my model is extremely small, even after I changed the scale to 3 in the xml file. Compare to Janusk and its still barely half as big as him.

Next up I tossed the texture file in the folder to see what would happen:

Now you can see that my model was indeed textured but the UV coords got fubared for some reason. I'm betting this is because the coord systems are opposite from those in blender. Of course it could be something silly and I just wouldn't know since I'm really just a Blender begginer . Another funny thing is that when I move my model, his front appears to be where the tail is pointing lol. So atm Im not really sure how I would go about to fix this. Lastly here is the preview of the model using Havok preview tool:

Here the texture seems to be correctly placed even though the chainmail is distorted for some reason and the model is still really small though. Thats it for now, if anyone has ideas on how to fix the orientation or texturing problems or anything else that might pop up please speak up, thank you!

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 3:47:26 PM from Elemental Forums Elemental Forums

I'm getting the same in 3ds max. The UV maps appear off by about 50%. As a workaround, until I can get it properly done, I just assign a texture to the whole item instead of using an UV map.

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 3:51:34 PM from Elemental Forums Elemental Forums

Quoting Heavenfall,
I'm getting the same in 3ds max. The UV maps appear off by about 50%.

Ah I bet if it won't work properly in 3DSMax it won't work properly either in Blender, since you need to export stuff into that type of format so the chance for error increases . I wonder if flipping the texture would do the trick, or inverting rather. I'm actually gona try that now

Edit: Nope, didn't seem to work I changed to scale to 6 and my model looks roughly the same size as a human now though!

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 4:15:19 PM from Elemental Forums Elemental Forums

21:58 <Heavenfall> Sorry for sending a private message. Do you have any tips for us trying to export our blender/3d studio max models into hkx format and getting the UV maps all wrong in-game?
21:58 <Cari_Elf> are you using a havok exporter?
21:58 <Heavenfall> yes
21:59 <Cari_Elf> we have a plugin that fixes the geometry to look the same way but I don't know if that would affect the uv maps
22:00 <Heavenfall> I've been turning my models around to compensate for that, but the real problem is UV maps... I do an unwrap UV map, follow the proper steps, and when the model loads in-game it's off by 50%
22:00 <Heavenfall> almost as if we couldn't scale the UV map
22:00 <Heavenfall> "we" = "I"
22:01 <Heavenfall> ill do a real quick mashup, just a sec
22:03 <Heavenfall> in-game vs 3ds max rendering http://img822.imageshack.us/img822/4461/elemental1283851381.jpg
22:11 <Cari_Elf> asking our graphic guru if our exporter also does correction for the uv maps
22:12 <Cari_Elf> he thinks that the uv map gets flipped

so time to experiment with that

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 4:30:48 PM from Elemental Forums Elemental Forums

It worked, I now see the same in 3ds max as I see in game. The texture was rotated 180 degrees on the U scale. Not mirrored.

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 4:38:06 PM from Elemental Forums Elemental Forums

Jesus, I leave for a little while and Civ does all that!  Nice.  Kudos to Heavenfall as well.  Nice job guys!

 

Civ I think we should make the bathroom a permanent part of Elemental.  Elemental:  War of Toilets!!!!!!!!!!!

 

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 5:03:22 PM from Elemental Forums Elemental Forums

Ahhhhhhh 180 degrees huh! Thanks yet again for the massive help my friend I flipped it in the wrong order when I was attempting that lol.

@Henry

Hahah make it to who can take the biggest dump right!?

 

Edit: Yessssss. got the texture to display correctly! I just edited the texture in MSPaint and only had to "Flip Vertically" and it all fell into place.

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 6:29:37 PM from Elemental Forums Elemental Forums

Update!

Managed to add a "prop" to the Builder's Forge (Tile Editor) and knowing that we can texture stuff I can say I'm pretty excited. As it is we can do just about anything we can imagine, toss it in the Tile Editor and create awesome stuff! Since we don't really know how to (or just flat out cant?) animate stuff for Elemental I think that the best thing you could do now is create assets for tiles for whatever mods you might be working on. I believe that with texturing and creating props the sky is the limit if you incorporate it with the Tile editor!

Adding props is really easy too! If you followed the guide to get a hkx file, then all you need to do is some simple xML tweaking and toss the model/prop you want to add into the GFX>HKB>Props Folder! The only xml thing I did was copy a core Prop and just paste it into a new xml file. The end result was this code:

<?xml version="1.0" encoding="iso-8859-1" ?>
<PropTypes>
    <DataChecksum NoParse="1">
        <Ignore>DisplayName</Ignore>
        <Translate>DisplayName,TerrainName</Translate>
    </DataChecksum>
 
 <PropModelType InternalName="WeirdStruct">
     <DisplayName>Weird Structure</DisplayName>
     <Tag>Kingdom</Tag>
     <Tag>Structure</Tag>
     <Tag>Prop</Tag>
     <Thumb>gfx\\hkb\\Props\\Thumbnails\\Heart_with_arrow_copy.jpeg</Thumb>
     <Model>gfx\\hkb\\Props\\Weird_Structure.hkx</Model>
     <Category>Structure</Category>
 </PropModelType>

Then just drop that XML file containing that code in the My Games> ELemental>Units folder. Notice that the only thing I changed was <Thumb> and <Model> to match the corresponding file to add. For some reason the Thumb didnt work out, maybe because its jpeg and it only accepts PNGs? or maybe i needed to put up JPEG in caps idk. This is the crappy thing I did in a hurry to test it out don't judge me :

 

Ill try some other stuff later, for now enjoy adding your props and creating awesome things!

 

Edit: Forgot to say that the model will possibly be flipped (was the case for me) but thats no problem since the tile editor has some nifty rotating tools that will help ya fix it right up!

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 7:58:58 PM from Elemental Forums Elemental Forums

excellent work mate!

Mobella is excited about the possibilities

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 8:21:29 PM from Elemental Forums Elemental Forums

Have to say awesome work. Cant wait to squash those Draconians with my army of Kenders! Onward insult layden hopaks of death!

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 11:39:24 PM from Elemental Forums Elemental Forums

Great stuff witht he First Pics Ever of a Draconian IN Elemental!!! It's a Historic day for progress on the Dragonlance Mod everyone!!! WoooHoooo!! Go Civ!!!

Reason for Karma (Optional)
Successfully updated karma reason!
September 8, 2010 3:38:07 AM from Elemental Forums Elemental Forums

Looking good guys.

Was there any word on when we will get the converter from Stardock?

Reason for Karma (Optional)
Successfully updated karma reason!
September 8, 2010 8:48:31 AM from Elemental Forums Elemental Forums

Wow really excited about this. You guys are doing a great job of forgeing the path for the rest of us to follow.

Reason for Karma (Optional)
Successfully updated karma reason!
September 8, 2010 9:54:56 AM from Elemental Forums Elemental Forums

Civfreak, you should update the first post with the packfile thing. It's not obvious that the user has to read the comments to make it work. Also, you should probably mention the UV fix as well.

Reason for Karma (Optional)
Successfully updated karma reason!
September 8, 2010 11:14:51 AM from Elemental Forums Elemental Forums

Tyvm for the suggestions, I've updated the original post and mentioned the UV being flipped!

If there is anything else that could be improved/change/etc I'm open to suggestions, I've never really done such a huge post like that before and I wish I could make it look as awesome as Wintersong's posts lol.

Reason for Karma (Optional)
Successfully updated karma reason!
September 9, 2010 12:22:58 AM from Elemental Forums Elemental Forums

This is impressive.

Once I launch the site, I will add this into the Ultimate Elemental modding wiki.

I am glad this post is stickied.

Reason for Karma (Optional)
Successfully updated karma reason!
September 9, 2010 2:31:03 AM from Elemental Forums Elemental Forums

You could approach the draconian model thrue modded equipment, though that isnt as friendly if new armor is introduced (less ideal than modding a human frame with a few extra pannels).  Though you could put all of the features on a cloak.  I.e. The face spikes or full face thrue the cowl, and the wings and tail on a tri-segmented hanging cloak.  Then that cloak could come in a few different designs and be race specific access. It would require sacrificing your cloak slot, but cloaks probably wouldn't play nice with the extra back features anyway.

Reason for Karma (Optional)
Successfully updated karma reason!
September 9, 2010 3:04:01 AM from Elemental Forums Elemental Forums

IMPRESSIVE

Reason for Karma (Optional)
Successfully updated karma reason!
September 9, 2010 4:01:40 PM from Elemental Forums Elemental Forums

I just discovered that if I try to use a .JPEG file as a texture when I try to get it in game it will not work. Seems it works with .PNG files so far, I haven't tried any other format but if anyone does try a different one please let us know the results .

@crystlshake

Atm I don't think we can open the game files to anything other than Previewing them. The Havok Content Tools don't seem to have an "Import" option, only export. I could be wrong of course since I'm just a noob with these programs, but I wouldn;t know how to do that.

I gotta leave so ill update a bit better later tonight.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000672   Page Render Time: