Manipulator: changes for overlay options
There are now 3 categories in the overlay popover: - Navigation - Active (camera, lamp... etc) - Tool (manipulator) The user preference for mini axis now controls if the mini axis displays minimal or a full-interactive widget. Part of design: T55863
This commit is contained in:
@@ -238,15 +238,15 @@ class USERPREF_PT_interface(Panel):
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(view, "show_manipulator_navigate")
|
||||
# col.prop(view, "show_manipulator_navigate")
|
||||
|
||||
sub = col.column(align=True)
|
||||
|
||||
sub.prop(view, "show_mini_axis", text="Display Mini Axis")
|
||||
sub.active = not view.show_manipulator_navigate
|
||||
sub.label("3D Viewport Axis:")
|
||||
sub.row().prop(view, "mini_axis_type", expand=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = view.show_mini_axis
|
||||
sub.active = view.mini_axis_type == 'MINIMAL'
|
||||
sub.prop(view, "mini_axis_size", text="Size")
|
||||
sub.prop(view, "mini_axis_brightness", text="Brightness")
|
||||
|
||||
@@ -258,9 +258,7 @@ class USERPREF_PT_interface(Panel):
|
||||
#col.label(text="Open Toolbox Delay:")
|
||||
#col.prop(view, "open_left_mouse_delay", text="Hold LMB")
|
||||
#col.prop(view, "open_right_mouse_delay", text="Hold RMB")
|
||||
col.prop(view, "show_manipulator", text="Transform Manipulator")
|
||||
# Currently not working
|
||||
# col.prop(view, "show_manipulator_shaded")
|
||||
col.prop(view, "show_manipulator", text="Manipulators")
|
||||
sub = col.column()
|
||||
sub.active = view.show_manipulator
|
||||
sub.prop(view, "manipulator_size", text="Size")
|
||||
|
||||
@@ -3882,6 +3882,20 @@ class VIEW3D_PT_overlay(Panel):
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(view, "show_manipulator", text="Manipulators")
|
||||
has_manipulator = view.show_manipulator
|
||||
subsub = sub.column()
|
||||
subsub.active = has_manipulator
|
||||
subsub.prop(view, "show_manipulator_navigate", text="Navigate")
|
||||
del subsub
|
||||
sub = split.column()
|
||||
sub.active = has_manipulator
|
||||
sub.prop(view, "show_manipulator_context", text="Active Object")
|
||||
sub.prop(view, "show_manipulator_tool", text="Active Tools")
|
||||
|
||||
col.separator()
|
||||
|
||||
split = col.split()
|
||||
sub = split.column()
|
||||
sub.prop(overlay, "show_text", text="Text")
|
||||
sub.prop(overlay, "show_cursor", text="3D Cursor")
|
||||
sub.prop(overlay, "show_outline_selected")
|
||||
|
||||
@@ -71,7 +71,6 @@ void BLO_update_defaults_userpref_blend(void)
|
||||
/* Defaults from T54943 (phase 1). */
|
||||
U.flag &= ~USER_TOOLTIPS_PYTHON;
|
||||
U.uiflag |= USER_AUTOPERSP;
|
||||
U.manipulator_flag |= USER_MANIPULATOR_DRAW_NAVIGATE;
|
||||
U.uiflag2 |= USER_REGION_OVERLAP;
|
||||
|
||||
U.versions = 1;
|
||||
|
||||
@@ -1440,7 +1440,7 @@ void DRW_draw_render_loop_ex(
|
||||
if (DST.draw_ctx.evil_C) {
|
||||
/* needed so manipulator isn't obscured */
|
||||
if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
|
||||
((v3d->twflag & V3D_MANIPULATOR_DRAW) != 0))
|
||||
((v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0))
|
||||
{
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
DRW_draw_manipulator_3d();
|
||||
|
||||
@@ -1383,7 +1383,7 @@ void init_userdef_do_versions(Main *bmain)
|
||||
if (U.rvisize == 0) {
|
||||
U.rvisize = 15;
|
||||
U.rvibright = 8;
|
||||
U.uiflag |= USER_SHOW_ROTVIEWICON;
|
||||
U.uiflag |= USER_SHOW_MANIPULATOR_AXIS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,12 +59,11 @@
|
||||
/**
|
||||
* Main draw call for ManipulatorGeomInfo data
|
||||
*/
|
||||
void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const bool select, const float color[4])
|
||||
void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const bool UNUSED(select), const float color[4])
|
||||
{
|
||||
/* TODO store the Batches inside the ManipulatorGeomInfo and updated it when geom changes
|
||||
* So we don't need to re-created and discard it every time */
|
||||
|
||||
const bool use_lighting = true || (!select && ((U.manipulator_flag & USER_MANIPULATOR_SHADED) != 0));
|
||||
Gwn_VertBuf *vbo;
|
||||
Gwn_IndexBuf *el;
|
||||
Gwn_Batch *batch;
|
||||
@@ -72,11 +71,6 @@ void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const boo
|
||||
|
||||
Gwn_VertFormat format = {0};
|
||||
uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
|
||||
uint nor_id;
|
||||
|
||||
if (use_lighting) {
|
||||
nor_id = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
|
||||
}
|
||||
|
||||
/* Elements */
|
||||
GWN_indexbuf_init(&elb, GWN_PRIM_TRIS, info->ntris, info->nverts);
|
||||
@@ -91,11 +85,6 @@ void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const boo
|
||||
|
||||
GWN_vertbuf_attr_fill(vbo, pos_id, info->verts);
|
||||
|
||||
if (use_lighting) {
|
||||
/* Normals are expected to be smooth. */
|
||||
GWN_vertbuf_attr_fill(vbo, nor_id, info->normals);
|
||||
}
|
||||
|
||||
batch = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, el, GWN_BATCH_OWNS_VBO | GWN_BATCH_OWNS_INDEX);
|
||||
GWN_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR);
|
||||
|
||||
|
||||
@@ -163,16 +163,10 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
|
||||
|
||||
const float len = 0.25f;
|
||||
const float width = 0.06f;
|
||||
const bool use_lighting = (!select && ((U.manipulator_flag & USER_MANIPULATOR_SHADED) != 0));
|
||||
|
||||
/* translate to line end */
|
||||
gpuTranslate3f(0.0f, 0.0f, arrow_length);
|
||||
|
||||
if (use_lighting) {
|
||||
immUnbindProgram();
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR);
|
||||
}
|
||||
|
||||
imm_draw_circle_fill_3d(pos, 0.0, 0.0, width, 8);
|
||||
imm_draw_cylinder_fill_3d(pos, width, 0.0, len, 8, 1);
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ static int add_primitive_cube_manipulator_invoke(bContext *C, wmOperator *op, co
|
||||
int ret = add_primitive_cube_manipulator_exec(C, op);
|
||||
if (ret & OPERATOR_FINISHED) {
|
||||
/* Setup manipulators */
|
||||
if (v3d && (v3d->twflag & V3D_MANIPULATOR_DRAW)) {
|
||||
if (v3d && ((v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0)) {
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
wmManipulatorMap *mmap = ar->manipulator_map;
|
||||
wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_find("MESH_WGT_add_bounds", false);
|
||||
|
||||
@@ -95,7 +95,7 @@ typedef struct {
|
||||
/* modal only */
|
||||
float mcenter[2];
|
||||
void *draw_handle_pixel;
|
||||
short twflag;
|
||||
short mpr_flag;
|
||||
short value_mode; /* Which value does mouse movement and numeric input affect? */
|
||||
float segments; /* Segments as float so smooth mouse pan works in small increments */
|
||||
} BevelData;
|
||||
@@ -201,8 +201,8 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
|
||||
G.moving = G_TRANSFORM_EDIT;
|
||||
|
||||
if (v3d) {
|
||||
opdata->twflag = v3d->twflag;
|
||||
v3d->twflag = 0;
|
||||
opdata->mpr_flag = v3d->mpr_flag;
|
||||
v3d->mpr_flag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
|
||||
}
|
||||
ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel);
|
||||
if (v3d) {
|
||||
v3d->twflag = opdata->twflag;
|
||||
v3d->mpr_flag = opdata->mpr_flag;
|
||||
}
|
||||
G.moving = 0;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ typedef struct {
|
||||
/* modal only */
|
||||
BMBackup mesh_backup;
|
||||
bool is_first;
|
||||
short twflag;
|
||||
short mpr_flag;
|
||||
} BisectData;
|
||||
|
||||
static bool mesh_bisect_interactive_calc(
|
||||
@@ -156,8 +156,8 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
|
||||
/* misc other vars */
|
||||
G.moving = G_TRANSFORM_EDIT;
|
||||
opdata->twflag = v3d->twflag;
|
||||
v3d->twflag = 0;
|
||||
opdata->mpr_flag = v3d->mpr_flag;
|
||||
v3d->mpr_flag = 0;
|
||||
|
||||
/* initialize modal callout */
|
||||
ED_workspace_status_text(C, IFACE_("LMB: Click and drag to draw cut line"));
|
||||
@@ -169,7 +169,7 @@ static void edbm_bisect_exit(bContext *C, BisectData *opdata)
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
EDBM_redo_state_free(&opdata->mesh_backup, NULL, false);
|
||||
v3d->twflag = opdata->twflag;
|
||||
v3d->mpr_flag = opdata->mpr_flag;
|
||||
G.moving = 0;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
/* Setup manipulators */
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d && (v3d->twflag & V3D_MANIPULATOR_DRAW)) {
|
||||
if (v3d && (v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0) {
|
||||
WM_manipulator_group_type_ensure("MESH_WGT_bisect");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e
|
||||
#ifdef USE_MANIPULATOR
|
||||
if (ret & OPERATOR_FINISHED) {
|
||||
/* Setup manipulators */
|
||||
if (v3d && (v3d->twflag & V3D_MANIPULATOR_DRAW)) {
|
||||
if (v3d && ((v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0)) {
|
||||
WM_manipulator_group_type_ensure("MESH_WGT_spin");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ typedef struct {
|
||||
/* modal only */
|
||||
float mcenter[2];
|
||||
void *draw_handle_pixel;
|
||||
short twflag;
|
||||
short mpr_flag;
|
||||
} InsetData;
|
||||
|
||||
|
||||
@@ -173,8 +173,8 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
|
||||
ar->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL);
|
||||
G.moving = G_TRANSFORM_EDIT;
|
||||
if (v3d) {
|
||||
opdata->twflag = v3d->twflag;
|
||||
v3d->twflag = 0;
|
||||
opdata->mpr_flag = v3d->mpr_flag;
|
||||
v3d->mpr_flag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ static void edbm_inset_exit(bContext *C, wmOperator *op)
|
||||
}
|
||||
ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel);
|
||||
if (v3d) {
|
||||
v3d->twflag = opdata->twflag;
|
||||
v3d->mpr_flag = opdata->mpr_flag;
|
||||
}
|
||||
G.moving = 0;
|
||||
}
|
||||
|
||||
@@ -348,8 +348,6 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene)
|
||||
v3d->near = 0.01f;
|
||||
v3d->far = 1000.0f;
|
||||
|
||||
v3d->twflag |= U.manipulator_flag & V3D_MANIPULATOR_DRAW;
|
||||
|
||||
v3d->bundle_size = 0.2f;
|
||||
v3d->bundle_drawtype = OB_PLAINAXES;
|
||||
|
||||
|
||||
@@ -1203,11 +1203,14 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar, const int UNUSED(of
|
||||
|
||||
BLF_batch_draw_begin();
|
||||
|
||||
if (((U.uiflag & USER_SHOW_ROTVIEWICON) != 0) &&
|
||||
((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
|
||||
if ((U.uiflag & USER_SHOW_MANIPULATOR_AXIS) ||
|
||||
(v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
/* No need to display manipulator and this info. */
|
||||
((U.manipulator_flag & USER_MANIPULATOR_DRAW_NAVIGATE) == 0))
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_NAVIGATE)))
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
draw_view_axis(rv3d, &rect);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,12 @@ static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmManipulatorGro
|
||||
if (arm->drawtype == ARM_B_BONE) {
|
||||
if (arm->act_bone && arm->act_bone->segments > 1) {
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT)))
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,9 @@ struct CameraWidgetGroup {
|
||||
static bool WIDGETGROUP_camera_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d->flag2 & V3D_RENDER_OVERRIDE) {
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -358,7 +360,9 @@ static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmManipulatorGroupTy
|
||||
}
|
||||
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d->flag2 & V3D_RENDER_OVERRIDE) {
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,10 @@ static void manipulator_empty_image_prop_matrix_set(
|
||||
static bool WIDGETGROUP_empty_image_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d->flag2 & V3D_RENDER_OVERRIDE) {
|
||||
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,10 @@
|
||||
static bool WIDGETGROUP_forcefield_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d->flag2 & V3D_RENDER_OVERRIDE) {
|
||||
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@
|
||||
static bool WIDGETGROUP_lamp_spot_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d->flag2 & V3D_RENDER_OVERRIDE) {
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_CONTEXT)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,14 +179,13 @@ struct NavigateWidgetGroup {
|
||||
static bool WIDGETGROUP_navigate_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d->flag2 & V3D_RENDER_OVERRIDE) {
|
||||
if (((U.uiflag & USER_SHOW_MANIPULATOR_AXIS) == 0) ||
|
||||
(v3d->flag2 & V3D_RENDER_OVERRIDE) ||
|
||||
(v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_NAVIGATE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (U.manipulator_flag & USER_MANIPULATOR_DRAW_NAVIGATE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -541,7 +541,7 @@ void view3d_keymap(wmKeyConfig *keyconf)
|
||||
#else
|
||||
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0);
|
||||
#endif
|
||||
RNA_string_set(kmi->ptr, "data_path", "space_data.show_manipulator");
|
||||
RNA_string_set(kmi->ptr, "data_path", "space_data.show_manipulator_tool");
|
||||
|
||||
transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D);
|
||||
|
||||
|
||||
@@ -505,7 +505,7 @@ typedef struct TransInfo {
|
||||
|
||||
short current_orientation;
|
||||
TransformOrientation *custom_orientation; /* this gets used when current_orientation is V3D_MANIP_CUSTOM */
|
||||
short twflag; /* backup from view3d, to restore on end */
|
||||
short mpr_flag; /* backup from view3d, to restore on end */
|
||||
|
||||
short prop_mode;
|
||||
|
||||
|
||||
@@ -1350,8 +1350,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
|
||||
|
||||
/* turn manipulator off during transform */
|
||||
if (t->flag & T_MODAL) {
|
||||
t->twflag = v3d->twflag;
|
||||
v3d->twflag = 0;
|
||||
t->mpr_flag = v3d->mpr_flag;
|
||||
v3d->mpr_flag = 0;
|
||||
}
|
||||
|
||||
if (t->scene->toolsettings->transform_flag & SCE_XFORM_AXIS_ALIGN) {
|
||||
@@ -1690,7 +1690,7 @@ void postTrans(bContext *C, TransInfo *t)
|
||||
View3D *v3d = t->sa->spacedata.first;
|
||||
/* restore manipulator */
|
||||
if (t->flag & T_MODAL) {
|
||||
v3d->twflag = t->twflag;
|
||||
v3d->mpr_flag = t->mpr_flag;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1596,6 +1596,11 @@ static bool WIDGETGROUP_manipulator_poll(const struct bContext *C, struct wmMani
|
||||
WM_manipulator_group_type_unlink_delayed_ptr(wgt);
|
||||
return false;
|
||||
}
|
||||
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (v3d->mpr_flag & (V3D_MANIPULATOR_HIDE | V3D_MANIPULATOR_HIDE_TOOL)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -751,7 +751,7 @@ typedef enum eUserpref_UI_Flag {
|
||||
USER_ORBIT_SELECTION = (1 << 14),
|
||||
USER_DEPTH_NAVIGATE = (1 << 15),
|
||||
USER_HIDE_DOT = (1 << 16),
|
||||
USER_SHOW_ROTVIEWICON = (1 << 17),
|
||||
USER_SHOW_MANIPULATOR_AXIS = (1 << 17),
|
||||
USER_SHOW_VIEWPORTNAME = (1 << 18),
|
||||
USER_CAM_LOCK_NO_PARENT = (1 << 19),
|
||||
USER_ZOOM_TO_MOUSEPOS = (1 << 20),
|
||||
@@ -876,8 +876,6 @@ typedef enum eGP_UserdefSettings {
|
||||
|
||||
enum {
|
||||
USER_MANIPULATOR_DRAW = (1 << 0),
|
||||
USER_MANIPULATOR_DRAW_NAVIGATE = (1 << 1),
|
||||
USER_MANIPULATOR_SHADED = (1 << 8),
|
||||
};
|
||||
|
||||
/* Color Picker Types.
|
||||
|
||||
@@ -237,7 +237,7 @@ typedef struct View3D {
|
||||
char gridflag;
|
||||
|
||||
/* transform manipulator info */
|
||||
char twtype, _pad5, twflag;
|
||||
char _pad5[2], mpr_flag;
|
||||
|
||||
short flag3;
|
||||
|
||||
@@ -450,9 +450,13 @@ enum {
|
||||
#define V3D_MANIP_CURSOR 5
|
||||
#define V3D_MANIP_CUSTOM 1024
|
||||
|
||||
/* View3d->twflag (also) */
|
||||
/* View3d.mpr_flag (also) */
|
||||
enum {
|
||||
V3D_MANIPULATOR_DRAW = (1 << 0),
|
||||
/** All manipulators. */
|
||||
V3D_MANIPULATOR_HIDE = (1 << 0),
|
||||
V3D_MANIPULATOR_HIDE_NAVIGATE = (1 << 1),
|
||||
V3D_MANIPULATOR_HIDE_CONTEXT = (1 << 2),
|
||||
V3D_MANIPULATOR_HIDE_TOOL = (1 << 3),
|
||||
};
|
||||
|
||||
#define RV3D_CAMZOOM_MIN -30
|
||||
|
||||
@@ -2926,8 +2926,23 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_MANIPULATOR_DRAW);
|
||||
RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE);
|
||||
RNA_def_property_ui_text(prop, "Manipulator", "Show manipulators of all types");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "show_manipulator_navigate", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_NAVIGATE);
|
||||
RNA_def_property_ui_text(prop, "Navigate Manipulator", "");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "show_manipulator_context", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_CONTEXT);
|
||||
RNA_def_property_ui_text(prop, "Context Manipulator", "Context sensitive manipulators for the active item");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "show_manipulator_tool", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_TOOL);
|
||||
RNA_def_property_ui_text(prop, "Tool Manipulator", "Active tool manipulator");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
|
||||
|
||||
@@ -165,36 +165,6 @@ static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene
|
||||
UI_reinit_font();
|
||||
}
|
||||
|
||||
static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
UserDef *userdef = (UserDef *)ptr->data;
|
||||
|
||||
/* lame, loop over all views and set */
|
||||
bScreen *sc;
|
||||
ScrArea *sa;
|
||||
SpaceLink *sl;
|
||||
|
||||
/* from scene copy to the other views */
|
||||
for (sc = bmain->screen.first; sc; sc = sc->id.next) {
|
||||
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
||||
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
||||
if (sl->spacetype == SPACE_VIEW3D) {
|
||||
View3D *v3d = (View3D *)sl;
|
||||
if (userdef->manipulator_flag & USER_MANIPULATOR_DRAW) {
|
||||
v3d->twflag |= V3D_MANIPULATOR_DRAW;
|
||||
}
|
||||
else {
|
||||
v3d->twflag &= ~V3D_MANIPULATOR_DRAW;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rna_userdef_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
|
||||
static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
UserDef *userdef = (UserDef *)ptr->data;
|
||||
@@ -3733,10 +3703,17 @@ static void rna_def_userdef_view(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
|
||||
|
||||
/* mini axis */
|
||||
prop = RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
|
||||
RNA_def_property_ui_text(prop, "Show Mini Axes",
|
||||
"Show a small rotating 3D axes in the bottom left corner of the 3D View");
|
||||
static const EnumPropertyItem mini_axis_type_items[] = {
|
||||
{0, "MINIMAL", 0, "Simple Axis", ""},
|
||||
{USER_SHOW_MANIPULATOR_AXIS, "MANIPULATOR", 0, "Interactive Navigation", ""},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
prop = RNA_def_property(srna, "mini_axis_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, mini_axis_type_items);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
|
||||
RNA_def_property_ui_text(prop, "Mini Axes Type",
|
||||
"Show a small rotating 3D axes in the top right corner of the 3D View");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
||||
|
||||
prop = RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
|
||||
@@ -3764,21 +3741,8 @@ static void rna_def_userdef_view(BlenderRNA *brna)
|
||||
/* 3D transform widget */
|
||||
prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW);
|
||||
RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update");
|
||||
|
||||
prop = RNA_def_property(srna, "show_manipulator_navigate", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW_NAVIGATE);
|
||||
RNA_def_property_ui_text(prop, "Navigate Manipulator", "Use 3D navigation manipulator");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update");
|
||||
|
||||
/* TODO, expose once it's working. */
|
||||
#if 0
|
||||
prop = RNA_def_property(srna, "show_manipulator_shaded", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_SHADED);
|
||||
RNA_def_property_ui_text(prop, "Manipulator Shaded", "Use 3D transform manipulator");
|
||||
RNA_def_property_ui_text(prop, "Manipulators", "Use transform manipulators by default");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
||||
#endif
|
||||
|
||||
prop = RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_PIXEL);
|
||||
RNA_def_property_int_sdna(prop, NULL, "manipulator_size");
|
||||
|
||||
Reference in New Issue
Block a user