[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.

1 Like