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
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-06-06 12:45:29 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-06-06 13:00:35 +0300
commita418e269c8c5660190da9423aaf3d5e792442750 (patch)
treedfee39b565629f94a0abd75cae0ce37820319036 /source
parent28e44da8604bf856b8f82f5696edeac4010e3b4b (diff)
Draw manager: visibility of objects centers to mimic old 2.7x behaviour
We only show object center if object is selected, active or if viewport has the "All Object Origins" options. The viewport display options can migrate to renderlayer options. However, we can mimic 2.7x as a compromise while the final design is finalized.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/modes/object_mode.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 7ca8006f36c..4c2ef6ea29f 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1407,12 +1407,15 @@ static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob)
}
}
-static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob)
+static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl, View3D *v3d)
{
const bool is_library = ob->id.us > 1 || ID_IS_LINKED_DATABLOCK(ob);
DRWShadingGroup *shgroup;
- if ((ob->base_flag & BASE_SELECTED) != 0) {
+ if (ob == OBACT_NEW) {
+ shgroup = stl->g_data->center_active;
+ }
+ else if (ob->base_flag & BASE_SELECTED) {
if (is_library) {
shgroup = stl->g_data->center_selected_lib;
}
@@ -1420,7 +1423,7 @@ static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob)
shgroup = stl->g_data->center_selected;
}
}
- else {
+ else if (v3d->flag & V3D_DRAW_CENTERS) {
if (is_library) {
shgroup = stl->g_data->center_deselected_lib;
}
@@ -1428,6 +1431,9 @@ static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob)
shgroup = stl->g_data->center_deselected;
}
}
+ else {
+ return;
+ }
DRW_shgroup_call_dynamic_add(shgroup, ob->obmat[3]);
}
@@ -1504,6 +1510,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
SceneLayer *sl = draw_ctx->sl;
+ View3D *v3d = draw_ctx->v3d;
int theme_id = TH_UNDEFINED;
//CollectionEngineSettings *ces_mode_ob = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_OBJECT, "");
@@ -1611,7 +1618,9 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
/* don't show object extras in set's */
if ((ob->base_flag & (BASE_FROM_SET | BASE_FROMDUPLI)) == 0) {
- DRW_shgroup_object_center(stl, ob);
+
+ DRW_shgroup_object_center(stl, ob, sl, v3d);
+
DRW_shgroup_relationship_lines(stl, ob);
if ((ob->dtx & OB_DRAWNAME) && DRW_state_show_text()) {