Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

SE Block Tools for Blender

Discussion in 'Modding Guides and Tools' started by Harag, Feb 6, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Harag Junior Engineer

    This addon is a productivity tool that simplifies the steps you need to take to get from a 3D mesh in Blender to Space Engineer’s own .mwm mesh-format. To do that
    1. The addon provides property panels for all the special data SE stores inside an .mwm file directly in Blender.
    2. You use Blender layers to define the main model, the collision model, mount-points, mirroring, level-of-detail models and construction stages.
    3. The addon understands this workflow and automatically configures and runs the conversion-tools (Havok, MwmBuilder) you would normally run by hand. You can also customize this to export characters and animations.
    Also, it is installed into Blender, not your .blend file. That means it works with any .blend file and can be updated independently.

    This addon initially saw the light of day in NimrodX' thread Space Engineers Mod Toolkit for Blender. It incorporates a lot of the information gathered in that thread. So my thanks go to NimrodX, Nilat and Shaostoul who contributed them with me.

    Please be so kind to read the documentation before asking questions on how to use the addon.

    You can get the latest release on the release page.
    The addon is open-source, hosted on GitHub.


    Thanks to @craigp and @Shaostoul there are two sets of tutorial videos showing the addon in use:

    Last edited: Apr 12, 2016
    • Like Like x 3
    • Funny Funny x 1
  2. Harag Junior Engineer



    Exposed the FBX exporter settings for each MWM exporter node on the Properties panel of the node. This allows to export additional scene data to Space Engineers. There already are presets for
    • characters (skinned meshes + armature)
    • animations (armature + animation data)
    • This version includes major changes to how textures are handled in order to support DirectX 11.
      • The addon now expects scenes to use the Cycles rendering engine
      • Added an improved Cycles shader to preview and render with DX11 textures.
    • Added support for the highlight property on empties. This allows to model custom highlight-shapes for interaction handles.
    • Added more nodes to filter by object name, group name and block size
    • Added error messages for non-portable texture paths and missing UV-maps
    • Added the ability to configure the icon path via the block-definition node.
    • Changed tool buttons to no longer be hidden when the scene is not enabled as a block. Instead they are shown as disabled.
    • new layer to define mirroring-settings using rotated empties
      • new 3D view tool-button to quickly set up mirroring
      • only use rectangular rotations
      • verify in-game rotation settings on the property panel of the empy
      • if a rotation is not supported by Space Engineers it will cause a warning on export
      • support for <MirroringBlock>
    • support for level-of-detail render-qualities
    • Exporting now uses a scene property specifying the folder to export into. This allows to export models into other subfolders than Model/. This is more convenient to use than choosing an export folder each time.
    • The operators to do a block export or a block-definition update are now also available from the File > Export menu
    For older changes see the addon's release page on GitHub.
    Last edited: Apr 13, 2016
  3. Harag Junior Engineer

    Some interesting, related posts from this and other threads:
    Related tools
    • texconv, Microsoft's reference tool to create .dds files via the command line
    • PicoPixel, a very small texture viewer that can handle all known .dds subformats, including BC7
    Last edited: Apr 13, 2016
  4. tcmreaper Trainee Engineer

    Nice! Now its easier to find all links and stuff for your addon!
    i tried it and and its really helpful..
    your documentation is really cool it helped me a lot!
  5. Harag Junior Engineer

    This is a question to those who already use the addon. It is also an experiment. If you can tell me what the below UI is meant to replace I've made it intuitive enough to be usable :)


    So far I've only done the UI part to see if the Blender node-editor would be up to the task. There is no connection to the current exporter code. So the whole thing is probably 40% complete.
  6. Digi Senior Engineer

    Those nodes are awesome and make everything easier to comprehend, expecially that we can rename them and add LOD :p

    By the way, I found this in Sandbox.Common.MyMesh:
        private const string C_POSTFIX_DIFFUSE = "_d";
        internal const string C_POSTFIX_DIFFUSE_EMISSIVE = "_de";
        internal const string C_POSTFIX_MASK_EMISSIVE = "_me";
        private const string C_POSTFIX_DONT_HAVE_NORMAL = "_dn";
        internal const string C_POSTFIX_NORMAL_SPECULAR = "_ns";
    Might be useful, not sure if the other ones are used.
    Last edited by a moderator: Feb 15, 2015
  7. Harag Junior Engineer

    So "mask" is what the m in "_me" stands for. I always wondered :)
  8. Harag Junior Engineer


    EDIT: This is released as version 0.4.0.

    The major change is that the layer-masks that previously controlled the export are gone. If you used a custom layer-setup you'll have to re-create it as a node-setup. Instead of the layer-masks you now have a widget that references the node-setup that is used by the scene.

    Initially you don't have such a setup in your .blend file so the default reference MwmExport is invalid. You can create it by clicking on the [+] beside the node-setup selector. For additional node-setups you'll have to use the node-editor (see next screenshot).

    Also note, that the block-bounding box is now displayed when you toggle the little button on the far-right of the block-size widget.


    To get to the node-editor either create a new area for it in your current screen or switch to the Compositor screen that already contains the node-editor.

    You'll have to select the appropiate node-tree type on the header-bar below the node-editor. The "Add default export-nodes" button does the same as the button that creates the initial node-setup but for the current node tree. Use it to quickly get a set of nodes you can tweak afterwards.

    The export-buttons work differently to the ones in the scene-properties. They export using the current node-tree of the node-editor regardless of the one configured in the scene's properties.

    The nodes are lenient and skip input from another node if that node is not ready, ie. if there are no objects on the layer. The result of a skipped node might mean a construction phase is missing or the block has nod collision shapes. If a node link is known to be not ready for the current scene the node-tree will display that link with dark-grey sockets.

    The addon should also log the outcome of each executed node in Blender's info-log:

    Last edited by a moderator: Mar 7, 2015
  9. Volg Trainee Engineer

    This looks great, I am downloading now... I have a bunch of parts to make this weekend for the mod so I will give it a workout.
  10. Volg Trainee Engineer

    hmm do you recall the issue we had once before where there was no collision box? that seems to be back again. If I recall it was somehow tied to exporting animation data?
  11. Harag Junior Engineer

  12. Harag Junior Engineer

    MwmBuilder has gained some additional quirks. The workaround option in my addon now needs a bogus directory to work. Please see the bug-thread for details.
  13. Harag Junior Engineer

    I released version 0.4.2. It tells you which directory you need to create to work around mwmbuilder's output-directory bug. I'm not going to create that bogus directory automatically because it's in C:\. Hopefully Keen fixes this soon so this won't be needed anymore. :rolleyes:
    Last edited by a moderator: Feb 27, 2015
  14. Balmung Senior Engineer

    Looks very useful. But I have started only some Minutes ago to look at it and read the Docu. Didn't work on Blender and on a SE Block since a 3/4 Year. But I want to try to make a own Text Panel. ^^
  15. aerosabe Apprentice Engineer

    I just had a thought. I haven't seen a reference for mirroring options so I assume the addon doesn't do them.
    I wonder how difficult it would be to use some rotated objects as mirroring reference items. Like have 3 separate objects named MirroringX, MirroringY, MirroringZ and translate the rotation to the data file entries. Since handling any rotation a modder might apply could be complicated just have a reference that states which rotation combinations are viable and only handle those. Unless having a drop-down list and some way to preview it is feasible. That would probably be better.
    Last edited by a moderator: Feb 26, 2015
  16. Harag Junior Engineer

    Providing a tool to preview mirroring should be possible. The thing is I'm not at all sure I have understood every detail of SE's mirroring system. Without a definitive specification I might miss corner cases that would cause disparities between the game and the preview. If you do know the details, feel free to post them here.
  17. aerosabe Apprentice Engineer

    I found a mirroring guide that seems to have worked for me, though I still get some mirroring reversed. All I really remember is to do one axis at a time. I'll study it more. Let you know if I can get consistent results.

    I'm getting an error with the Havok Converter: returned non zero exit status 4294967294.
    I'll just keep using AutoDesk SoftImage Mod Tool to make the collisions for now.

    Still saves a lot of time with writing xml's and running MWMBuilder and writting the mount points for me. I used to constantly reload save file to get those right. I used to edit fbx files manually for the dummies too. The other fbx exporter didn't seem to do it in a way MWMBuilder liked. That's awesome sauce.

    Thank you :)
    Last edited by a moderator: Feb 26, 2015
  18. Harag Junior Engineer

    There should be a <BlockName>.hkt.convert.log and maybe a <BlockName>.hkt.filter.log file in your output folder. Those should contain the reason Havok failed. What version of Havok do you use (I use 2013.1)?
    Last edited: Apr 12, 2015
  19. Harag Junior Engineer

    Ah right, I remember that guide. It establishes the axes' relations and orientations. Now the missing part is only how <MirroringX> interacts with <MirroringY> and <MirroringZ>.

    EDIT: Sometimes you have to read something more than once... <MirroringX|Y|Z> don't interact at all because when a block is mirrored it is rotated according to its local axes in relation to the mirroring plane. The confusing thing is that the mirroring-planes are colored like axes but they don't contribute to a block's rotation when it is mirrored.

    Emulating this in Blender is going to need some thinking. So far I don't even have an idea how the UI for that should look like.
    Last edited: Apr 12, 2015
  20. Harag Junior Engineer

    This is probably how I'm going to do it:
    • SE "mirrors" a block independently along each axis by rotating the block
    • This can be represented with one empty per axis - so a maximum of three empties.
    • The addon recognizes them by their name which must begin with "Mirror". Because SE uses a different axis layout than Blender it would be confusing to name the empties MirrorX|Y|Z. It's better to name them MirrorLeftRight, MirrorTopBottom and MirrorFrontBack. This also emphasizes that the mirroring happens according to the block's local axes in relation to a mirroring plane and is not dependend on the orientation of the grid. The addon will still recognize empties if Blender appends its customary .001.
    • The addon will convert the rotation you set for one of those empties into the corresponding MySymmetryAxisEnum literal (X, HalfX, MinusHalfX, etc.) and write it to the .blockdef.xml.
    The above is the minimum required information the addon needs to do its job. The real benefit for you is if you make linked copies of your main object(s) with [Alt+D] and parent them to the empties with [Ctrl+P] before you rotate the empties:


    So the basic functionality the addon needs to provide is translating and exporting the rotation of the empties.
    With that in place you have some basic help for mirroring but you need to add the empties and parent objects to them by hand.
    After the basic functionality is implemented I'll try to find a way to automate the manual steps. I have no idea how complicated that will be.
    Last edited by a moderator: Mar 2, 2015
  21. Harag Junior Engineer

    While mapping the literals of MySymmetryAxisEnum to rotations in Blender I noticed that the literals are redundant and incomplete.

    These are the defined literals (redundand ones are on the same line):
    • None
    • X
    • Y
    • Z
    • HalfX, XMinusHalfX
    • HalfY
    • HalfZ, ZMinusHalfZ
    • MinusHalfX
    • MinusHalfY
    • MinusHalfZ
    • XHalfY
    • XHalfZ, YMinusHalfZ
    • YHalfX, ZMinusHalfX
    • YHalfZ, XMinusHalfZ
    • ZHalfX, YMinusHalfX
    • ZHalfY
    Those are only 16 of the 24 possible combinations to rotate a block. The following are missing (names are made up):
    • HalfXHalfY
    • MinusHalfXHalfY
    • HalfXMinusHalfY
    • MinusHalfXMinusHalfY
    • HalfXHalfZ
    • MinusHalfXHalfZ
    • HalfXMinusHalfZ
    • MinusHalfXMinusHalfZ
    I will have to recognize the corresponding rotations and report them as errors.
    Last edited: Apr 12, 2015
  22. Harag Junior Engineer

    I've released version 0.5.0.

    As discussed above you now can use empties to define the mirroring of a block:
    • The names of the empties must begin with MirrorLeftRight, MirrorTopBottom or MirrorFrontBack
    • You can create linked copies of your main model and parent them to those empties to get a visual cue which way the empties need to be rotated.
    • Only use rotations that are multiples of 90° - maybe enable snapping when rotating in the 3D view.
    • Not all possible rotations are supported by Space Engineers. You can verify if a rotation is valid on the property panel of the empty.
    • Invalid rotations result in a warning during export and will be skipped.
    The Block Definition node has gained a new input socket to define the layer that contains the mirroring-settings. For .blend files that already have export-settings you need to add a corresponding layer node and connect it to the socket - the addon cannot do this on its own. You can also create a new export node-tree and use the "Add default export-nodes" button.
    Last edited: Apr 12, 2015
  23. Harag Junior Engineer

    I've added an example project to the front post (basically the sources of this mod).
  24. NpTxAnima Trainee Engineer

    Hey Harag, probably i've made some mistakes with the installation: when i try to activate the Add-on, this come up http://imgur.com/v4vFEzn

    What i've done wrong?
  25. Harag Junior Engineer

    Hm, maybe check if the "EXPERIMENTAL FBX" addon is enabled. Normally that shouldn't be necessary but maybe it helps.

    This problem is specific to Blender 2.72. Version 2.73 has been out for a few months now. In that version the experimental fbx features have been merged back into the base fbx exporter which is enabled by default.
  26. aerosabe Apprentice Engineer

    Ah. I have 2012 installed. I think I did that to use with SI Mod Tool.

    I should have have checked this topic before spending the time on this :). I checked blender rotations with SE-mirroring options and got these results, hopefully the same numbers you got.
    SE-Mirroring -> Blender Rotation
    X -> X:180
    Y -> Z:180
    Z -> Y:180
    HalfX -> X:+90
    HalfY -> Z:-90
    HalfZ -> Y:-90
    MinusHalfX -> X:-90
    MinusHalfY -> Z:+90
    MinusHalfZ -> Y:+90
    XHalfY -> X:180 Z:-90 &lt;==> Y:180 Z:+90 &lt;- ZMinusHalfY (Not Used)
    ZHalfY -> Y:180 Z:-90 &lt;==> X:180 Z:+90 &lt;- XMinusHalfY (Not Used)
    XHalfZ -> X:180 Y:+90 &lt;==> Y:+90 Z:180 &lt;- YMinusHalfZ
    YHalfX -> X:+90 Z:180 &lt;==> X:-90 Y:180 &lt;- ZMinusHalfX
    YHalfZ -> Y:-90 Z:180 &lt;==> X:180 Y:-90 &lt;- XMinusHalfZ
    ZHalfX -> X:+90 Y:180 &lt;==> X:-90 Z:180 &lt;- YMinusHalfX

    EDIT: I posted list before I checked the rotations that your drop down list gives. Weird that your Y option is X:180 Y:180. Mostly the same, but same orientation either way.
    Last edited by a moderator: Mar 5, 2015
  27. aerosabe Apprentice Engineer

    Would a new create button under Mount-Points work for the mirroring empties? that might be cool. Anyway. I love the new feature.
  28. NpTxAnima Trainee Engineer


    Thanks again! I've installed the 2.73 release and now everything works fine!
  29. Harag Junior Engineer

    Funny, I had the rotations sorted into equivalence-groups and copied the wrong line to the Python source. Because the rotation is equivalent there's no need to immediately fix it. I'm changing it for the next addon version.
    Last edited: Apr 12, 2015
  30. Harag Junior Engineer

    I've updated the documentation. It now contains a section for mirroring. Also, links to additional images now are marked with a little magnifying glass right next to them and open in an overlay window if you have JavaScript enabled. I'd like to know if the latter works for you.
    Last edited by a moderator: Mar 6, 2015
Thread Status:
This last post in this thread was made more than 31 days old.