Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-10-22 18:13:19 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-10-22 18:13:19 +0300
commit0628fe7a6cf33bec370a4db53bb9d5980fa40162 (patch)
treea0eb7f542cf5d5d8bce9baf4f892ed2220754659 /source/blender/makesrna/intern/rna_action.c
parent3c655fd37274acff80fbc07dd68d4fc08ce65787 (diff)
Followup to previous change, reduce number of relations updates
Only tag relations update when new f-curve was allocated. This solves possible too slow keyframe insertion when doing character animation, but still does proper relation update when new ID component became animated.
Diffstat (limited to 'source/blender/makesrna/intern/rna_action.c')
-rw-r--r--source/blender/makesrna/intern/rna_action.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index fe4c92b9163..76297320511 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -102,7 +102,7 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, PointerR
RNA_POINTER_INVALIDATE(agrp_ptr);
}
-static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const char *data_path,
+static FCurve *rna_Action_fcurve_new(bAction *act, Main *bmain, ReportList *reports, const char *data_path,
int index, const char *group)
{
if (group && group[0] == '\0') group = NULL;
@@ -113,12 +113,12 @@ static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const ch
}
/* annoying, check if this exists */
- if (verify_fcurve(act, group, NULL, data_path, index, 0)) {
+ if (verify_fcurve(bmain, act, group, NULL, data_path, index, 0)) {
BKE_reportf(reports, RPT_ERROR, "F-Curve '%s[%d]' already exists in action '%s'", data_path,
index, act->id.name + 2);
return NULL;
}
- return verify_fcurve(act, group, NULL, data_path, index, 1);
+ return verify_fcurve(bmain, act, group, NULL, data_path, index, 1);
}
static FCurve *rna_Action_fcurve_find(bAction *act, ReportList *reports, const char *data_path, int index)
@@ -598,7 +598,7 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
/* Action.fcurves.new(...) */
func = RNA_def_function(srna, "new", "rna_Action_fcurve_new");
RNA_def_function_ui_description(func, "Add an F-Curve to the action");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_MAIN);
parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path to use");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);