Drivers Code Cleanups and UI Tweaks:
- Adding drivers from the UI (not from py-scripts though) will now automatically add a "Transform Channel" driver variable to the newly created drivers. This makes setting up drivers a bit more convenient for the most commonly used case. - Drivers now report their errors using the Reports system instead of writing these directly to the console. - Clarified some comments to be more insightful about the "why's" of some design decisions, and related formatting/cleanup tweaks - Reduced scope of "path" vars to just the scope they're required in - Removed some unused defines from a failed experiment in the original Keying Sets code ("templates" and "template flags") which was superseeded by the more flexible + nicer "Builtin KeyingSets"
This commit is contained in:
@@ -2241,7 +2241,7 @@ static PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args)
|
||||
if(pyrna_struct_anim_args_parse(&self->ptr, "bpy_struct.driver_add():", path, &path_full, &index) < 0)
|
||||
return NULL;
|
||||
|
||||
if(ANIM_add_driver((ID *)self->ptr.id.data, path_full, index, 0, DRIVER_TYPE_PYTHON)) {
|
||||
if(ANIM_add_driver(/*ReportList*/NULL, (ID *)self->ptr.id.data, path_full, index, 0, DRIVER_TYPE_PYTHON)) {
|
||||
ID *id= self->ptr.id.data;
|
||||
AnimData *adt= BKE_animdata_from_id(id);
|
||||
FCurve *fcu;
|
||||
@@ -2300,7 +2300,7 @@ static PyObject *pyrna_struct_driver_remove(BPy_StructRNA *self, PyObject *args)
|
||||
if(pyrna_struct_anim_args_parse(&self->ptr, "bpy_struct.driver_remove():", path, &path_full, &index) < 0)
|
||||
return NULL;
|
||||
|
||||
ret= PyBool_FromLong(ANIM_remove_driver((ID *)self->ptr.id.data, path_full, index, 0));
|
||||
ret= PyBool_FromLong(ANIM_remove_driver(/*ReportList*/NULL, (ID *)self->ptr.id.data, path_full, index, 0));
|
||||
|
||||
MEM_freeN(path_full);
|
||||
|
||||
|
Reference in New Issue
Block a user