diff options
author | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-10 16:18:12 +0300 |
---|---|---|
committer | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-10 16:18:12 +0300 |
commit | 67474a7e622957044bc708119a7cfa49a82790fd (patch) | |
tree | 1689263da79f08b1c3c9725ac56c3da8b5d91fbb /source/blender/modifiers | |
parent | b091542fe91353c15dd7240ba7ce8ecf72d4011b (diff) | |
parent | 553b581f25c1782c4231816965cd3f6ce58a449a (diff) |
Merge master to soc-2019-cycles-procedural.soc-2019-cycles-procedural
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_armature.c | 7 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_hook.c | 12 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_warp.c | 12 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvg_util.c | 4 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgedit.c | 8 |
5 files changed, 24 insertions, 19 deletions
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index 72215659915..7ae5fda7111 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -79,7 +79,12 @@ static bool isDisabled(const struct Scene *UNUSED(scene), { ArmatureModifierData *amd = (ArmatureModifierData *)md; - return !amd->object; + /* The object type check is only needed here in case we have a placeholder + * object assigned (because the library containing the armature is missing). + * + * In other cases it should be impossible. + */ + return !amd->object || amd->object->type != OB_ARMATURE; } static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index c12fb9c1bd8..2f902db9340 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -49,7 +49,7 @@ static void initData(ModifierData *md) HookModifierData *hmd = (HookModifierData *)md; hmd->force = 1.0; - hmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + hmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); hmd->falloff_type = eHook_Falloff_Smooth; hmd->flag = 0; } @@ -61,7 +61,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla modifier_copyData_generic(md, target, flag); - thmd->curfalloff = curvemapping_copy(hmd->curfalloff); + thmd->curfalloff = BKE_curvemapping_copy(hmd->curfalloff); thmd->indexar = MEM_dupallocN(hmd->indexar); } @@ -88,7 +88,7 @@ static void freeData(ModifierData *md) { HookModifierData *hmd = (HookModifierData *)md; - curvemapping_free(hmd->curfalloff); + BKE_curvemapping_free(hmd->curfalloff); MEM_SAFE_FREE(hmd->indexar); } @@ -174,7 +174,7 @@ static float hook_falloff(const struct HookData_cb *hd, const float len_sq) break; #endif case eHook_Falloff_Curve: - fac = curvemapping_evaluateF(hd->curfalloff, 0, fac); + fac = BKE_curvemapping_evaluateF(hd->curfalloff, 0, fac); break; case eHook_Falloff_Sharp: fac = fac * fac; @@ -262,11 +262,11 @@ static void deformVerts_do(HookModifierData *hmd, if (hmd->curfalloff == NULL) { /* should never happen, but bad lib linking could cause it */ - hmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + hmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } if (hmd->curfalloff) { - curvemapping_initialize(hmd->curfalloff); + BKE_curvemapping_initialize(hmd->curfalloff); } /* Generic data needed for applying per-vertex calculations (initialize all members) */ diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index 6441ab69391..7155498c942 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -50,7 +50,7 @@ static void initData(ModifierData *md) { WarpModifierData *wmd = (WarpModifierData *)md; - wmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + wmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); wmd->texture = NULL; wmd->strength = 1.0f; wmd->falloff_radius = 1.0f; @@ -65,7 +65,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla modifier_copyData_generic(md, target, flag); - twmd->curfalloff = curvemapping_copy(wmd->curfalloff); + twmd->curfalloff = BKE_curvemapping_copy(wmd->curfalloff); } static void requiredDataMask(Object *UNUSED(ob), @@ -100,7 +100,7 @@ static bool dependsOnTime(ModifierData *md) static void freeData(ModifierData *md) { WarpModifierData *wmd = (WarpModifierData *)md; - curvemapping_free(wmd->curfalloff); + BKE_curvemapping_free(wmd->curfalloff); } static bool isDisabled(const struct Scene *UNUSED(scene), @@ -188,11 +188,11 @@ static void warpModifier_do(WarpModifierData *wmd, } if (wmd->curfalloff == NULL) { /* should never happen, but bad lib linking could cause it */ - wmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + wmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } if (wmd->curfalloff) { - curvemapping_initialize(wmd->curfalloff); + BKE_curvemapping_initialize(wmd->curfalloff); } invert_m4_m4(obinv, ob->obmat); @@ -247,7 +247,7 @@ static void warpModifier_do(WarpModifierData *wmd, fac = 1.0f; break; case eWarp_Falloff_Curve: - fac = curvemapping_evaluateF(wmd->curfalloff, 0, fac); + fac = BKE_curvemapping_evaluateF(wmd->curfalloff, 0, fac); break; case eWarp_Falloff_Sharp: fac = fac * fac; diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index 61872cbe464..486d5c90bef 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -72,7 +72,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm } if (cmap && falloff_type == MOD_WVG_MAPPING_CURVE) { - curvemapping_initialize(cmap); + BKE_curvemapping_initialize(cmap); } /* Map each weight (vertex) to its new value, accordingly to the chosen mode. */ @@ -83,7 +83,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm /* Closely matches PROP_SMOOTH and similar. */ switch (falloff_type) { case MOD_WVG_MAPPING_CURVE: - fac = curvemapping_evaluateF(cmap, 0, fac); + fac = BKE_curvemapping_evaluateF(cmap, 0, fac); break; case MOD_WVG_MAPPING_SHARP: fac = fac * fac; diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 207c5851602..045ba78fab5 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -57,8 +57,8 @@ static void initData(ModifierData *md) wmd->falloff_type = MOD_WVG_MAPPING_NONE; wmd->default_weight = 0.0f; - wmd->cmap_curve = curvemapping_add(1, 0.0, 0.0, 1.0, 1.0); - curvemapping_initialize(wmd->cmap_curve); + wmd->cmap_curve = BKE_curvemapping_add(1, 0.0, 0.0, 1.0, 1.0); + BKE_curvemapping_initialize(wmd->cmap_curve); wmd->rem_threshold = 0.01f; wmd->add_threshold = 0.01f; @@ -71,7 +71,7 @@ static void initData(ModifierData *md) static void freeData(ModifierData *md) { WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md; - curvemapping_free(wmd->cmap_curve); + BKE_curvemapping_free(wmd->cmap_curve); } static void copyData(const ModifierData *md, ModifierData *target, const int flag) @@ -81,7 +81,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla modifier_copyData_generic(md, target, flag); - twmd->cmap_curve = curvemapping_copy(wmd->cmap_curve); + twmd->cmap_curve = BKE_curvemapping_copy(wmd->cmap_curve); } static void requiredDataMask(Object *UNUSED(ob), |