Fix T52213: Enum drivers no longer work
Regression in D1812: PyDriver variables as Objects Taking the Python representation is nice in general but for enums it would convert them into strings, breaking some existing drivers.
This commit is contained in:
@@ -63,7 +63,15 @@ PyObject *pyrna_driver_get_variable_value(
|
||||
}
|
||||
else {
|
||||
/* object & property */
|
||||
driver_arg = pyrna_prop_to_py(&ptr, prop);
|
||||
PropertyType type = RNA_property_type(prop);
|
||||
if (type == PROP_ENUM) {
|
||||
/* Note that enum's are converted to strings by default,
|
||||
* we want to avoid that, see: T52213 */
|
||||
driver_arg = PyLong_FromLong(RNA_property_enum_get(&ptr, prop));
|
||||
}
|
||||
else {
|
||||
driver_arg = pyrna_prop_to_py(&ptr, prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user