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.

  1. Harag Junior Engineer

    Messages:
    913
    The info-message right below the three buttons tells you what to do: Go to the scene properties and check the check box that's next to "Space Engineers Block":

    [​IMG]
    --- Automerge ---
    @Tilleen just re-configure the export to have all sides in different layers of the same scene. Updating CubeBlocks.sbc from Blender won't work with these settings but that's easily done by hand when using one of the default armor blocks as a template.

    [​IMG]
     
  2. Finnlad the Great Trainee Engineer

    Messages:
    2
    Thank you, it seemed like it was a simple thing that I was just missing. I really am grateful for all the awesome tools you've made.
     
  3. Tilleen Trainee Engineer

    Messages:
    28
    Do you know if the order of the sides in "CubeBlocks.sbc" is important? I am guessing that it is, I just don't know what the order is. I am also expecting that the orientation of the blocks is important for slanted and other non regular shapes (ie the slanted side is always the front).

    I am assuming that if I make the layers that your example shows be 15 through 20 and copy the appropriate sides to the correct place it this should work, and enable updating to the "cubeblocks.sbc" from the original layer set.
     
    Last edited: Aug 30, 2016
  4. Harag Junior Engineer

    Messages:
    913
    The order of the sides is important. The definitions for the standard armor blocks in CubeBlocks.sbc are your reference, here. The orientation and position of the models is also important. For reference you can import the sides of the armor blocks from the ModSDK.

    The addon has no code to produce the <Sides> elements for you, so exporting CubeBlocks data from Blender isn't as useful as for normal blocks. It's simpler to copy the definition of one of the game's armor blocks and change that accordingly.

    Also, there's a bug thread for MwmBuilder. That's the best place to check if it started working again.
     
    Last edited: Sep 1, 2016
  5. doncdxx Apprentice Engineer

    Messages:
    411
    @Harag I was requesting a component option because I am using your tools for them as a small block for size comparison and ease of use. If it's one of those requests that I am too noobish to understand why it's pointless, I would accept that since I am learning everything as I go. Thanks for sharing your tool and the support you give for it here.
     
  6. Harag Junior Engineer

    Messages:
    913
    I guess by "component" you are referring to this?
    Code:
    <Component>
       <Id>
           <TypeId>Component</TypeId>
           <SubtypeId>MetalGrid</SubtypeId>
       </Id>
       ...
       <Model>Models\Components\metal_grid_component.mwm</Model>
       ...
    </Component>
    
    Blender only contributes a single .mwm file to this definition so I don't see a need to provide an Update component definition operator for that, any text-editor can do that.

    The addon already can produce arbitrary sets of .mwm files but you need to re-configure the export to suit your needs. Take a look at the second image in post #421 for an example on how to do that. The documentation has more details.
     
    • Like Like x 1
  7. doncdxx Apprentice Engineer

    Messages:
    411
    Yes that's what I meant, and thanks for that. You just made me realize how I could streamline my work.

    I've been working on this crazy mod series since February that adds 10 new sci-fi ores and 10 new alloys from certain mixtures of those ores, 50ish new blocks and components. About 36 of those components are just slightly different skins for the same 3 meshes. If I understand this right, I could use the multiple layers for the different skins and just copy/paste the mesh between layers and edit the name of the output in the node editor to do 10 or so versions at one time.

    Now I just need to figure out why everything I export comes out greyscale. The metal, glossiness and emissive parts seem to work correctly, but the color keeps coming out greyscale.



    While I'm mentioning my mod series, the code part is done except for the final statistical rebalance. Everything left is artistic and bug fixing so if anyone wants to contribute functional or decorative block models to be made of the mod series' new ores or alloys, I'd gladly consider adding them.
     
  8. Tilleen Trainee Engineer

    Messages:
    28
    Personally I would have the ores and alloys in a separate mod. Then people can use them and not the blocks if they want.

    What sort of blocks are you looking for?
     
  9. Harag Junior Engineer

    Messages:
    913
    Get your own thread :p :D
     
  10. Tilleen Trainee Engineer

    Messages:
    28
    Sorry! :p
     
  11. Tilleen Trainee Engineer

    Messages:
    28
    Thanks for this, it does work. However the since I am having, or possibly having, (at the moment so I can workout what the order is for the <side ..> tag, most of them need to be rotated or otherwise transformed so that the visible surface of the block is facing in the +Z direction. Is it possible to have a rotation on export?

    Of course as far as I can tell it would need to be different for each of the different cube types (Box, Slope, ...)

    I am also wondering if it is possible to use different groups, rather than layers?
     
  12. Harag Junior Engineer

    Messages:
    913
    Using groups is easy, just use a group name filter instead of a layer mask filter. But I think layers are easier to work with because they can be controlled with keys (plain)|[Shift]|[Alt] + [1]..[0] and objects can easily be moved with between them via [M].

    Setting up an export-only transformation is tricky. It might work to duplicate your object and then to rotate and position the duplicate on one of the exported layers:

    [​IMG]

    I'm not using a linked duplicate for this because group instances will duplicate objects with their modifiers applied which a linked duplicate won't even allow you to do manually. The minor downside is that the exported .mwm will probably contain the (now superflous) dupli-group empty. I haven't actually tried this, though.
     
    Last edited: Sep 2, 2016
  13. Tilleen Trainee Engineer

    Messages:
    28
    Essentially, I think I have to use layers, because just a group would not allow the transformations (Could be wrong, new to all of this). I have created a version of what you suggest in the above post, and it seems to work from a display (in blender) point of view, but the object I have grouped into the export layer does not get exported via you script.

    The xml for it is alot shorter than the others:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Model Name="TestCubeSides_Slope">
    	<Parameter Name="RescaleFactor">1.0</Parameter>
    	<Parameter Name="RescaleToLengthInMeters">false</Parameter>
    	<Parameter Name="Centered">false</Parameter>
    	<Parameter Name="SpecularPower">0.0</Parameter>
    	<Parameter Name="SpecularShininess">0.0</Parameter>
    </Model>
    
    I think your script is looking for an object not a group, and the object is not really there?
     
  14. Harag Junior Engineer

    Messages:
    913
    Hm, you are right. The exported .fbx contains the meshes but the addon doesn't find and consequently doesn't export any materials because it would need to recursively check the group instance members for those but currently it doesn't. You'd have to Make Duplicates Real before export for this to work properly :(

    If all you want is to rotate your meshes around the scene origin I think you can also get away with just swizzling the export coordinate system per exported .mwm. It's a lot less intuitive to get the axis right, tough:

    [​IMG]
     
  15. Tilleen Trainee Engineer

    Messages:
    28
    Thanks for that.

    That does seem to work, and it is a pain to calculate them, but as long as I keep the same orientation for all future models it should work.

    So far I have worked out the standard box, and slope, but even then the transformation for the bottom (down) panel actually gives a different result for each of them.

    Of course the problem now is that the model I have already published has its orientation so that it does not line match the slope. Mine slopes towards the right not the back. So if I redid it anyone using it would be stuffed.
    --- Automerge ---
    Is there anything special about the mwm files for the sides? If I use the built in mwm files (SquarePlate.mwm) it works fine, if I replace them with one or more of my files (which work perfectly well when they are used to create a normal trianglemesh block topology).
     
  16. Harag Junior Engineer

    Messages:
    913
    It should work as long as you set <BlockTopology>Cube</BlockTopology>
     
  17. Tilleen Trainee Engineer

    Messages:
    28
    Is there anything special about the mwm files for the sides? If I use the built in mwm files (SquarePlate.mwm) it works fine, if I replace them with one or more of my files (which work perfectly well when they are used to create a normal triange
    I am assuming that it does something slightly different when placing the model that is causing a crash. The logs do not say anything except null pointer reference, or something similar, but all I have to do to place it is to replace the <side> entries with a link to the builtin ones and it works.

    I have not actually found anyone trying to do what I am doing, to see differences but I could have missed it since there are 100k+ mods out there.
     
  18. Drachenbauer Trainee Engineer

    Messages:
    3
    must the mount-faces be exactly on the faces of the block-bounds-box?

    how to rename the scene it self?
     
    Last edited: Sep 25, 2016
  19. Tilleen Trainee Engineer

    Messages:
    28
    Finally worked out how the mirror stuff works for using different blocks as the mirror blocks. It may be worth having a short section in your documentation about the mirroring using different blocks or scenes.

    Pity is did not work correctly (in SE) not your tool. When drawing the mirrored block it offsets the block by 1/2 a block along the long axis (for an axis with an odd number of blocks), and then when placing the mirrored block places it somewhere entirely different.

    To be fair the blocks that I am mirroring to are not oriented the same was as the initial. eg one of the blocks is 2x5x1 and the mirror is 5x2x1 (XxZxY).
     
  20. Tilleen Trainee Engineer

    Messages:
    28
    Just wondering about the Block Definition node. For some reason the one that is created when the tool is installed only goes up 3 construction phases, yet if I add a new one it will continue on after 3?

    Is this on purpose?
     
  21. Drachenbauer Trainee Engineer

    Messages:
    3
    In a tutorial is written, thad the a-channel is used th define, if the block can be colored by the ingame-palette.
    But what channel in the graphic is channel a?

    how do i make the three building-phases stay silver-grey to look like steel without any covering, but the finished state colorable with the ingame-palette?
     
    Last edited: Oct 10, 2016
  22. Harag Junior Engineer

    Messages:
    913
    Yes, there's supposed to always be one more socket than there are connections so you are able to add more construction phases. The number of sockets is also decreased if you remove connections from the end of the list. If you remove them in the middle, those sockets remain but are skipped. The LOD sockets of a Mwm node behave the same way.
    .dds textures usually have four channels: red, green, blue and alpha or RGBA for short. So A is the alpha channel. Think of the _add texture as three separate greyscale images that are placed into the channels of the same texture (R: AO intensity, G: emissive intensity, B: unused = black, A: recoloring mask)
    Either use separate materials with separate textures or use a single "material" for all the meshes and uv-map the faces of your construction meshes to separate parts of the material's textures. The first option has the advantage that it allows you to reuse Keen's textures for their construction models to get a consistent look and then use your own textures for the mesh of the fully constructed block. Also remember that it's perfectly fine to have more than one material per mesh where each material uses different textures.
     
  23. Drachenbauer Trainee Engineer

    Messages:
    3
    where i find keenĀ“s textures
     
  24. Harag Junior Engineer

    Messages:
    913
    Well, with the game, of course, i.e. <Steam>\steamapps\common\SpaceEngineers\Content\Textures\Models\Cubes\... You can reference them from right there within Blender and the addon will figure out the correct relative path on export.

    The only wrinkle is that they are saved as DDS/BC7. That subformat will look completely grey when loaded in Blender because Blender only supports reading up to BC3 (sometimes also called DXT5). What I usually do is I convert the textures and put them in the same relative subpath within my mod (<Mod>\Textures\Models\Cubes\...) while I work on the models. Then, when I'm ready to publish I remove them again so the game will load the original textures instead. This works because SE resolves a texture path against two base directories, first <Mod>\ then <SE>\Content\ if fails to find anything at the first location.
     
  25. Tilleen Trainee Engineer

    Messages:
    28
    Does not seem to happen for the initial "Block Definition" node, only new nodes that are created manually.
     
  26. Harag Junior Engineer

    Messages:
    913
    Ah. That's because it has its unconnected nodes hidden (Ctrl+H / Nodes > Toggle Hidden Node Sockets)
     
  27. Vicizlat Apprentice Engineer

    Messages:
    174
    Hello Harag,
    I have a question about Blender and your plugin. Before the new requirements for the texture files I had no problems viewing them and rendering them in Blender. Now when I set up every texture file in it's appropriate place (cm, ng and add) all I get is a generic grey in the viewport or black in the renderer. I do know for sure the textures are working because SE is loading them correctly. Also if I load a .png file instead of the .dds required for SE I can see all the textures.
    So my question is, is there some setting I can change to make the textures work in Blender or should I use .png's until I am ready for export?
    Thank you for your time AND for creating this amazing plugin!
     
  28. Harag Junior Engineer

    Messages:
    913
    • Like Like x 1
  29. Vicizlat Apprentice Engineer

    Messages:
    174
    That is what I thought as well, but I had to ask. I could have been wrong. ;)
    Thanks!
     
  30. Vicizlat Apprentice Engineer

    Messages:
    174
    Hello again, Harag,
    I was just about to write here asking for help rendering the model I was working on when I found the solution. Now I want to ask you if this is supposed to be the normal operation of the plugin or is it a bug, because it didn't do that before.
    Here is what happened:
    After we discussed how Blender can't read BC7 I used .png files for referencing what texture goes where and if it fits correctly. When I was done and happy with the end result I wanted to render an image for the icon. But it was all black, no matter how many suns I added or how much I increased their strength. I started looking for other solutions but couldn't find any. Then I found your example .blend file for the missile turret and decided to download it and check my file against yours. Almost everything was the same until I got to the Surface property in the Textures tab. There, right under the "Surface: Mix Shader" there is a property called "Fac:". Mine was set to 0 and it defaults to 0 as well and yours was set to 1. I changed all my textures to 1 as well (and decided to ignore the fact that my whole model turned pink in the Materials option in the Viewport :) ) and tried again. It came out black again. I don't know why I decided to add the _cm file to the diffuse slot for the DirecX9 part of the textures, but all of a sudden it worked! I then tried changing the Surface to DX11 Shader only but that produced an all white render.

    If you've read trough all the above, my question is - is that the intended behavior (meaning it requires a DX9 texture to be set)? And it is only required if you want to render the model. It exports without problems and shows up in-game without problems if it doesn't have DX9 textures.

    Again, Thank you for your time!