4
$\begingroup$

I'm trying to export my project as an FBX.

However, when I export and then import the file, the "Blend Mode" option for the material is set to 'Alpha Blend'.

I want this material in the exported FBX to be set to 'Opaque' mode, but it won't remain as such.

Any comment would be helpful!

enter image description here

$\endgroup$
3
  • $\begingroup$ A question: Why do you want it to be Opaque when you have an alpha image? Isn't that redundant? $\endgroup$
    – DarkSoul
    Commented Jan 1, 2022 at 0:51
  • 1
    $\begingroup$ Hello :). I'm afraid the Opaque mode is an internal Blender thing and not supported in the FBX format. $\endgroup$ Commented Jan 1, 2022 at 18:45
  • $\begingroup$ @JachymMichal is right, it's like exporting an image to JPEG format and then importing it back and expecting to read alpha channel from it, the FBX material doesn't have that blend mode option, it's a setting for EEVEE which is also used for the material preview in Cycles. $\endgroup$ Commented Jan 3, 2022 at 13:21

3 Answers 3

6
+50
$\begingroup$

@DarkSoul is on the right track. As other have said, the blend method is not written to the FBX file at export, so at import time the importer makes up a value. You can make it make up "Opaque" by doing this before you export

  • disconnect the alpha socket and set it to 1
  • make sure the base color texture (diffuse texture), if you have one, has NO alpha channel. Note that this is not the same thing as having a fully opaque alpha channel. If you open the image in the Image Editor, in the sidebar under the "Image" tab, it should say something like "RGB byte", not "RGBA byte".

If you ensure these before you export, it should re-import as "Opaque".

$\endgroup$
1
  • 1
    $\begingroup$ I tested it out quickly. When exporting a material to fbx and re-importing it with an image texture attached, it imports with "Alpha Blend". When doing the same without image texture, it imports as Opaque. $\endgroup$
    – DarkSoul
    Commented Jan 3, 2022 at 14:45
1
$\begingroup$

As you know, FBX is a proprietary format, and the Blender importer/exporter is limited in what it can export to an FBX file.

You can read the Python source code of the FBX exporter on github. In particular, the function that exports materials is at line 1284: fbx_data_material_elements.

Many of Blender's material properties are ignore, or reduced to a few values. As Jachym Michal said in a comment the Opaque mode property is one of those that are ignored.

You have one slim hope of being able to do what you want, hinted at by line 1357 - 1358: You can add a custom property that encodes the Opaque mode, driven by a driver.

But for this to work you would have to write a wrapper for the importer that rebuilt the custom property and added the driver; and, of course, only your modified importer would understand it.

I'm afraid you're out of luck.

$\endgroup$
0
$\begingroup$

As Jachym commented, the blend mode is a setting internal to Blender. I tested exporting an fbx and reading it as text to be sure, and it doesn't look to be saved in the file. So the blend mode won't be exported, even as a custom property. When Blender imports a FBX file, it just fills internal settings with a default value. "Alpha Blend" is probably just a safe default for new materials, even if it's not the ideal one.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .