BGE: frame start/end in action/fcurves/shapekey to support floats
after discussion over the mailing-list it seems that it really makes no sense to restrict that. Specially since we have the "Property" playback mode that usually will be a float. Since there is no need for do_version or whatoever I don't see a problem. Any Thoughts? Maube to allow it only through the Python API?
This commit is contained in:
parent
4612034cf4
commit
8fd81ab9e6
|
@ -2030,8 +2030,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
|||
}
|
||||
else
|
||||
{
|
||||
uiDefButI(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame");
|
||||
uiDefButI(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame");
|
||||
uiDefButF(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame");
|
||||
uiDefButF(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame");
|
||||
}
|
||||
|
||||
uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending");
|
||||
|
@ -2092,11 +2092,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
|||
"Use this property to define the Ipo position");
|
||||
}
|
||||
else {
|
||||
uiDefButI(block, NUM, 0,
|
||||
uiDefButF(block, NUM, 0,
|
||||
"Sta", xco+10, yco-44, (width-80)/2, 19,
|
||||
&ia->sta, 1.0, MAXFRAMEF, 0, 0,
|
||||
"Start frame");
|
||||
uiDefButI(block, NUM, 0,
|
||||
uiDefButF(block, NUM, 0,
|
||||
"End", xco+10+(width-80)/2, yco-44, (width-80)/2, 19,
|
||||
&ia->end, 1.0, MAXFRAMEF, 0, 0,
|
||||
"End frame");
|
||||
|
|
|
@ -48,7 +48,7 @@ typedef struct bAddObjectActuator {
|
|||
typedef struct bActionActuator {
|
||||
struct bAction *act; /* Pointer to action */
|
||||
short type, flag; /* Playback type */ // not in use
|
||||
int sta, end; /* Start & End frames */
|
||||
float sta, end; /* Start & End frames */
|
||||
char name[32]; /* For property-driven playback */
|
||||
char frameProp[32]; /* Set this property to the actions current frame */
|
||||
short blendin; /* Number of frames of blending */
|
||||
|
@ -119,7 +119,7 @@ typedef struct bObjectActuator {
|
|||
|
||||
typedef struct bIpoActuator {
|
||||
short flag, type;
|
||||
int sta, end;
|
||||
float sta, end;
|
||||
char name[32];
|
||||
char frameProp[32]; /* Set this property to the actions current frame */
|
||||
|
||||
|
|
|
@ -587,15 +587,15 @@ static void rna_def_action_actuator(BlenderRNA *brna)
|
|||
RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "sta");
|
||||
RNA_def_property_range(prop, 0, MAXFRAME);
|
||||
prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "sta");
|
||||
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
|
||||
RNA_def_property_ui_text(prop, "Start Frame", "");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "end");
|
||||
RNA_def_property_range(prop, 0, MAXFRAME);
|
||||
prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "end");
|
||||
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
|
||||
RNA_def_property_ui_text(prop, "End Frame", "");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
|
@ -834,15 +834,15 @@ static void rna_def_fcurve_actuator(BlenderRNA *brna)
|
|||
RNA_def_property_ui_text(prop, "F-Curve Type", "Specify the way you want to play the animation");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "sta");
|
||||
RNA_def_property_ui_range(prop, 1, MAXFRAME, 1, 1);
|
||||
prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "sta");
|
||||
RNA_def_property_ui_range(prop, 1.0, MAXFRAME, 100, 2);
|
||||
RNA_def_property_ui_text(prop, "Start Frame", "");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "end");
|
||||
RNA_def_property_ui_range(prop, 1, MAXFRAME, 1, 1);
|
||||
prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "end");
|
||||
RNA_def_property_ui_range(prop, 1.0, MAXFRAME, 100, 2);
|
||||
RNA_def_property_ui_text(prop, "End Frame", "");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
|
@ -1816,15 +1816,15 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
|
|||
RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "sta");
|
||||
RNA_def_property_range(prop, 0, MAXFRAME);
|
||||
prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "sta");
|
||||
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
|
||||
RNA_def_property_ui_text(prop, "Start Frame", "");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "end");
|
||||
RNA_def_property_range(prop, 0, MAXFRAME);
|
||||
prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "end");
|
||||
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
|
||||
RNA_def_property_ui_text(prop, "End Frame", "");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
|
|
|
@ -456,16 +456,16 @@ PyAttributeDef KX_IpoActuator::Attributes[] = {
|
|||
PyObject* KX_IpoActuator::pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v);
|
||||
return PyLong_FromDouble(self->m_startframe);
|
||||
return PyFloat_FromDouble(self->m_startframe);
|
||||
}
|
||||
|
||||
int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
|
||||
{
|
||||
KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v);
|
||||
float param = PyLong_AsDouble(value);
|
||||
float param = PyFloat_AsDouble(value);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_AttributeError, "frameStart = integer: KX_IpoActuator, expected an integer value");
|
||||
PyErr_SetString(PyExc_AttributeError, "frameStart = float: KX_IpoActuator, expected a float value");
|
||||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
|
@ -477,16 +477,16 @@ int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
PyObject* KX_IpoActuator::pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v);
|
||||
return PyLong_FromDouble(self->m_endframe);
|
||||
return PyFloat_FromDouble(self->m_endframe);
|
||||
}
|
||||
|
||||
int KX_IpoActuator::pyattr_set_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
|
||||
{
|
||||
KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v);
|
||||
float param = PyLong_AsDouble(value);
|
||||
float param = PyFloat_AsDouble(value);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_AttributeError, "frameEnd = integer: KX_IpoActuator, expected an integer value");
|
||||
PyErr_SetString(PyExc_AttributeError, "frameEnd = float: KX_IpoActuator, expected a float value");
|
||||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue