diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-05-20 23:56:09 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-05-20 23:56:09 +0300 |
commit | 8a0840b0ee9a60a62bf6d1f800d08bf852427fd5 (patch) | |
tree | 80344f42e0483345eef48796380dc7e5f229463b /intern/cycles | |
parent | 71fa4601452756f3b4a26b51ec44f13edbf2e9a8 (diff) | |
parent | af3a55bb1b7d11c3036839d66fcf4280f1dae96b (diff) |
Merge branch 'blender-v2.83-release'
# Conflicts:
# source/blender/draw/engines/eevee/eevee_volumes.c
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_volume.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/intern/cycles/blender/blender_volume.cpp b/intern/cycles/blender/blender_volume.cpp index 6254a1a1b24..4eed6be8c7c 100644 --- a/intern/cycles/blender/blender_volume.cpp +++ b/intern/cycles/blender/blender_volume.cpp @@ -34,15 +34,13 @@ CCL_NAMESPACE_BEGIN /* TODO: verify this is not loading unnecessary attributes. */ class BlenderSmokeLoader : public ImageLoader { public: - BlenderSmokeLoader(const BL::Object &b_ob, AttributeStandard attribute) - : b_ob(b_ob), attribute(attribute) + BlenderSmokeLoader(BL::Object &b_ob, AttributeStandard attribute) + : b_domain(object_fluid_gas_domain_find(b_ob)), b_mesh(b_ob.data()), attribute(attribute) { } bool load_metadata(ImageMetaData &metadata) override { - BL::FluidDomainSettings b_domain = object_fluid_gas_domain_find(b_ob); - if (!b_domain) { return false; } @@ -79,7 +77,6 @@ class BlenderSmokeLoader : public ImageLoader { /* Create a matrix to transform from object space to mesh texture space. * This does not work with deformations but that can probably only be done * well with a volume grid mapping of coordinates. */ - BL::Mesh b_mesh(b_ob.data()); float3 loc, size; mesh_texture_space(b_mesh, loc, size); metadata.transform_3d = transform_translate(-loc) * transform_scale(size); @@ -90,9 +87,6 @@ class BlenderSmokeLoader : public ImageLoader { bool load_pixels(const ImageMetaData &, void *pixels, const size_t, const bool) override { - /* smoke volume data */ - BL::FluidDomainSettings b_domain = object_fluid_gas_domain_find(b_ob); - if (!b_domain) { return false; } @@ -179,10 +173,11 @@ class BlenderSmokeLoader : public ImageLoader { bool equals(const ImageLoader &other) const override { const BlenderSmokeLoader &other_loader = (const BlenderSmokeLoader &)other; - return b_ob == other_loader.b_ob && attribute == other_loader.attribute; + return b_domain == other_loader.b_domain && attribute == other_loader.attribute; } - BL::Object b_ob; + BL::FluidDomainSettings b_domain; + BL::Mesh b_mesh; AttributeStandard attribute; }; |