[Bf-blender-cvs] [40d71fc6428] blender-v2.82-release: Fix T70891: Motion Path - Changing endframe clamps startframe to 1
Sybren A. Stüvel
noreply at git.blender.org
Tue Jan 21 11:53:29 CET 2020
Commit: 40d71fc6428c462ca4d5eb35206baf334072497c
Author: Sybren A. Stüvel
Date: Tue Jan 21 11:52:37 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB40d71fc6428c462ca4d5eb35206baf334072497c
Fix T70891: Motion Path - Changing endframe clamps startframe to 1
There were two strange things going on:
- Start frame was clamped to 1, even when frame 0 is always a valid number.
This also ignored the 'Allow Negative Frames' user preference.
- Start frame was only clamped when setting the end frame, so first setting
the end frame and then the start frame would result in a different result
than doing it in the opposite order.
This commit fixes both issues by:
- Clamping the lower bound of the start frame only if negative frames are
not allowed, and
- apply that clamp both when setting the start and the end frame.
===================================================================
M source/blender/makesrna/intern/rna_animviz.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c
index f539da488ce..61a1f1ffcd5 100644
--- a/source/blender/makesrna/intern/rna_animviz.c
+++ b/source/blender/makesrna/intern/rna_animviz.c
@@ -63,6 +63,8 @@ static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value)
/* XXX: watchit! Path Start > MAXFRAME/2 could be a problem... */
data->path_sf = value;
+ FRAMENUMBER_MIN_CLAMP(data->path_sf);
+
CLAMP(data->path_ef, data->path_sf + 1, MAXFRAME / 2);
}
@@ -71,7 +73,11 @@ static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value)
bAnimVizSettings *data = (bAnimVizSettings *)ptr->data;
data->path_ef = value;
- CLAMP(data->path_sf, 1, data->path_ef - 1);
+ CLAMP_MAX(data->path_sf, data->path_ef - 1);
+ if (U.flag & USER_NONEGFRAMES) {
+ CLAMP_MIN(data->path_sf, 0);
+ CLAMP_MIN(data->path_ef, 1);
+ }
}
#else
More information about the Bf-blender-cvs
mailing list