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:
authorFalk David <falkdavid@gmx.de>2020-11-12 19:21:19 +0300
committerFalk David <falkdavid@gmx.de>2020-11-12 19:21:19 +0300
commitfe808ca8a0931673720ff3999e3c003d83fba685 (patch)
tree39b8fe817dbbff23161c64a600b7d2e7e3bfab09 /source/blender/makesrna
parent7a31486571e0a10f6944ea00aab86a48f09e7126 (diff)
parentb9bd47c2e256b1e78b385fbe610c8dacc1e981e2 (diff)
Merge branch 'master' into greasepencil-edit-curve
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_define.c2
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c33
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/makesrna/intern/rna_render.c1
4 files changed, 36 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index b437e60ecf9..1b0a2fca0ce 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -1303,7 +1303,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
rna_addtail(&dcont->properties, dprop);
}
else {
-#ifdef DEBUG
+#ifndef NDEBUG
char error[512];
if (rna_validate_identifier(identifier, error, true) == 0) {
CLOG_ERROR(&LOG,
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 1c5e3688312..38328628f11 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -463,6 +463,27 @@ static void rna_FKeyframe_ctrlpoint_set(PointerRNA *ptr, const float *values)
bezt->vec[1][1] = values[1];
}
+static void rna_FKeyframe_ctrlpoint_ui_set(PointerRNA *ptr, const float *values)
+{
+ BezTriple *bezt = (BezTriple *)ptr->data;
+
+ const float frame_delta = values[0] - bezt->vec[1][0];
+ const float value_delta = values[1] - bezt->vec[1][1];
+
+ /** To match the behavior of transforming the keyframe Co using the Graph Editor
+ * (transform_convert_graph.c) flushTransGraphData(), we will also move the handles by
+ * the same amount as the Co delta. */
+
+ bezt->vec[0][0] += frame_delta;
+ bezt->vec[0][1] += value_delta;
+
+ bezt->vec[1][0] = values[0];
+ bezt->vec[1][1] = values[1];
+
+ bezt->vec[2][0] += frame_delta;
+ bezt->vec[2][1] += value_delta;
+}
+
/* ****************************** */
static void rna_FCurve_RnaPath_get(PointerRNA *ptr, char *value)
@@ -2099,6 +2120,18 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_Keyframe_update");
prop = RNA_def_property(
+ srna, "co_ui", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_funcs(
+ prop, "rna_FKeyframe_ctrlpoint_get", "rna_FKeyframe_ctrlpoint_ui_set", NULL);
+ RNA_def_property_ui_text(
+ prop,
+ "Control Point",
+ "Coordinates of the control point. Note: Changing this value also updates the handles "
+ "similar to using the graph editor transform operator");
+ RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_Keyframe_update");
+
+ prop = RNA_def_property(
srna, "handle_right", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index e2b09b1c055..2df42b87c07 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -197,7 +197,7 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
"WELD",
ICON_AUTOMERGE_OFF,
"Weld",
- "Find groups of vertices closer than dist and merges them together"},
+ "Find groups of vertices closer than dist and merge them together"},
{eModifierType_Wireframe,
"WIREFRAME",
ICON_MOD_WIREFRAME,
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index 05b3b0b0c70..1aa5f0ca675 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -298,6 +298,7 @@ static void rna_RenderEngine_unregister(Main *bmain, StructRNA *type)
return;
}
+ RE_FreeAllPersistentData();
RNA_struct_free_extension(type, &et->rna_ext);
RNA_struct_free(&BLENDER_RNA, type);
BLI_freelinkN(&R_engines, et);