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:
authorWilliam Reynish <william@reynish.com>2010-05-10 04:12:36 +0400
committerWilliam Reynish <william@reynish.com>2010-05-10 04:12:36 +0400
commite8a2059b84c2b4c91a394b0a8933288ee864cbfe (patch)
tree84b50a3e3f25a7f823cd3cbb19249ca0039e02dd /source/blender/makesrna/intern/rna_sensor.c
parent5afb24cedb7e0921b03dbcba5851aa309a475ce5 (diff)
Improved the Ray Sensor UI in the updated Logic Editor.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sensor.c')
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 45a660a0895..801e75816df 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -592,10 +592,21 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
{SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""},
{SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
{0, NULL, 0, NULL, NULL}};
+
+ static const EnumPropertyItem prop_ray_type_items[]= {
+ {0, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"},
+ {SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RaySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object");
RNA_def_struct_sdna_from(srna, "bRaySensor", "data");
+
+ prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_ray_type_items);
+ RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "propname");
@@ -616,11 +627,6 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
*/
- prop= RNA_def_property(srna, "ray_type", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL);
- RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property");
- RNA_def_property_update(prop, NC_LOGIC, NULL);
-
prop= RNA_def_property(srna, "x_ray_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY);
RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property)");