Recent pydriver update missed setting 'curval'
Using PyObject's for drivers (82b0a9e36) still needs to set the 'current value'
for debug info to display in the UI.
Resolves T48251
This commit is contained in:
@@ -273,6 +273,22 @@ float BPY_driver_exec(ChannelDriver *driver, const float evaltime)
|
||||
|
||||
if (driver_arg == NULL) {
|
||||
driver_arg = PyFloat_FromDouble(0.0);
|
||||
dvar->curval = 0.0f;
|
||||
}
|
||||
else {
|
||||
/* no need to worry about overflow here, values from RNA are within limits. */
|
||||
if (PyFloat_CheckExact(driver_arg)) {
|
||||
dvar->curval = (float)PyFloat_AsDouble(driver_arg);
|
||||
}
|
||||
else if (PyLong_CheckExact(driver_arg)) {
|
||||
dvar->curval = (float)PyLong_AsLong(driver_arg);
|
||||
}
|
||||
else if (PyBool_Check(driver_arg)) {
|
||||
dvar->curval = (driver_arg == Py_True);
|
||||
}
|
||||
else {
|
||||
dvar->curval = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user