Merge branch 'master' into blender2.8
authorPhilipp Oeser <info@graphics-engineer.com>
Fri, 18 May 2018 12:59:38 +0000 (14:59 +0200)
committerPhilipp Oeser <info@graphics-engineer.com>
Fri, 18 May 2018 12:59:38 +0000 (14:59 +0200)
source/blender/editors/curve/editcurve_paint.c
source/blender/makesrna/intern/rna_smoke.c

index 05425fbcd6a8960f97d1b2eb39205dc95d01d922..bbe88bd14465463a5b776534e3b99249af3a5237 100644 (file)
@@ -1007,9 +1007,16 @@ static int curve_draw_exec(bContext *C, wmOperator *op)
                const struct StrokeElem *selem;
 
                nu->pntsu = stroke_len;
+               nu->pntsv = 1;
                nu->type = CU_POLY;
                nu->bp = MEM_callocN(nu->pntsu * sizeof(BPoint), __func__);
 
+               /* Misc settings. */
+               nu->resolu = cu->resolu;
+               nu->resolv = 1;
+               nu->orderu = 4;
+               nu->orderv = 1;
+               
                BPoint *bp = nu->bp;
 
                BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
index af4ecb6dd7da3507f3a05c2d0a9135e65aada189..832d5b28bd138ef6a3d7e651c834c1d02a6b5c36 100644 (file)
@@ -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);