- User Since
- May 10 2019, 8:43 PM (18 w, 4 d)
Jun 6 2019
May 28 2019
oh I didn't even realize that! you're right we can't have alpha 0... and this must have been the case for a while. I took some time to investigate and so far, at least with the more recent versions of Max and Maya, it looks like Opacity behaves correctly. Not sure yet if that works with older files, I'll try to test more files and confirm that when I get the time... But basically, your solution seems to work ok, the only issue I found is that Opacity animation curves are not exported, so for animations we still have to rely on TransparencyFactor and TransparentColor.
Maybe we need a FBX SDK user emotional support group...
May 27 2019
Hi @Bastien Montagne (mont29), I'm sorry, it seems like I left out the last part of the algorithm last time. There's actually another check for alpha==0 after alpha = 1.0 - TransparentColor.r.
It should look like this :
May 24 2019
That file looks fine in Unity, the values I see on import are TransparentFactor=0 and TransparentColor=(1,1,1) for the 'leather_black' material. However, we're using the FBX SDK and we don't deal with the template properties, we get the values from the API, so the SDK must do some magic under the hood.
I opened the file in FBX Converter and it looks like TransparencyFactor is not defined in the Material, but is defined in the template. So I'm assuming that property values returned by the SDK are the material value if present or the template value.
The 'opacity' property is not used in the Unity importer. Maybe try something like this ? :
May 14 2019
Nice to see that bug fixed! If there's other Unity import related issues in the future, don't hesitate to poke me, I can't guarantee a quick response every time but I'll sure try to help as much as I can.
May 10 2019
Hi, I'm a developer on the DCC team at Unity and I think I know what's going on here..
Maya and 3DsMax export the material transparency values in different ways, Max uses 'TransparencyFactor' but Maya uses 'TransparencyColor', there's also an 'Opacity' property (sometimes) which seems unreliable, it's all quite confusing and the FBX documentation doesn't help much..
Anyway, here's the logic Unity's FBX importer follows to determine the material alpha: