[Bf-blender-cvs] [10bc043c991] fluid-mantaflow: Mantaflow: Fix for guiding res pointer
Sebastián Barschkis
noreply at git.blender.org
Thu Dec 12 02:47:05 CET 2019
Commit: 10bc043c991b0d33d2e2826ccf98c9c0f477c917
Author: Sebastián Barschkis
Date: Thu Dec 12 02:46:47 2019 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB10bc043c991b0d33d2e2826ccf98c9c0f477c917
Mantaflow: Fix for guiding res pointer
===================================================================
M source/blender/blenkernel/intern/manta.c
M source/blender/makesdna/DNA_manta_types.h
M source/blender/makesrna/intern/rna_manta.c
===================================================================
diff --git a/source/blender/blenkernel/intern/manta.c b/source/blender/blenkernel/intern/manta.c
index 93ccec01e83..a444856b6c4 100644
--- a/source/blender/blenkernel/intern/manta.c
+++ b/source/blender/blenkernel/intern/manta.c
@@ -808,7 +808,6 @@ void mantaModifier_createType(struct MantaModifierData *mmd)
mmd->domain->guiding_alpha = 2.0f;
mmd->domain->guiding_beta = 5;
mmd->domain->guiding_vel_factor = 2.0f;
- mmd->domain->guide_res = NULL;
mmd->domain->guiding_source = FLUID_DOMAIN_GUIDING_SRC_DOMAIN;
/* cache options */
@@ -1049,7 +1048,7 @@ void mantaModifier_copy(const struct MantaModifierData *mmd,
tmds->guiding_alpha = mds->guiding_alpha;
tmds->guiding_beta = mds->guiding_beta;
tmds->guiding_vel_factor = mds->guiding_vel_factor;
- tmds->guide_res = mds->guide_res;
+ copy_v3_v3_int(tmds->guide_res, mds->guide_res);
tmds->guiding_source = mds->guiding_source;
/* cache options */
@@ -4116,7 +4115,7 @@ static void mantaModifier_processDomain(MantaModifierData *mmd,
if (guiding_parent) {
mmd_parent = (MantaModifierData *)modifiers_findByType(guiding_parent, eModifierType_Manta);
if (mmd_parent->domain) {
- mds->guide_res = mmd_parent->domain->res;
+ copy_v3_v3_int(mds->guide_res, mmd_parent->domain->res);
}
}
diff --git a/source/blender/makesdna/DNA_manta_types.h b/source/blender/makesdna/DNA_manta_types.h
index 783f04f7a3b..27d7ad3f3b8 100644
--- a/source/blender/makesdna/DNA_manta_types.h
+++ b/source/blender/makesdna/DNA_manta_types.h
@@ -377,9 +377,9 @@ typedef struct MantaDomainSettings {
float guiding_alpha; /* Guiding weight scalar (determines strength). */
int guiding_beta; /* Guiding blur radius (affects size of vortices). */
float guiding_vel_factor; /* Multiply guiding velocity by this factor. */
- int *guide_res; /* Res for velocity guide grids - independent from base res. */
+ int guide_res[3]; /* Res for velocity guide grids - independent from base res. */
short guiding_source;
- char _pad7[6]; /* Unused. */
+ char _pad7[2]; /* Unused. */
/* Cache options. */
int cache_frame_start;
diff --git a/source/blender/makesrna/intern/rna_manta.c b/source/blender/makesrna/intern/rna_manta.c
index 079511872e7..f4409d141b2 100644
--- a/source/blender/makesrna/intern/rna_manta.c
+++ b/source/blender/makesrna/intern/rna_manta.c
@@ -46,6 +46,7 @@
#ifdef RNA_RUNTIME
+# include "BLI_math.h"
# include "BLI_threads.h"
# include "BKE_colorband.h"
@@ -447,12 +448,11 @@ static void rna_Manta_guiding_parent_set(struct PointerRNA *ptr,
mmd_par = (MantaModifierData *)modifiers_findByType(par, eModifierType_Manta);
if (mmd_par && mmd_par->domain) {
mds->guiding_parent = value.data;
- mds->guide_res = mmd_par->domain->res;
+ copy_v3_v3_int(mds->guide_res, mmd_par->domain->res);
}
}
else {
mds->guiding_parent = NULL;
- mds->guide_res = NULL;
}
}
More information about the Bf-blender-cvs
mailing list