[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28776] trunk/blender/source/blender/ makesrna/intern: Logic UI: setting all State temporarly to 1 when clicking in ALL (so it' s more informative I think)

Dalai Felinto dfelinto at gmail.com
Sat May 15 01:09:55 CEST 2010


Revision: 28776
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28776
Author:   dfelinto
Date:     2010-05-15 01:09:55 +0200 (Sat, 15 May 2010)

Log Message:
-----------
Logic UI: setting all State temporarly to 1 when clicking in ALL (so it's more informative I think)

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

Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-05-14 22:54:37 UTC (rev 28775)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-05-14 23:09:55 UTC (rev 28776)
@@ -1834,7 +1834,7 @@
 	RNA_def_property_ui_text(prop, "Secondary Target", "Set weight of this constraint");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_PERCENTAGE);
+	prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "weight");
 	RNA_def_property_range(prop, 0.0, 1.0);
 	RNA_def_property_ui_text(prop, "Weight", "Set weight of this constraint");

Modified: trunk/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object.c	2010-05-14 22:54:37 UTC (rev 28775)
+++ trunk/blender/source/blender/makesrna/intern/rna_object.c	2010-05-14 23:09:55 UTC (rev 28776)
@@ -859,6 +859,17 @@
 	/* rna_Base_layer_update updates the objects layer */
 }
 
+static void rna_GameObjectSettings_state_get(PointerRNA *ptr, int *values)
+{
+	Object *ob= (Object*)ptr->data;
+	int i;
+	int all_states = (ob->scaflag & OB_ALLSTATE?1:0);
+
+	memset(values, 0, sizeof(int)*OB_MAX_STATES);
+	for(i=0; i<OB_MAX_STATES; i++)
+		values[i] = (ob->state & (1<<i)) | all_states;
+}
+
 static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values)
 {
 	Object *ob= (Object*)ptr->data;
@@ -1257,7 +1268,7 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
 	RNA_def_property_array(prop, OB_MAX_STATES);
 	RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed");
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_GameObjectSettings_state_set");
+	RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_state_get", "rna_GameObjectSettings_state_set");
 
 	prop= RNA_def_property(srna, "used_state", PROP_BOOLEAN, PROP_LAYER_MEMBER);
 	RNA_def_property_array(prop, OB_MAX_STATES);





More information about the Bf-blender-cvs mailing list