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-06 01:25:34 +0400
committerDalai Felinto <dfelinto@gmail.com>2010-05-06 01:25:34 +0400
commit09e6190b490213851711ea7356e76142f527a523 (patch)
tree7514a9132bc2bafb5652449bb6dc19a04d755e51 /source/blender
parent0c495ffe10e77c6432960817967cd4ec32e930bf (diff)
BGE Logic UI: 2dfilter actuator + object (motino) actuator + commenting out buggy sensors
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_logic/logic_window.c95
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c52
2 files changed, 123 insertions, 24 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 5f77e571510..b0362cb1980 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -3221,6 +3221,7 @@ static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr)
static void draw_sensor_collision(uiLayout *layout, PointerRNA *ptr)
{
+ uiItemL(layout, "Not ported back yet", 0);
//XXXSENSOR
/* // need to solve problems in rna_sensor.c
uiItemR(layout, ptr, "pulse", 0, NULL, 0);
@@ -3308,8 +3309,6 @@ static void draw_sensor_keyboard(uiLayout *layout, PointerRNA *ptr)
uiItemR(layout, ptr, "target", 0, NULL, 0);
uiItemR(layout, ptr, "log", 0, NULL, 0);
-
- //XXXSENSOR
}
static void draw_sensor_message(uiLayout *layout, PointerRNA *ptr)
@@ -3375,6 +3374,8 @@ static void draw_sensor_random(uiLayout *layout, PointerRNA *ptr)
static void draw_sensor_ray(uiLayout *layout, PointerRNA *ptr)
{
+ uiItemL(layout, "Not ported back yet", 0);
+ /*
uiItemR(layout, ptr, "ray_type", 0, NULL, 0);
switch (RNA_enum_get(ptr, "ray_type")) {
case SENS_RAY_PROPERTY:
@@ -3385,6 +3386,7 @@ static void draw_sensor_ray(uiLayout *layout, PointerRNA *ptr)
uiItemR(layout, ptr, "x_ray_mode", 0, NULL, 0);
uiItemR(layout, ptr, "range", 0, NULL, 0);
uiItemR(layout, ptr, "axis", 0, NULL, 0);
+ */
//XXXSENSOR - same problem as collision. enums badly used by UI code
}
@@ -3576,7 +3578,24 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
static void draw_actuator_filter_2d(uiLayout *layout, PointerRNA *ptr)
{
- //XXXACTUATOR
+ uiLayout *split;
+
+ uiItemR(layout, ptr, "mode", 0, NULL, 0);
+ switch (RNA_enum_get(ptr, "mode"))
+ {
+ case ACT_2DFILTER_CUSTOMFILTER:
+ uiItemR(layout, ptr, "filter_pass", 0, NULL, 0);
+ uiItemR(layout, ptr, "glsl_shader", 0, NULL, 0);
+ break;
+ case ACT_2DFILTER_MOTIONBLUR:
+ split=uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "motion_blur_value", 0, NULL, 0);
+ uiItemR(split, ptr, "enable_motion_blur", UI_ITEM_R_TOGGLE, NULL, 0);
+ break;
+ default: // all other 2D Filters
+ uiItemR(layout, ptr, "filter_pass", 0, NULL, 0);
+ break;
+ }
}
static void draw_actuator_game(uiLayout *layout, PointerRNA *ptr)
@@ -3631,7 +3650,75 @@ static void draw_actuator_message(uiLayout *layout, PointerRNA *ptr)
static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
{
- //XXXACTUATOR
+ uiLayout *split, *row, *col, *subcol;
+ uiItemR(layout, ptr, "mode", 0, NULL, 0);
+
+ switch (RNA_enum_get(ptr, "mode")) {
+ case ACT_OBJECT_NORMAL:
+ split = uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "loc", 0, NULL, 0);
+ uiItemR(split, ptr, "local_location", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "rot", 0, NULL, 0);
+ uiItemR(split, ptr, "local_rotation", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ // Matt, how to check for ob->gameflag here? Do we need to pass the obj through the drawing function only for that?
+// if ((ob->gameflag & OB_DYNAMIC)==0)
+// break;
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "force", 0, NULL, 0);
+ uiItemR(split, ptr, "local_force", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "torque", 0, NULL, 0);
+ uiItemR(split, ptr, "local_torque", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "linear_velocity", 0, NULL, 0);
+ row = uiLayoutRow(split, 0);
+ uiItemR(row, ptr, "local_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+ uiItemR(row, ptr, "add_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "angular_velocity", 0, NULL, 0);
+ uiItemR(split, ptr, "local_angular_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ uiItemR(layout, ptr, "damping", 0, NULL, 0);
+ break;
+ case ACT_OBJECT_SERVO:
+ uiItemR(layout, ptr, "reference_object", 0, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ uiItemR(split, ptr, "linear_velocity", 0, NULL, 0);
+
+ col = uiLayoutColumn(layout, 0);
+ uiItemR(col, ptr, "servo_limit_x", 0, NULL, 0);
+ subcol = uiLayoutColumn(col, 0);
+ uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_x")==1);
+ uiItemR(subcol, ptr, "force_max_x", 0, NULL, 0);
+ uiItemR(subcol, ptr, "force_min_x", 0, NULL, 0);
+
+ col = uiLayoutColumn(layout, 0);
+ uiItemR(col, ptr, "servo_limit_y", 0, NULL, 0);
+ subcol = uiLayoutColumn(col, 0);
+ uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_y")==1);
+ uiItemR(subcol, ptr, "force_max_y", 0, NULL, 0);
+ uiItemR(subcol, ptr, "force_min_y", 0, NULL, 0);
+
+ col = uiLayoutColumn(layout, 0);
+ uiItemR(col, ptr, "servo_limit_z", 0, NULL, 0);
+ subcol = uiLayoutColumn(col, 0);
+ uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_z")==1);
+ uiItemR(subcol, ptr, "force_max_z", 0, NULL, 0);
+ uiItemR(subcol, ptr, "force_min_z", 0, NULL, 0);
+
+ uiItemR(col, ptr, "proportional_coefficient", 0, NULL, 0);
+ uiItemR(col, ptr, "integral_coefficient", 0, NULL, 0);
+ uiItemR(col, ptr, "derivate_coefficient", 0, NULL, 0);
+ break;
+ }
}
static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr)
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index d83b36b7a78..4254f4280f8 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -190,28 +190,43 @@ static void rna_def_object_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- /* XXX We need one of those special get/set functions here:
- int offset
- if (flag & ACT_SERVO_LIMIT_X):
- offset = 0
- elif (flag & ACT_SERVO_LIMIT_Y):
- offset = 1
- elif (flag & ACT_SERVO_LIMIT_Z):
- offset = 2
-
- prop= RNA_def_property(srna, "force_max", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "dloc[offset]");
+ /* Servo Limit */
+ prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force_max", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "drot[offset]");
+ prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "drot[0]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+ RNA_def_property_ui_text(prop, "Max", "Set the lower limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- */
-
+
+ prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "drot[1]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+ RNA_def_property_ui_text(prop, "Max", "Set the lower limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dloc[2]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+ RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "drot[2]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+ RNA_def_property_ui_text(prop, "Max", "Set the lower limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
/* floats 3 Arrays*/
prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dloc");
@@ -1039,11 +1054,8 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- // it must be renamed to enable_motion_blur.
- // it'll require code change and do_version()
- // or RNA_def_property_boolean_funcs() to flip the boolean value
- prop= RNA_def_property(srna, "disable_motion_blur", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
+ prop= RNA_def_property(srna, "enable_motion_blur", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "D", "Enable/Disable Motion Blur");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}