diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 17:27:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 18:56:50 +0300 |
commit | bfc9d426bb95e2bc0dd4541d6b4c5f802909149c (patch) | |
tree | 37702887bc3185309a13612613efd2752ebe0639 /source/blender/draw | |
parent | 80bb4254c6fb638cee0d33868c81c76c104817bf (diff) |
Multi-Object Editing
This adds initial multi-object editing support.
- Selected objects are used when entering edit & pose modes.
- Selection & tools work on all objects however many tools need porting
See: T54641 for remaining tasks.
Indentation will be done separately.
See patch: D3101
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_armature.c | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 7 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_curve_mode.c | 9 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_lattice_mode.c | 4 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 4 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_metaball_mode.c | 3 | ||||
-rw-r--r-- | source/blender/draw/modes/pose_mode.c | 4 |
7 files changed, 27 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index c14fe70e0c3..fe87e7f17fd 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -1228,7 +1228,7 @@ static void draw_armature_edit(Object *ob) const bool show_text = DRW_state_show_text(); - for (eBone = arm->edbo->first, index = 0; eBone; eBone = eBone->next, index++) { + for (eBone = arm->edbo->first, index = ob->select_color; eBone; eBone = eBone->next, index += 0x10000) { if (eBone->layer & arm->layer) { if ((eBone->flag & BONE_HIDDEN_A) == 0) { const int select_id = is_select ? index : (unsigned int)-1; diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 6ba1225b687..420841e2efa 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1554,7 +1554,14 @@ void DRW_draw_select_loop( drw_engines_cache_init(); if (use_obedit) { +#if 0 drw_engines_cache_populate(obact); +#else + FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, obact->mode, ob_iter) { + drw_engines_cache_populate(ob_iter); + } + FOREACH_OBJECT_IN_MODE_END; +#endif } else { DEG_OBJECT_ITER_BEGIN( diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c index 73a4fb1e9e6..b33ebd8ba60 100644 --- a/source/blender/draw/modes/edit_curve_mode.c +++ b/source/blender/draw/modes/edit_curve_mode.c @@ -28,6 +28,8 @@ #include "DNA_curve_types.h" +#include "BKE_object.h" + /* If builtin shaders are needed */ #include "GPU_shader.h" #include "GPU_batch.h" @@ -233,7 +235,12 @@ static void EDIT_CURVE_cache_populate(void *vedata, Object *ob) UNUSED_VARS(psl, stl); if (ob->type == OB_CURVE) { - if (ob == draw_ctx->object_edit) { +#if 0 + if (ob == draw_ctx->object_edit) +#else + if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob)) +#endif + { Curve *cu = ob->data; /* Get geometry cache */ struct Gwn_Batch *geom; diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c index 0268f4eb453..e8628711ffd 100644 --- a/source/blender/draw/modes/edit_lattice_mode.c +++ b/source/blender/draw/modes/edit_lattice_mode.c @@ -26,6 +26,8 @@ #include "DRW_engine.h" #include "DRW_render.h" +#include "BKE_object.h" + /* If builtin shaders are needed */ #include "GPU_shader.h" @@ -192,7 +194,7 @@ static void EDIT_LATTICE_cache_populate(void *vedata, Object *ob) UNUSED_VARS(psl); if (ob->type == OB_LATTICE) { - if (ob == draw_ctx->object_edit) { + if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob)) { /* Get geometry cache */ struct Gwn_Batch *geom; diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index 4bd69941809..c465fa38f04 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -37,6 +37,8 @@ #include "edit_mesh_mode_intern.h" /* own include */ +#include "BKE_object.h" + extern struct GPUUniformBuffer *globals_ubo; /* draw_common.c */ extern struct GlobalsUboStorage ts; /* draw_common.c */ @@ -448,7 +450,7 @@ static void EDIT_MESH_cache_populate(void *vedata, Object *ob) struct Gwn_Batch *geom; if (ob->type == OB_MESH) { - if (ob == draw_ctx->object_edit) { + if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob)) { const Mesh *me = ob->data; IDProperty *ces_mode_ed = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_EDIT, ""); bool do_occlude_wire = BKE_collection_engine_property_value_get_bool(ces_mode_ed, "show_occlude_wire"); diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c index bcabeef5bc3..f7b7113a4d6 100644 --- a/source/blender/draw/modes/edit_metaball_mode.c +++ b/source/blender/draw/modes/edit_metaball_mode.c @@ -28,6 +28,7 @@ #include "DNA_meta_types.h" +#include "BKE_object.h" #include "BKE_mball.h" /* If builtin shaders are needed */ @@ -171,7 +172,7 @@ static void EDIT_METABALL_cache_populate(void *vedata, Object *ob) const DRWContextState *draw_ctx = DRW_context_state_get(); DRWShadingGroup *group = stl->g_data->group; - if (ob == draw_ctx->object_edit) { + if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob)) { MetaBall *mb = ob->data; const bool is_select = DRW_state_is_select(); diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c index 749c3e71368..1d3d31ab54d 100644 --- a/source/blender/draw/modes/pose_mode.c +++ b/source/blender/draw/modes/pose_mode.c @@ -139,7 +139,9 @@ bool DRW_pose_mode_armature(Object *ob, Object *active_ob) const DRWContextState *draw_ctx = DRW_context_state_get(); /* Pode armature is handled by pose mode engine. */ - if ((ob == active_ob) && ((draw_ctx->object_mode & OB_MODE_POSE) != 0)) { + if (((ob == active_ob) || (ob->base_flag & BASE_SELECTED)) && + ((draw_ctx->object_mode & OB_MODE_POSE) != 0)) + { return true; } |