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:
authorBastien Montagne <bastien@blender.org>2020-04-10 23:00:21 +0300
committerBastien Montagne <bastien@blender.org>2020-04-11 18:16:58 +0300
commit5cc7036aa39506f3af3608ad450f1fdf6b2f3347 (patch)
tree99d6644347b40ec7d3855d9f8fa271dbb8ecc2b1 /source/blender/modifiers/intern/MOD_uvwarp.c
parentb0350d8310f253b01b57a5a46ca982cc787b9478 (diff)
Factorize some common modifiers depsgraph relation update code.
Add a utility to deal with common 'object or posebone transform' case.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_uvwarp.c')
-rw-r--r--source/blender/modifiers/intern/MOD_uvwarp.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c
index 46298c0e00d..6545159bdde 100644
--- a/source/blender/modifiers/intern/MOD_uvwarp.c
+++ b/source/blender/modifiers/intern/MOD_uvwarp.c
@@ -233,26 +233,14 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
walk(userData, ob, &umd->object_src, IDWALK_CB_NOP);
}
-static void uv_warp_deps_object_bone_new(struct DepsNodeHandle *node,
- Object *object,
- const char *bonename)
-{
- if (object != NULL) {
- if (object->type == OB_ARMATURE && bonename[0]) {
- DEG_add_object_relation(node, object, DEG_OB_COMP_EVAL_POSE, "UVWarp Modifier");
- }
- else {
- DEG_add_object_relation(node, object, DEG_OB_COMP_TRANSFORM, "UVWarp Modifier");
- }
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
UVWarpModifierData *umd = (UVWarpModifierData *)md;
- uv_warp_deps_object_bone_new(ctx->node, umd->object_src, umd->bone_src);
- uv_warp_deps_object_bone_new(ctx->node, umd->object_dst, umd->bone_dst);
+ MOD_depsgraph_update_object_bone_relation(
+ ctx->node, umd->object_src, umd->bone_src, "UVWarp Modifier");
+ MOD_depsgraph_update_object_bone_relation(
+ ctx->node, umd->object_dst, umd->bone_dst, "UVWarp Modifier");
DEG_add_modifier_to_transform_relation(ctx->node, "UVWarp Modifier");
}