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/editors/gpencil/gpencil_armature.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_armature.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_armature.c b/source/blender/editors/gpencil/gpencil_armature.c
index 1528c448c0b..ab8b1a9719b 100644
--- a/source/blender/editors/gpencil/gpencil_armature.c
+++ b/source/blender/editors/gpencil/gpencil_armature.c
@@ -481,8 +481,7 @@ static void gpencil_object_vgroup_calc_from_armature(const bContext *C,
DEG_relations_tag_update(CTX_data_main(C));
}
-bool ED_gpencil_add_armature_weights(
- const bContext *C, ReportList *reports, Object *ob, Object *ob_arm, int mode)
+bool ED_gpencil_add_armature(const bContext *C, ReportList *reports, Object *ob, Object *ob_arm)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
@@ -516,11 +515,24 @@ bool ED_gpencil_add_armature_weights(
return false;
}
}
+ return true;
+}
+
+bool ED_gpencil_add_armature_weights(
+ const bContext *C, ReportList *reports, Object *ob, Object *ob_arm, int mode)
+{
+ if (ob == NULL) {
+ return false;
+ }
+
+ bool success = ED_gpencil_add_armature(C, reports, ob, ob_arm);
/* add weights */
- gpencil_object_vgroup_calc_from_armature(C, ob, ob_arm, mode, DEFAULT_RATIO, DEFAULT_DECAY);
+ if (success) {
+ gpencil_object_vgroup_calc_from_armature(C, ob, ob_arm, mode, DEFAULT_RATIO, DEFAULT_DECAY);
+ }
- return true;
+ return success;
}
/* ***************** Generate armature weights ************************** */
static bool gpencil_generate_weights_poll(bContext *C)