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:
authorDalai Felinto <dfelinto@gmail.com>2018-10-12 21:15:39 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-10-12 21:26:23 +0300
commit894c3b15320da4c4b71518e0df644a872c2cadd6 (patch)
tree9d1d04652fccd299e62e46599ed59a1ab18c66b8 /source/blender/editors/armature/pose_edit.c
parent29a281f9ef5b3a577e6d658892a704b509d718ef (diff)
Revert "Multi-Objects: ARMATURE_OT_armature_layers
This reverts commits: * 29a281f9ef5b3a577e6d658892a704b509d718ef * 3a8b56ce24c9228a885d3c44f4c22d90be04ae4c This operator shouldn't behave multi-objects. This would only work if all the selected objects had the same logic for their layers, which may be likely for characters, but it won't be for mixing props and characters.
Diffstat (limited to 'source/blender/editors/armature/pose_edit.c')
-rw-r--r--source/blender/editors/armature/pose_edit.c37
1 files changed, 13 insertions, 24 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index e080acc78ed..3960b53a687 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -986,38 +986,27 @@ static int armature_layers_invoke(bContext *C, wmOperator *op, const wmEvent *ev
/* Set the visible layers for the active armature (edit and pose modes) */
static int armature_layers_exec(bContext *C, wmOperator *op)
{
- ViewLayer *view_layer = CTX_data_view_layer(C);
- Object *ob_active = CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
+ bArmature *arm = armature_layers_get_data(&ob);
PointerRNA ptr;
bool layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
- bool changed = false;
+
+ if (arm == NULL) {
+ return OPERATOR_CANCELLED;
+ }
/* get the values set in the operator properties */
RNA_boolean_get_array(op->ptr, "layers", layers);
- uint objects_len = 0;
- Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data(view_layer, &objects_len, ob_active->mode);
- for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
- Object *ob = objects[ob_index];
- bArmature *arm = armature_layers_get_data(&ob);
-
- if (arm == NULL) {
- continue;
- }
-
- /* Get pointer for armature, and write data there... */
- RNA_id_pointer_create((ID *)arm, &ptr);
- RNA_boolean_set_array(&ptr, "layers", layers);
-
- /* Note, notifier might evolve. */
- WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
- DEG_id_tag_update(&arm->id, DEG_TAG_COPY_ON_WRITE);
+ /* get pointer for armature, and write data there... */
+ RNA_id_pointer_create((ID *)arm, &ptr);
+ RNA_boolean_set_array(&ptr, "layers", layers);
- changed = true;
- }
- MEM_freeN(objects);
+ /* note, notifier might evolve */
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
+ DEG_id_tag_update(&arm->id, DEG_TAG_COPY_ON_WRITE);
- return changed ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ return OPERATOR_FINISHED;
}
void ARMATURE_OT_armature_layers(wmOperatorType *ot)