[TOOL] Blender HWRM Toolkit

Introducing the updated blender HWRM toolkit…


I have forked @DKesserich 's excellent Blender exporter and joint tools (Blender DAE Exporter for HWRM) to contain a few significant updates:

  1. Merged with the DAE importer (previously a separate addon): [TOOL] HWRM DAE importer for Blender

  2. Background tools…

blender_bg_panels

  • …to create background lights (as lamps with custom properties, so no more copying and pasting in the dae files)
  • …to create material parameter joints for planets (again with custom properties, since these sometimes became too long for Blender to export)
  • …to create cube map cameras and render them (render settings like resolution and format are still a bit manual)
  1. An early version of a level file importer. For the moment this is simply for visualising level files in Blender, but one day it could be used for creating and exporting them too…


IMPORTANT NOTE: These scripts have been developed using Blender 2.76. I cannot guarantee compatibility with other versions of Blender.

11 Likes

The export appears to export everything in the blend file, instead of just selection only. Is that expected behavior?

Edit: And is it compatible with Cycles material nodes? (for detecting the texture)

I don’t remember a time when it exported the selection only… The only thing I changed about the exporter was the way it treats the background material nodes. It should be quite easy to implement a selection-only export option though.

1 Like

Weird. That might explain some problems I’ve had in the past, heh.

Are these scripts compatible with Blender 2.8? Because whatever I try, installing it from within Blender or manually adding them to the scripts/addon folder, I can’t get them to install in Blender 2.8.

No, they haven’t been ported yet. Use Blender 2.79

Okay, thanks for the heads up.

I’ve been dusting off my old background efforts, and discovered that if I open the same .blend files that I used to use for this and export with the current blender(2.79b) and the 2.0 version of the toolkit, it produces .dae files that Hodor can’t find textures for. There are a fair number of differences between the files, but after some diffing, editing, and testing, I think I’ve IDed the main problem. Here’s a block from my old known-good file, from the library_effects section(inside the library_materials section).

<effect id="MAT[NegX]_SHD[background]-fx" name="MAT[NegX]_SHD[background]">
    <profile_COMMON>
      <technique sid="standard">
        <phong>
          <emission>
            <color sid="emission">  0.0 0.0 0.0  </color>
          </emission>
          <ambient>
            <color sid="ambient">  0.0 0.0 0.0  1.0</color>
          </ambient>
          <diffuse>
            <texture texture="IMG[sky_neg_x_DIFF]_FMT[8888]-image" texcoord="CHANNEL0">
              <extra>
                <technique profile="MAYA">
                  <wrapU sid="wrapU0">TRUE</wrapU>
                  <wrapV sid="wrapV0">TRUE</wrapV>
                  <blend_mode>ADD</blend_mode>
                </technique>
              </extra>
            </texture>
          </diffuse>
          <specular>
            <color sid="specular">  0.0 0.0 0.0 </color>
          </specular>
          <shininess>
            <float sid="shininess">1</float>
          </shininess>
          <reflective>
            <color>  1.0 1.0 1.0 </color>
          </reflective>
          <transparency>
            <float sid="transparency">1.0</float>
          </transparency>
        </phong>
      </technique>
    </profile_COMMON>
  </effect>

and now the matching block from the modern, broken export:

<effect id="MAT[NegX]_SHD[background]-fx" name="MAT[NegX]_SHD[background]">
      <profile_COMMON>
        <technique sid="standard">
          <cooktorr>
            <emission>
              <color sid="emission">0.0010000000474974513 0.0010000000474974513 0.0010000000474974513</color>
            </emission>
            <ambient>
              <color sid="ambient">0.0 0.0 0.0 1.0</color>
            </ambient>
            <diffuse>
              <texture texcoord="CHANNEL0" texture="IMG[sky_neg_x_DIFF]_FMT[8888]-image">
                <extra>
                  <technique profile="MAYA">
                    <wrapU sid="wrapU0">TRUE</wrapU>
                    <wrapV sid="wrapV0">TRUE</wrapV>
                    <blend_mode>MIX</blend_mode>
            </technique>
            </extra>
            </texture>
            </diffuse>
            <specular>
              <color sid="specular">0.0 0.0 0.0</color>
            </specular>
            <shininess>
              <float sid="shininess">1</float>
            </shininess>
            <reflective>
              <color>1.0 1.0 1.0</color>
            </reflective>
            <transparency>
              <float sid="transparency">1.0</float>
    </transparency>
    </cooktorr>
    </technique>
    </profile_COMMON>
    </effect>

After trial and error, I have found if you replace the cooktorr tag in the new file with the phong tag, with no other changes what-so-ever to the file overall, then suddenly it works again.

I’m very inept with blender itself, is there a material setting somewhere that I should be setting in the blend file to avoid this?

Assuming you are using Blender Internal Render - change the dropdown under Specular in the material pane from CookTorr to Phong.

1 Like

Yeah that worked. It might make sense for the exporter to automatically make that change?

2 Likes

Yes, it would be easy to do. I will have a look into it.

2 Likes

Updated in github. Now changes all materials to “phong” on export.

2 Likes

with blender 2.80 I’m really taking to modeling in it, but the plugin naturally doesn’t transfer to it without change. I poked at updating it myself, but it seems slightly beyond my understanding of the involved systems at the moment. How the prospects of a 2.80 compatible version of the toolkit looking at the moment?

I will look into it. My time is quite pressured and I am giving priority to getting the Taiidan Republic Shipyard finished, but I will try to give this some time as well.

Just wondering if in the future there might be a option like the “Name Fix” but for fixing orientations of models and emptys to be facing the “correct” direction, or at the very least something to help guide.

Yes i know using DAEnerys and manually tweaking the rotations to be correct is the best way to go but just wondering if its possible to have this idea

Do you mean so that you don’t accidentally build a sideways facing ship? It is very feasible to have a check of LOD[0] etc.

1 Like

yea many a time iv made a ship that “looked” fine in all the numbers etc, but unless i drop it into DAEnerys first 9/10 times its flying backwards or upsidedown, still get a giggle out of it tho

Whoa, hey folks, long time no post!

Cool to see that this is still alive. I’ve actually got some time off and decided to take a dip back into the toolkit and try to get it compatible with Blender 2.8x.

My thinking is that it’ll work with Cycles/Eevee materials, but only if you use the Principled shader, and only if you’re plugging your final image textures directly into the inputs on the shader.

I’ve actually got the DAE Importer mostly working again. Have to figure out making materials with python, but once that’s set taking that back into the exporter should be easy (also there’s something weird with that demo cube ship we’ve got because when I import it, Blender just shuts down with no errors. The Taiidan Interceptor example ship from Gearbox imports just fine, though.)

Then I have to figure out how to get the buttons and text fields for the Joint Tools back because the API for UI additions completely changed.

2 Likes

Hey, good to have you back again! There were always some dae files that made the importer crash - I never got to the bottom of it… Try unchecking the “split normals” box - that was implemented as a work-around for such cases.

Getting there…


Direct import, using Eevee material.

4 Likes