Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2010-05-07 05:30:12 +0400
committerDalai Felinto <dfelinto@gmail.com>2010-05-07 05:30:12 +0400
commit97687969266c5df6ec0d797692dd13576db4bf70 (patch)
treedb11b90e94767a97431f490a8cd7905b0d81ac48 /source/blender/makesrna/intern/rna_actuator.c
parent05e2e92611970689cd224715f594b817c69beae0 (diff)
Logic UI: State Actuator done :) all actuators are there now. [and stubs update]
(it's a small commit, but couldn't help not doing it ;)
Diffstat (limited to 'source/blender/makesrna/intern/rna_actuator.c')
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index ab2999129c0..ff735d35ade 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -131,6 +131,27 @@ static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, f
oa->forcerot[0] = 60.0f*oa->forcerot[1];
}
+static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bStateActuator *sa = act->data;
+
+ int i, tot= 0;
+
+ /* ensure we always have some state selected */
+ for(i=0; i<OB_MAX_STATES; i++)
+ if(values[i])
+ tot++;
+
+ if(tot==0)
+ return;
+
+ for(i=0; i<OB_MAX_STATES; i++) {
+ if(values[i]) sa->mask |= (1<<i);
+ else sa->mask &= ~(1<<i);
+ }
+}
+
static EnumPropertyItem *rna_EditObjectActuator_mode_itemf(bContext *C, PointerRNA *ptr, int *free)
{
EnumPropertyItem *item= NULL;
@@ -1597,14 +1618,11 @@ static void rna_def_state_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Operation", "Select the bit operation on object state mask");
RNA_def_property_update(prop, NC_LOGIC, NULL);
-/*
- XXX mask needs a template or to use RNA layer type
- prop= RNA_def_property(srna, "mask", PROP_BOOLEAN, PROP_LAYER);
- RNA_def_property_array(prop, 20);
-*/
- prop= RNA_def_property(srna, "mask", PROP_INT, PROP_NONE);
- RNA_def_property_ui_text(prop, "Mask", "");
- RNA_def_property_update(prop, NC_LOGIC, NULL);
+ prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ RNA_def_property_boolean_sdna(prop, NULL, "mask", 1);
+ RNA_def_property_array(prop, OB_MAX_STATES);
+ RNA_def_property_ui_text(prop, "State", "");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_StateActuator_state_set");
}
static void rna_def_armature_actuator(BlenderRNA *brna)