You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_importer = _manager.loadAndInstantiate("BlenderImporter");
_importer->openFile("lights.blend")
Containers::Optional<Trade::LightData> l = _importer->light(0);
Blender 3.0.0 allows for 4 types of light by default: Point, Sun, Spot, and Area. Here are the results when I run the importer on each of these lights:
Loading point.blend ...
Found a light of type Trade::LightData::Type::Point !
Loading spot.blend ...
Found a light of type Trade::LightData::Type::Spot !
Loading area.blend ...
Trade::AssimpImporter::light(): light type 5 is not supported
No light Found !
Loading sun.blend ...
Trade::LightData: attenuation has to be (1, 0, 0) for an ambient or directional light but got Vector(0, 0, 0)
Aborted (core dumped)
Area lights are not supported, and gracefully pass with a warning and a NullOpt. Directional (ie. sun) lights however, note a different attenuation notation and crash before light() exits - meaning the user has no opportunity to fix the attenuation to the expected value.
We have this tested for COLLADA, where gives us the correct value, and the expectation was that it would have a consistent behavior across various file formats. Such value also makes sense -- the attenuation isn't "undefined" but rather constant, which is what {1, 0, 0} is.
But, in a typical Assimp fashion, it doesn't, and it just does whatever it feels like doing, differently for each file type. Thanks for the repro code, I'll look into this and add a workaround.
Blender 3.0.0 allows for 4 types of light by default: Point, Sun, Spot, and Area. Here are the results when I run the importer on each of these lights:
Area lights are not supported, and gracefully pass with a warning and a
NullOpt
. Directional (ie. sun) lights however, note a different attenuation notation and crash beforelight()
exits - meaning the user has no opportunity to fix the attenuation to the expected value.Test code and blender files are attached.
magnum-blender-directional-light.zip
The text was updated successfully, but these errors were encountered: