[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24980] trunk/blender/source/blender/ makesrna/intern: - color updating is not working when changing userpefs, added some commented out lines that works when the view in the same window as the userprefs , probably needs a new notifier.

Campbell Barton ideasman42 at gmail.com
Sat Nov 28 20:32:24 CET 2009


Revision: 24980
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24980
Author:   campbellbarton
Date:     2009-11-28 20:32:23 +0100 (Sat, 28 Nov 2009)

Log Message:
-----------
- color updating is not working when changing userpefs, added some commented out lines that works when the view in the same window as the userprefs, probably needs a new notifier.
- fix for warning

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

Modified: trunk/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object.c	2009-11-28 18:37:56 UTC (rev 24979)
+++ trunk/blender/source/blender/makesrna/intern/rna_object.c	2009-11-28 19:32:23 UTC (rev 24980)
@@ -964,7 +964,7 @@
 
 static void rna_Object_modifier_remove(Object *object, bContext *C, ReportList *reports, ModifierData *md)
 {
-	return ED_object_modifier_remove(reports, CTX_data_scene(C), object, md);
+	ED_object_modifier_remove(reports, CTX_data_scene(C), object, md);
 }
 
 #else

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2009-11-28 18:37:56 UTC (rev 24979)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2009-11-28 19:32:23 UTC (rev 24980)
@@ -46,6 +46,7 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_depsgraph.h"
 #include "DNA_object_types.h"
+// #include "GPU_draw.h"
 
 static void rna_userdef_update(bContext *C, PointerRNA *ptr)
 {
@@ -151,6 +152,15 @@
 	rna_userdef_update(C, ptr);
 }
 
+// XXX - todo, this is not accessible from here and it only works when the userprefs are in the same window.
+// extern int GPU_default_lights(void);
+static void rna_UserDef_viewport_lights_update(bContext *C, PointerRNA *ptr)
+{
+	// GPU_default_lights();
+	WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+	rna_userdef_update(C, ptr);
+}
+
 static void rna_userdef_autosave_update(bContext *C, PointerRNA *ptr)
 {
 	WM_autosave_init(C);
@@ -1596,21 +1606,25 @@
 	prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
 	RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode.");
+	RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
 
 	prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
 	RNA_def_property_float_sdna(prop, NULL, "vec");
 	RNA_def_property_array(prop, 3);
 	RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining.");
+	RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
 
 	prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
 	RNA_def_property_float_sdna(prop, NULL, "col");
 	RNA_def_property_array(prop, 3);
 	RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light.");
+	RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
 
 	prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
 	RNA_def_property_float_sdna(prop, NULL, "spec");
 	RNA_def_property_array(prop, 3);
 	RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight.");
+	RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
 }
 
 static void rna_def_userdef_view(BlenderRNA *brna)





More information about the Bf-blender-cvs mailing list