diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-05-09 02:11:00 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-05-09 02:11:00 +0400 |
commit | 94cd746566eac365605813f0b7b9a5ed93eec271 (patch) | |
tree | 769ac60011f3058b1e0cc4810af1497a342fd676 /source/blender/makesrna/intern/rna_actuator.c | |
parent | 5be1fd3592d78c21cafd86cfff69bd23578d77d9 (diff) |
Logic UI - lookup for properties (matt need your help to finish it)
I based this code on drawnode, so I hope this is the right way of doing this.
Working Sensors:
- keyboard
- property
Working Actuators:
- property (partly)
- ipo
- action
- shape action
- message
- random
Need help with:
- actuator sensor
- property actuator (for the second object)
- touch/ray/collision sensors + constraint actuator
(for the material lookup, not the property one)
maybe a doversion + changing the type to material work better here
(as we have in touch sensor)
+ added notifier for the game property.
Diffstat (limited to 'source/blender/makesrna/intern/rna_actuator.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index cc1cd9b1e1d..43b09c84a12 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -383,8 +383,6 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *fre if (ob->type==OB_ARMATURE) { RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE); - } else { - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SHAPEACTION); } } @@ -400,6 +398,13 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *fre RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PROPERTY); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_RANDOM); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SCENE); + + if (ob != NULL) { + if (ob->type==OB_MESH){ + RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SHAPEACTION); + } + } + RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY); @@ -936,8 +941,7 @@ static void rna_def_property_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mode", ""); RNA_def_property_update(prop, NC_LOGIC, NULL); - //XXX add magic property lookup - prop= RNA_def_property(srna, "prop_name", PROP_STRING, PROP_NONE); + prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Property", "The name of the property"); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -955,7 +959,7 @@ static void rna_def_property_actuator(BlenderRNA *brna) RNA_def_property_update(prop, NC_LOGIC, NULL); //XXX add even magic'er property lookup (need to look for the property list of the target object) - prop= RNA_def_property(srna, "object_prop_name", PROP_STRING, PROP_NONE); + prop= RNA_def_property(srna, "object_property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "value"); RNA_def_property_ui_text(prop, "Property Name", "Copy this property"); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -1340,7 +1344,6 @@ static void rna_def_random_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Seed", "Initial seed of the random generator. Use Python for more freedom (choose 0 for not random)"); RNA_def_property_update(prop, NC_LOGIC, NULL); - //XXX add magic property lookup prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "propname"); RNA_def_property_ui_text(prop, "Property", "Assign the random value to this property"); @@ -1464,7 +1467,7 @@ static void rna_def_message_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "bodyType"); RNA_def_property_enum_items(prop, prop_body_type_items); - RNA_def_property_ui_text(prop, "Body Type", "Toggle message type: either Text or a PropertyName"); + RNA_def_property_ui_text(prop, "Body", "Toggle message type: either Text or a PropertyName"); /* ACT_MESG_MESG */ prop= RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE); |