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_gpencilnoise.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
index 5ed08e39197..82f9d9a323d 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.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
@@ -44,6 +44,8 @@
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
+#include "BKE_lib_query.h"
+#include "BKE_modifier.h"
#include "BKE_object.h"
#include "DEG_depsgraph.h"
@@ -59,9 +61,7 @@ static void initData(GpencilModifierData *md)
gpmd->flag |= GP_NOISE_FULL_STROKE;
gpmd->flag |= GP_NOISE_USE_RANDOM;
gpmd->factor = 0.5f;
- gpmd->layername[0] = '\0';
- gpmd->materialname[0] = '\0';
- gpmd->vgname[0] = '\0';
+ gpmd->material = NULL;
gpmd->step = 4;
gpmd->seed = 1;
gpmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -91,7 +91,7 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
tgmd->curve_intensity = NULL;
}
- BKE_gpencil_modifier_copyData_generic(md, target);
+ BKE_gpencil_modifier_copydata_generic(md, target);
tgmd->curve_intensity = BKE_curvemapping_copy(gmd->curve_intensity);
}
@@ -135,7 +135,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,
@@ -259,6 +259,13 @@ static void bakeModifier(struct Main *UNUSED(bmain),
}
}
+static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
+{
+ NoiseGpencilModifierData *mmd = (NoiseGpencilModifierData *)md;
+
+ walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER);
+}
+
GpencilModifierTypeInfo modifierType_Gpencil_Noise = {
/* name */ "Noise",
/* structName */ "NoiseGpencilModifierData",
@@ -279,6 +286,6 @@ GpencilModifierTypeInfo modifierType_Gpencil_Noise = {
/* updateDepsgraph */ NULL,
/* dependsOnTime */ dependsOnTime,
/* foreachObjectLink */ NULL,
- /* foreachIDLink */ NULL,
+ /* foreachIDLink */ foreachIDLink,
/* foreachTexLink */ NULL,
};