Logic UI: setting all State temporarly to 1 when clicking in ALL (so it's more inform...
authorDalai Felinto <dfelinto@gmail.com>
Fri, 14 May 2010 23:09:55 +0000 (23:09 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Fri, 14 May 2010 23:09:55 +0000 (23:09 +0000)
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_object.c

index b3800b2d68d1f5097c9a75c32456d53d49e180e6..5f802fd47f13e7d89b8f168867c983e3323f261a 100644 (file)
@@ -1834,7 +1834,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
        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");
index 95f142d299d837fb227a2c0d69921d208d35d427..93a133bf380249ffb888d73384f20a07b92008ba 100644 (file)
@@ -859,6 +859,17 @@ static void rna_Base_layer_set(PointerRNA *ptr, const int *values)
        /* 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 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
        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);