Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-05-20 17:53:28 +0300
committerJacques Lucke <jacques@blender.org>2020-05-20 17:53:28 +0300
commitccf43fe6050c4cf986bd227ffbf25b7b02c077be (patch)
tree9dd4b37937924f45afa865b9128094b597124669 /intern
parentb44101950d12d6d1f75507df03a902bf8387e074 (diff)
Cycles: Fix rendering instanced smoke domain.
The problem was that Cycles would store a pointer to an object in `DEGObjectIterData->templ_dupli_object`. This pointer was then accessed when the iterator was already freed. Reviewers: brecht Differential Revision: https://developer.blender.org/D7797
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_volume.cpp15
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;
};