question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Phil BoBo edited

Blender 2.81 shape not imported

Before I used Blender 2.79b and I could import .blend files directly into FlexSim (even if the axes were off by 90 degrees which I had to fix in the Shape Factors).

Recently I've switched to the new version: I created WRCS.blend in Blender 2.81 (by importing an .stl file). When I try to use this shape in FlexSim it doesn't import well. To be precise the dimensions of the object are set to 0, but even when I give the object a non-zero size the shape is not visible.

I assume that this is an issue with the Blender import.

FlexSim 20.2.2
flexsim 20.2.23d shapeblender
wrcs.blend (2.6 MiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo edited

It looks like Blender changed their native blend format in Blender 2.8.

If you try to open that file in Blender 2.79b, you get this error:

We have not updated our importer to support the newer format. Export to a different format if using Blender 2.8, such as fbx or obj.

Blender 2.8 Notes

Blender 2.8 also significantly overhauled their material and rendering systems.

They revamped their material system to be more flexible, and they’ve purposefully changed them so that they don’t actually export into the file. They expect you to overwrite the materials in the target application anyways (like you can do in FlexSim with the shape overrides.) They deride the 3D file format material systems as “a basic shading model, similar to the legacy fixed pipeline of old GPUs,” and they’ve nearly given up on supporting it.

https://docs.blender.org/manual/en/dev/addons/import_export/node_shaders_info.html

https://developer.blender.org/T68399

https://blender.stackexchange.com/questions/57531/fbx-export-why-there-are-no-materials-or-textures

Blender does support exporting textures, but you have to use a single node with the “Principled BSDF” shader:

That exports a texture or a color, but not both. If you export a texture, then our importer is using a default color of gray. (That’s why it is darker than it should be in the image above.)

Almost every 3D shape format follows the Blinn-Phong reflection model for materials. https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_reflection_model. FlexSim’s default shaders also follow this model, and import the materials directly from the files as they are defined.

This includes

  • Diffuse Color
  • Diffuse Texture (texture UV coordinates are usually stored independently from the material system)
  • Specular Color
  • Specular Map Texture
  • Shininess Value
  • Shininess Strength Value
  • Gloss Map Texture
  • Ambient Color
  • Emissive Color
  • Normal Map Texture (per-face or per-vertex normals are usually stored independently from the material system)
  • Transparency (sometimes part of the diffuse color and texture; sometimes on its own)

There is not any export format in Blender that gets you even most of those into the file correctly anymore. The closest you get is the Principled BSDF, which includes

  • Diffuse Color or Texture (but not both)
  • Specular intensity (that’s probably a white, black, or gray specular color)
  • Specular tint (that’s probably the shininess value)
  • Roughness (that probably affects the shininess strength value)
  • Alpha (transparency)

That pitiful. Not being able to specify a diffuse color and texture makes Blender almost worthless as a modeling software for exporting to 3D shape formats and including material information.

Blender 2.79b Notes

Blender 2.79b's material system and exports were much better.

The “Blender Renderer” shader’s material and texture settings actually match more closely what gets exported into the file.

You can assign textures to materials:

You can change the Blend mode at the bottom to “Multiply” instead of “Mix” in order to get it to appear the way FlexSim’s default shaders will make it appear:

On the Material tab, you have a bunch more settings that actually match up with the 3D shape’s data and get exported:


1599597000713.png (6.8 KiB)
1599597233525.jpeg (40.4 KiB)
1599597351289.jpeg (107.0 KiB)
1599597423481.jpeg (107.0 KiB)
1599597437131.png (184.2 KiB)
1599597450240.png (187.1 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Mischa Spelt avatar image Mischa Spelt commented ·

Thanks Phil. Based on your remark that this new approach by Blender

make[s] Blender almost worthless as a modeling software for exporting to 3D shape formats and including material information.

do you think you will update the importer at some point or is that low on the priority list?

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Mischa Spelt commented ·

We use the Open Asset Import library (Assimp) to import blend files. If Assimp is updated to support the newer blend format (it isn't as of right now) and then we update Assimp, then we'll support it. But we're not going to go out of our way to add support for it.

My recommendation for modeling 3D shapes for FlexSim is to use AC3D, Blender 2.79b, or 3ds Max.

AC3D has a material system that exactly matches up with what is exported in the file:

3ds Max has a flexible material system with way more features than it exports, but if you just use the basic materials, you can at least get the materials into the files correctly. (Or at least you could the last time I used it, which was a couple years ago. I doubt Autodesk has broken their existing features like the open source Blender project did.)

0 Likes 0 ·
1599659469604.jpeg (52.6 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.