diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-04-16 07:31:25 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-04-16 07:39:33 +0300 |
commit | 8c98b1649d1cee38faff338414d35c87ee0f8c2a (patch) | |
tree | ed7f4bcdbd84cf81f0d4bd1f649ae762d109cfb2 /source/blender | |
parent | b466a82fa5b3490a13880a92ce00d01057ae21b3 (diff) |
BGE: Fix for T42341 Sensor.frequency is badly named
"Frequency" parameter is renamed to "Skip" in the LogicBricks sensors as it represents skipped frames between pulses.
Naming something (frequency) the exact opposite of what it represents (period) was the worst choice.
Also, a new BGE python attribute 'skippedTicks' was introduced. 'frequency' attribute is maintained but deprecated.
Internally, freq variable is used yet at DNA_Sensor to maintain compability and to avoid do_versions.
Thanks to Sybren for the investigation.
{F162440}
Reviewers: campbellbarton, sybren, moguri, hg1
Reviewed By: sybren, hg1
Differential Revision: https://developer.blender.org/D1229
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sensor_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sensor.c | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 7204144ce85..d4fa911f025 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -903,7 +903,7 @@ static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr) sub = uiLayoutRow(row, false); uiLayoutSetActive(sub, (RNA_boolean_get(ptr, "use_pulse_true_level") || RNA_boolean_get(ptr, "use_pulse_false_level"))); - uiItemR(sub, ptr, "frequency", 0, IFACE_("Freq"), ICON_NONE); + uiItemR(sub, ptr, "skipped_ticks", 0, IFACE_("Skip"), ICON_NONE); row = uiLayoutRow(split, true); uiItemR(row, ptr, "use_level", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index 8d59a13768b..d886dcf2807 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -164,7 +164,7 @@ typedef struct bSensor { struct bSensor *next, *prev; /* pulse and freq are the bool toggle and frame count for pulse mode */ short type, otype, flag, pulse; - short freq, totlinks, pad1, pad2; + short freq, totlinks, pad1, pad2; /* freq makes reference to skipped ticks between 2 active pulses */ char name[64]; /* MAX_NAME */ void *data; diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 69dd0925a42..3cc94039d59 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -325,9 +325,11 @@ static void rna_def_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)"); RNA_def_property_update(prop, NC_LOGIC, NULL); - prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE); + prop = RNA_def_property(srna, "skipped_ticks", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "freq"); - RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated pulses(in logic tics, 0=no delay)"); + RNA_def_property_ui_text(prop, "Skip", + "Number of logic ticks skipped between 2 active pulses " + "(0 = pulse every logic tick, 1 = skip 1 logic tick between pulses, etc.)"); RNA_def_property_range(prop, 0, 10000); RNA_def_property_update(prop, NC_LOGIC, NULL); |