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:
authorAntony Riakiotakis <kalast@gmail.com>2014-09-08 20:15:42 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-09-08 20:15:42 +0400
commitd9ffc99e66d659ac887d801b9cc071b4c3f9b8ab (patch)
treed88e83b5a9edab115081641d26c811b6aa22296a /source/blender/editors/object/object_group.c
parent551ebaa3dd758bc1975548c28766bfa3159d3846 (diff)
parentb1490e39dd1017e51984d8a34d226e869bbb25df (diff)
Merge branch 'master' into soc-2014-viewport_fxsoc-2014-viewport_fx
I have resolved some differences, for instance selection code which was more or less a stub, to be the same as master. This will have to be fixed later. Conflicts: CMakeLists.txt intern/ghost/CMakeLists.txt intern/ghost/intern/GHOST_SystemWin32.cpp intern/ghost/intern/GHOST_Window.cpp intern/ghost/intern/GHOST_WindowWin32.cpp intern/ghost/intern/GHOST_WindowX11.cpp source/blender/blenlib/BLI_math_matrix.h source/blender/blenlib/intern/math_matrix.c source/blender/gpu/CMakeLists.txt source/blender/gpu/GPU_select.h source/blender/gpu/intern/gpu_buffers.c source/blender/gpu/intern/gpu_draw.c source/blender/gpu/intern/gpu_extensions.c source/blender/gpu/intern/gpu_select.c source/blender/gpu/shaders/gpu_shader_simple_vert.glsl source/blender/nodes/CMakeLists.txt
Diffstat (limited to 'source/blender/editors/object/object_group.c')
-rw-r--r--source/blender/editors/object/object_group.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 47b5f1605e7..20e2e22cdf8 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -563,3 +563,67 @@ void OBJECT_OT_group_remove(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
+
+static int group_unlink_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Group *group = CTX_data_pointer_get_type(C, "group", &RNA_Group).data;
+
+ if (!group)
+ return OPERATOR_CANCELLED;
+
+ BKE_group_unlink(group);
+
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_group_unlink(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Unlink Group";
+ ot->idname = "OBJECT_OT_group_unlink";
+ ot->description = "Unlink the group from all objects";
+
+ /* api callbacks */
+ ot->exec = group_unlink_exec;
+ ot->poll = ED_operator_objectmode;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same group as the active */
+{
+ Group *group = CTX_data_pointer_get_type(C, "group", &RNA_Group).data;
+
+ if (!group)
+ return OPERATOR_CANCELLED;
+
+ CTX_DATA_BEGIN (C, Base *, base, visible_bases)
+ {
+ if (!(base->flag & SELECT) && BKE_group_object_exists(group, base->object)) {
+ ED_base_object_select(base, BA_SELECT);
+ }
+ }
+ CTX_DATA_END;
+
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_grouped_select(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Select Grouped";
+ ot->idname = "OBJECT_OT_grouped_select";
+ ot->description = "Select all objects in group";
+
+ /* api callbacks */
+ ot->exec = select_grouped_exec;
+ ot->poll = ED_operator_objectmode;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}