diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-01 05:22:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-01 05:22:20 +0300 |
commit | 8bbcef4c7a377045f6b93580efda93eb4adf800d (patch) | |
tree | e4ff972671a5ea9817b45b0720fd82ef9d722c9a /source/blender | |
parent | f1e10b093582fdb3370becc89ea25cfd0948f11d (diff) |
bugfix [#24449] User Preferences - Interface - Manipulator
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 34 |
2 files changed, 33 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 77f6e63e860..22143db7769 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -206,6 +206,7 @@ static SpaceLink *view3d_new(const bContext *C) v3d->near= 0.01f; v3d->far= 500.0f; + v3d->twflag |= U.tw_flag & V3D_USE_MANIPULATOR; v3d->twtype= V3D_MANIP_TRANSLATE; v3d->around= V3D_CENTROID; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b00afa73ca9..161ce2e198c 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -33,6 +33,7 @@ #include "DNA_space_types.h" #include "DNA_userdef_types.h" #include "DNA_brush_types.h" +#include "DNA_view3d_types.h" #include "WM_api.h" #include "WM_types.h" @@ -47,6 +48,7 @@ #include "BKE_DerivedMesh.h" #include "BKE_depsgraph.h" #include "DNA_object_types.h" +#include "DNA_screen_types.h" #include "GPU_draw.h" #include "BKE_global.h" @@ -58,6 +60,34 @@ static void rna_userdef_update(Main *bmain, Scene *scene, PointerRNA *ptr) WM_main_add_notifier(NC_WINDOW, NULL); } +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->tw_flag & V3D_USE_MANIPULATOR) + v3d->twflag |= V3D_USE_MANIPULATOR; + else + v3d->twflag &= ~V3D_USE_MANIPULATOR; + } + } + } + } + + rna_userdef_update(bmain, scene, ptr); +} + + static void rna_userdef_script_autoexec_update(Main *bmain, Scene *scene, PointerRNA *ptr) { UserDef *userdef = (UserDef*)ptr->data; @@ -2008,9 +2038,9 @@ 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, "tw_flag", 1); + RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", V3D_USE_MANIPULATOR); RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); + RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update"); prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_size"); |