Blender DAE Exporter for HWRM

(Dragon93) #41

Starting to enjoy blender, controls still weird compared to 3ds Max :smile:

Engine button added to tool, pretty much all the basics for creating a small ship in now.
Probably have a button later for auto adding everything plus a box mesh for insta export readiness. Lights and big ship engines still to come.

Update: Extremely basic 2 second demo ship (a cube :wink: ) added; made with two clicks in tools; working ingame all though not showing up properly :smiley: - shows the tools work anyway!

(Dragon93) #42

Auto rotate on export added. Auto rotates ROOT by -90 degrees prior to export.
Currently doesn’t rotate back - simplest just to reload after export.
Officially fully working toolset! - Add Cube, Click “Convert to ship”, click “Add” (under engine - optinonal: set number of burners), save, export, HODOREST, test :smiley: (.ship required :wink: )
I’ll make a video outlining the process soon when I have time and if no one else does first.

Note: test cube still showing up rendered wrong, possibly triangulation related bug.

(D Kesserich) #43

I was going to make a video tomorrow, actually.

You do have to manually triangulate the mesh and manually apply any modifiers before exporting (I know there are triangulate and apply modifiers options in the export options, but I disabled the actual triangulate operation in the export script because it used a to_mesh operation, which duplicates the mesh on export and appends .001 to the object name, which messes up the ids and then HODOR can’t find the mesh data properly. I can’t find a way to triangulate in python without to_mesh.

Basically all that option does is set the mesh attributes to triangles and stride 3 for the vertex coordinate array in the DAE.

The Apply Modifiers option is completely disabled because that too uses to_mesh, and iterates through the modifier stack one at a time, so if you had three modifiers, the final mesh name in the DAE would be MeshName.003.)

(Dragon93) #44

Ah that makes sense, I’ll take a look around today/tomorrow.

Feel free to go ahead and make the vid then, It would likely be longer before I do it. Great work so far mate :smiley:

I would recommend leading through from the download of Blender, the Toolkit and HODOREST all the way in to enabling the addon and exporting since the average HW2 modder doesn’t seem to have had much experience in 3d modelling software.

(D Kesserich) #45

During my dry-run for the video walkthrough I discovered that the auto-rotate is doing some weird stuff, so I took it out.

You just have to remember to rotate the ROOTs by -90 on X, then select all in object mode and apply rotation before exporting.

(Dragon93) #46

Really? Worked for me, currently it finds anything with the word ROOt in it and rotates it then saves the change to data (Ctrl-A, important thing to mention). Was it turning something it shouldn’t or what?

(D Kesserich) #47

The problem with having it do a search for “root” is that for collision meshes it’ll rotate the root empty by 90 degrees, then it’ll rotate the collision mesh object by 90 degrees, then it’ll rotate the collision mesh mesh by 90 degrees, since they all have ‘Root’ in the name…

Anyway, finally finished putting together the Homeworld Toolkit Crash Course video:

I’m not super great at talking through tutorials.

[Vid-Tutorial] Blender-to-Homeworld Crash Course
(Dragon93) #48

Awesome work man, great intro to Blender to say the least and great explanation on all the quirks and requirements of getting things working - though I would recommend the usefulness of HODOREST (GUI), beautiful little tool; and I’ve got some ideas to add to it. Hopefully people will pick up blender now; definitely showed me some more reasons to ignore 3ds Max for this sort of thing - aside from the freedom we have to make tools :smiley:

Yeh I realised searching root is a pretty weak way to do it; definitely more than easy to do it manually - especially with the blender shortcuts. Though a few steps you were doing that are probably worth automating.
Plenty of things to look at in the next release version of the toolkit :smiley:

Great work and thanks for the mention!

(D Kesserich) #49

I also had an idea for something I might try in the export script that might make the long names issue less of an issue, at least for Navlights.

Basically, instead of using an empty with all the Navlight tags if we use a point light named NAVL[Navlight Number], then the exporter can pull all the light properties like size, distance, and color and just append them into the object name in library_visual_scenes, and just skip adding the light as an actual light, I’m less sure about how to handle the FLAGS parameter, though. I assume it has to be at the end of the object name, and I don’t know if it’s possible to be NAVL[Name]_FLAGS[flags] in the object name and then break apart the string to put the other parameters in the middle.

The big advantage to doing it like this will be that we can get a preview of how the lighting from the navlights will effect the textures on the ships, instead of having to go through the process of putting it in game and deciding the colour doesn’t look right, going back to Blender and adjusting the RGB values in the colour param empty (once that’s implemented), putting it back in, etc.

(Dragon93) #50

Sounds perfect - pretty sure the 3ds Max script did something like this, but spheres instead of actual lights. Sounds like a good plan. Playing with strings should be easy enough - although I recall you mentioned in your video that they are planning on changing HODOR to accept the flags as children; that would be even nicer - as we can have all the children as empties sitting on top/inside the light.

Pretty much everything we can think of to automate and skip extra steps in or out of the game is worth implementing - as long as it’s kept as approachable as possible.

P.S. worth sticking the video on Steam too.

(BitVenom) #51

Yup! The ‘old’ HOD->DAE (aka UNHOD) will have an option to use long names (Max) - or nested names (Blender). HODOR will create the ‘new’ HOD format from either. I may also add the re-orient flags so you don’t have to screw with them on export. I may want to talk to you guys about the details for that later this week.

Regardless - I can’t say this enough - you guys ROCK. Super, super killer to see a video of that detail.

(Dragon93) #52

That would be awesome :smiley:
Flags to auto-rotate would be great. If every ROOT could have a “_BLENDER” flag (or child) which was caught and resulted in a flip that would be awesome, and avoid confusion for 3ds Max folk. I’d assume all of the issues with saving object changes to mesh are all out of the way once we reach DAE; so a simple rotate shouldn’t be an issue on the HODOR end.
A flag in the HODOR param would make sense, but personally blender side would be better to avoid extra steps; as I said above, automating everything and using as few programs as possible is the best goal.

Does HODOR already support children then?

(BitVenom) #53

No - it’ll be in the next update, which keeps getting delayed as I have other things on my plate internally. Though, I am going to work on it a few more hours the next day or 2 - and get it the hell out to everyone :wink:

(Dragon93) #54

Sounds magic :smiley: - take your time, I’ve got enough distractions from my uni work as it is :stuck_out_tongue:

(D Kesserich) #55

I realized that for my proposed Navlight solution the Phase, Frequency, Flags and Type parameters can all be custom id properties on the lamp for the exporter to access.

This actually could apply to a bunch of stuff, and may make the nested names HODOR unnecessary, since the character limit is a Blender UI thing, not a Python thing.

Will take a fair amount of tinkering with the exporter to get it working for everything.

(Siber) #56

I would far prefer if it worked that way. Having all that in the name is pretty messy to deal with for the user.

(MatthTheGeek) #57

On the other hand, having it all in the name makes it much easier to script around it - string manipulation is extremely easy.

(D Kesserich) #58

It would still all be in the name in the DAE, they’d just be broken into individually manipulable properties in Blender.

The nested names solution wouldn’t be any easier to manipulate script-wise. I think it’d actually be a lot harder, since you’d have to deal with the names of a bunch of different objects instead of the properties of one object.

(Xercodo) #59

Been busy as hell and sorta letting HW simmer for a bit on its own and lo and behold you spat out a blender tutorial. As someone that has hardly ever touched 3D modeling this is AWESOME. (Oddly enough I found the tutorial while poking around YouTube first before seeing it here : P )

Try HODOREST for me and gimmie some feedback :3

Should be pretty easy to use and I think aside from not remembering your build list between sessions it’s nice that it easily lets you experiment between several different exports by letting you queue up several, activate or deactivate them, and then auto-generates a script that matches the sample and runs HODOR in the background for you : P

Btw @BitVenom I haven’t forgotten about adding to it. I wanna experiment a bit here with getting some models exported (now that I can actually use Blender to make something usable) and then maybe we can have a chat… if RL times will allow.

(Dragon93) #60

Good to hear, I’m finding HODOREST indispensable. Really well made. Two things I was thinking of was saving the build list like you said; as well as a project menu for selecting a mod and have all the saved ships related to that mod ready to run - with select all, deselect and checkboxes for selecting (could be auto-populated from folders or a saved mod specific list). But really nice and easy having a shortcut to blender, HODOREST and my test mod to pop in and out of :smiley: