diff options
Diffstat (limited to 'source/blender/draw/modes/object_mode.c')
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 54e915dbe64..716372560db 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -234,6 +234,7 @@ typedef struct OBJECT_ShadingGroupList { /* Helpers */ DRWCallBuffer *relationship_lines; DRWCallBuffer *constraint_lines; + DRWCallBuffer *origin_xform; /* Camera */ DRWCallBuffer *camera; @@ -1735,6 +1736,16 @@ static void OBJECT_cache_init(void *vedata) sgl->constraint_lines = buffer_dynlines_dashed_uniform_color( sgl->non_meshes, gb->colorGridAxisZ, draw_ctx->sh_cfg); + { + DRWShadingGroup *grp_axes; + sgl->origin_xform = buffer_instance_color_axes( + sgl->non_meshes, DRW_cache_bone_arrows_get(), &grp_axes, draw_ctx->sh_cfg); + + DRW_shgroup_state_disable(grp_axes, DRW_STATE_DEPTH_LESS_EQUAL); + DRW_shgroup_state_enable(grp_axes, DRW_STATE_DEPTH_ALWAYS); + DRW_shgroup_state_enable(grp_axes, DRW_STATE_WIRE_SMOOTH); + } + /* Force Field Curve Guide End (here because of stipple) */ /* TODO port to shader stipple */ geom = DRW_cache_screenspace_circle_get(); @@ -3675,6 +3686,15 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) DRW_shgroup_bounds(sgl, ob, theme_id); } + /* Helpers for when we're transforming origins. */ + if (scene->toolsettings->transform_flag & SCE_XFORM_DATA_ORIGIN) { + if (ob->base_flag & BASE_SELECTED) { + const float color[4] = {0.75, 0.75, 0.75, 0.5}; + float axes_size = 1.0f; + DRW_buffer_add_entry(sgl->origin_xform, color, &axes_size, ob->obmat); + } + } + /* don't show object extras in set's */ if ((ob->base_flag & (BASE_FROM_SET | BASE_FROM_DUPLI)) == 0) { if ((draw_ctx->object_mode & (OB_MODE_ALL_PAINT | OB_MODE_ALL_PAINT_GPENCIL)) == 0) { |