[Bf-blender-cvs] [31da3936b48] master: GPencil: Add Frame parameter to modifier deformStroke Callback
Antonio Vazquez
noreply at git.blender.org
Fri Aug 2 09:50:45 CEST 2019
Commit: 31da3936b487ee4060635fe40c7c8affef92e372
Author: Antonio Vazquez
Date: Fri Aug 2 09:50:33 2019 +0200
Branches: master
https://developer.blender.org/rB31da3936b487ee4060635fe40c7c8affef92e372
GPencil: Add Frame parameter to modifier deformStroke Callback
This commit adds the frame to deformStroke Callback as a preparation for new modifiers that will need this variable.
Actually, the existing modifiers are not using the frame.
===================================================================
M source/blender/blenkernel/BKE_gpencil_modifier.h
M source/blender/blenkernel/intern/gpencil_modifier.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
M source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
M source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
M source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_gpencil_modifier.h b/source/blender/blenkernel/BKE_gpencil_modifier.h
index 1f2f8ee57bf..7f55ee2beb4 100644
--- a/source/blender/blenkernel/BKE_gpencil_modifier.h
+++ b/source/blender/blenkernel/BKE_gpencil_modifier.h
@@ -140,6 +140,7 @@ typedef struct GpencilModifierTypeInfo {
struct Depsgraph *depsgraph,
struct Object *ob,
struct bGPDlayer *gpl,
+ struct bGPDframe *gpf,
struct bGPDstroke *gps);
/**
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index 34daba385f6..f1ad801b951 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -343,7 +343,7 @@ bool BKE_gpencil_has_time_modifiers(Object *ob)
void BKE_gpencil_stroke_modifiers(Depsgraph *depsgraph,
Object *ob,
bGPDlayer *gpl,
- bGPDframe *UNUSED(gpf),
+ bGPDframe *gpf,
bGPDstroke *gps,
bool is_render)
{
@@ -360,7 +360,7 @@ void BKE_gpencil_stroke_modifiers(Depsgraph *depsgraph,
}
if (mti && mti->deformStroke) {
- mti->deformStroke(md, depsgraph, ob, gpl, gps);
+ mti->deformStroke(md, depsgraph, ob, gpl, gpf, gps);
/* subdivide always requires update */
if (md->type == eGpencilModifierType_Subdiv) {
gps->flag |= GP_STROKE_RECALC_GEOMETRY;
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
index 1ef1068ee52..4297cbb545c 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
@@ -107,6 +107,7 @@ static void deformStroke(GpencilModifierData *md,
Depsgraph *UNUSED(depsgraph),
Object *ob,
bGPDlayer *UNUSED(gpl),
+ bGPDframe *UNUSED(gpf),
bGPDstroke *gps)
{
ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)md;
@@ -140,7 +141,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
/* compute armature effects on this frame */
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- deformStroke(md_eval, depsgraph, object_eval, gpl, gps);
+ deformStroke(md_eval, depsgraph, object_eval, gpl, gpf, gps);
}
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
index d54ec75862b..13329e4176d 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
@@ -65,6 +65,7 @@ static void deformStroke(GpencilModifierData *md,
Depsgraph *UNUSED(depsgraph),
Object *ob,
bGPDlayer *gpl,
+ bGPDframe *UNUSED(gpf),
bGPDstroke *gps)
{
@@ -128,7 +129,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
copy_v4_v4(gps->runtime.tmp_stroke_rgba, gp_style->stroke_rgba);
copy_v4_v4(gps->runtime.tmp_fill_rgba, gp_style->fill_rgba);
- deformStroke(md, depsgraph, ob, gpl, gps);
+ deformStroke(md, depsgraph, ob, gpl, gpf, gps);
gpencil_apply_modifier_material(
bmain, ob, mat, gh_color, gps, (bool)(mmd->flag & GP_COLOR_CREATE_COLORS));
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
index daca46c3a9a..d56b3217c9f 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
@@ -190,6 +190,7 @@ static void deformStroke(GpencilModifierData *md,
Depsgraph *UNUSED(depsgraph),
Object *ob,
bGPDlayer *gpl,
+ bGPDframe *UNUSED(gpf),
bGPDstroke *gps)
{
HookGpencilModifierData *mmd = (HookGpencilModifierData *)md;
@@ -285,7 +286,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
/* compute hook effects on this frame */
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- deformStroke(md, depsgraph, ob, gpl, gps);
+ deformStroke(md, depsgraph, ob, gpl, gpf, gps);
}
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
index da2b4214da1..aa5015bac35 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
@@ -70,6 +70,7 @@ static void deformStroke(GpencilModifierData *md,
Depsgraph *UNUSED(depsgraph),
Object *ob,
bGPDlayer *gpl,
+ bGPDframe *UNUSED(gpf),
bGPDstroke *gps)
{
LatticeGpencilModifierData *mmd = (LatticeGpencilModifierData *)md;
@@ -134,7 +135,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
/* compute lattice effects on this frame */
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- deformStroke(md, depsgraph, ob, gpl, gps);
+ deformStroke(md, depsgraph, ob, gpl, gpf, gps);
}
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
index e891b6dea12..2c4d99adeee 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
@@ -72,8 +72,12 @@ static bool dependsOnTime(GpencilModifierData *md)
}
/* aply noise effect based on stroke direction */
-static void deformStroke(
- GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDstroke *gps)
+static void deformStroke(GpencilModifierData *md,
+ Depsgraph *depsgraph,
+ Object *ob,
+ bGPDlayer *gpl,
+ bGPDframe *UNUSED(gpf),
+ bGPDstroke *gps)
{
NoiseGpencilModifierData *mmd = (NoiseGpencilModifierData *)md;
bGPDspoint *pt0, *pt1;
@@ -239,7 +243,7 @@ static void bakeModifier(struct Main *UNUSED(bmain),
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- deformStroke(md, depsgraph, ob, gpl, gps);
+ deformStroke(md, depsgraph, ob, gpl, gpf, gps);
}
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
index 345a6c34f23..399fc407455 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
@@ -64,6 +64,7 @@ static void deformStroke(GpencilModifierData *md,
Depsgraph *UNUSED(depsgraph),
Object *ob,
bGPDlayer *gpl,
+ bGPDframe *UNUSED(gpf),
bGPDstroke *gps)
{
OffsetGpencilModifierData *mmd = (OffsetGpencilModifierData *)md;
@@ -116,7 +117,7 @@ static void bakeModifier(struct Main *UNUSED(bmain),
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- deformStroke(md, depsgraph, ob, gpl, gps);
+ deformStroke(md, depsgraph, ob, gpl, gpf, gps);
}
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
index 587cf527118..36a1c3db700 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
@@ -67,6 +67,7 @@ static void deformStroke(GpencilModifierData *md,
Depsgraph *UNUSED(depsgraph),
Object *ob,
bGPDlayer *gpl,
+ bGPDframe *UNUSED(gpf),
bGPDstroke *gps)
{
OpacityGpencilModifierData *mmd = (OpacityGpencilModifierData *)md;
@@ -146,7 +147,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
copy_v4_v4(gps->runtime.tmp_stroke_rgba, gp_style->stroke_rgba);
copy_v4_v4(gps->runtime.tmp_fill_rgba, gp_style->fill_rgba);
- deformStroke(md, depsgraph, ob, gpl, gps);
+ deformStroke(md, depsgraph, ob, gpl, gpf, gps);
gpencil_apply_modifier_material(
bmain, ob, mat, gh_color, gps, (bool)(mmd->flag & GP_OPACITY_CREATE_COLORS));
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
index 5e5c60645ad..746a689c08e 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
@@ -57,6 +57,7 @@ static void deformStroke(GpencilModifierData *md,
Depsgraph *UNUSED(depsgraph),
Object *ob,
bGPDlayer *gpl,
+ bGPDframe *UNUSED(gpf),
bGPDstroke *gps)
{
SimplifyGpencilModifierData *mmd = (SimplifyGpencilModifierData *)md;
@@ -95,7 +96,7 @@ static void bakeModifier(struct M
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list