diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-02-29 00:56:18 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-04 19:11:56 +0300 |
commit | 28e4f8eb5c61d51a5cb9b486821e1e99bd091a4b (patch) | |
tree | b130bfd76ca72484a744616b8d7c200022d8fd58 | |
parent | 550215a65e6e50d523250471546479d63cf3bb73 (diff) |
Fix T47615: crash trying to use point density with lamp object.
-rw-r--r-- | source/blender/render/intern/source/pointdensity.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 22532651489..52c9edbef6e 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -764,12 +764,18 @@ void RE_point_density_minmax( else { float radius[3] = {pd->radius, pd->radius, pd->radius}; float *loc, *size; - BKE_object_obdata_texspace_get(pd->object, NULL, &loc, &size, NULL); - sub_v3_v3v3(r_min, loc, size); - add_v3_v3v3(r_max, loc, size); - /* Adjust texture space to include density points on the boundaries. */ - sub_v3_v3(r_min, radius); - add_v3_v3(r_max, radius); + + if (BKE_object_obdata_texspace_get(pd->object, NULL, &loc, &size, NULL)) { + sub_v3_v3v3(r_min, loc, size); + add_v3_v3v3(r_max, loc, size); + /* Adjust texture space to include density points on the boundaries. */ + sub_v3_v3(r_min, radius); + add_v3_v3(r_max, radius); + } + else { + zero_v3(r_min); + zero_v3(r_max); + } } } |