diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2018-05-18 15:59:38 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2018-05-18 15:59:38 +0300 |
commit | 6e48afeb238b5935273891048be80b9a3a78027f (patch) | |
tree | b6ed82ea960775d2dec6cf49799d020d06fa327b /source/blender/makesrna | |
parent | b167bc2f008522427deab016ca0fd55b01920abf (diff) | |
parent | 5e7a21a5f549f5db73385820cafcd8f2bb9c91da (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_smoke.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index af4ecb6dd7d..832d5b28bd1 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -288,20 +288,27 @@ static void rna_SmokeModifier_color_grid_get(PointerRNA *ptr, float *values) { #ifdef WITH_SMOKE SmokeDomainSettings *sds = (SmokeDomainSettings *)ptr->data; + int length[RNA_MAX_ARRAY_DIMENSION]; + int size = rna_SmokeModifier_grid_get_length(ptr, length); BLI_rw_mutex_lock(sds->fluid_mutex, THREAD_LOCK_READ); - if (sds->flags & MOD_SMOKE_HIGHRES) { - if (smoke_turbulence_has_colors(sds->wt)) - smoke_turbulence_get_rgba(sds->wt, values, 0); - else - smoke_turbulence_get_rgba_from_density(sds->wt, sds->active_color, values, 0); + if (!sds->fluid) { + memset(values, 0, size * sizeof(float)); } else { - if (smoke_has_colors(sds->fluid)) - smoke_get_rgba(sds->fluid, values, 0); - else - smoke_get_rgba_from_density(sds->fluid, sds->active_color, values, 0); + if (sds->flags & MOD_SMOKE_HIGHRES) { + if (smoke_turbulence_has_colors(sds->wt)) + smoke_turbulence_get_rgba(sds->wt, values, 0); + else + smoke_turbulence_get_rgba_from_density(sds->wt, sds->active_color, values, 0); + } + else { + if (smoke_has_colors(sds->fluid)) + smoke_get_rgba(sds->fluid, values, 0); + else + smoke_get_rgba_from_density(sds->fluid, sds->active_color, values, 0); + } } BLI_rw_mutex_unlock(sds->fluid_mutex); |