[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32806] trunk/blender/source/blender: bugfix [#24449] User Preferences - Interface - Manipulator

Campbell Barton ideasman42 at gmail.com
Mon Nov 1 03:22:28 CET 2010


Revision: 32806
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32806
Author:   campbellbarton
Date:     2010-11-01 03:22:20 +0100 (Mon, 01 Nov 2010)

Log Message:
-----------
bugfix [#24449] User Preferences - Interface - Manipulator

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/space_view3d.c
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2010-11-01 01:53:24 UTC (rev 32805)
+++ trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2010-11-01 02:22:20 UTC (rev 32806)
@@ -206,6 +206,7 @@
 	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;
 	

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2010-11-01 01:53:24 UTC (rev 32805)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2010-11-01 02:22:20 UTC (rev 32806)
@@ -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 @@
 	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 @@
 
 	/* 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");





More information about the Bf-blender-cvs mailing list