Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
index 76f22fc9a36..d39c94e06d5 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
@@ -10,7 +10,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
+ * along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2017, Blender Foundation
@@ -77,9 +77,7 @@ static void initData(GpencilModifierData *md)
{
HookGpencilModifierData *gpmd = (HookGpencilModifierData *)md;
gpmd->pass_index = 0;
- gpmd->layername[0] = '\0';
- gpmd->materialname[0] = '\0';
- gpmd->vgname[0] = '\0';
+ gpmd->material = NULL;
gpmd->object = NULL;
gpmd->force = 0.5f;
gpmd->falloff_type = eGPHook_Falloff_Smooth;
@@ -99,7 +97,7 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
tgmd->curfalloff = NULL;
}
- BKE_gpencil_modifier_copyData_generic(md, target);
+ BKE_gpencil_modifier_copydata_generic(md, target);
tgmd->curfalloff = BKE_curvemapping_copy(gmd->curfalloff);
}
@@ -208,7 +206,7 @@ static void deformStroke(GpencilModifierData *md,
if (!is_stroke_affected_by_modifier(ob,
mmd->layername,
- mmd->materialname,
+ mmd->material,
mmd->pass_index,
mmd->layer_pass,
1,
@@ -338,6 +336,15 @@ static void foreachObjectLink(GpencilModifierData *md,
walk(userData, ob, &mmd->object, IDWALK_CB_NOP);
}
+static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
+{
+ HookGpencilModifierData *mmd = (HookGpencilModifierData *)md;
+
+ walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER);
+
+ foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
+}
+
GpencilModifierTypeInfo modifierType_Gpencil_Hook = {
/* name */ "Hook",
/* structName */ "HookGpencilModifierData",
@@ -358,6 +365,6 @@ GpencilModifierTypeInfo modifierType_Gpencil_Hook = {
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* foreachObjectLink */ foreachObjectLink,
- /* foreachIDLink */ NULL,
+ /* foreachIDLink */ foreachIDLink,
/* foreachTexLink */ NULL,
};