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:
Diffstat (limited to 'source/blender/editors/space_view3d/drawanimviz.c')
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index ca5b21012aa..f8d942b4fd1 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -88,38 +88,50 @@ void draw_motion_path_instance(Scene *scene,
//RegionView3D *rv3d= ar->regiondata;
bMotionPathVert *mpv, *mpv_start;
int i, stepsize = avs->path_step;
- int sfra, efra, len;
-
+ int sfra, efra, sind, len;
/* get frame ranges */
if (avs->path_type == MOTIONPATH_TYPE_ACFRA) {
- int sind;
-
/* With "Around Current", we only choose frames from around
- * the current frame to draw. However, this range is still
- * restricted by the limits of the original path.
+ * the current frame to draw.
*/
sfra = CFRA - avs->path_bc;
efra = CFRA + avs->path_ac;
- if (sfra < mpath->start_frame) sfra = mpath->start_frame;
- if (efra > mpath->end_frame) efra = mpath->end_frame;
-
- len = efra - sfra;
-
- sind = sfra - mpath->start_frame;
- mpv_start = (mpath->points + sind);
}
else {
+ /* Use the current display range */
+ sfra = avs->path_sf;
+ efra = avs->path_ef;
+ }
+
+ /* no matter what, we can only show what is in the cache and no more
+ * - abort if whole range is past ends of path
+ * - otherwise clamp endpoints to extents of path
+ */
+ if ((sfra > mpath->end_frame) || (efra < mpath->start_frame)) {
+ /* whole path is out of bounds */
+ return;
+ }
+
+ if (sfra < mpath->start_frame) {
+ /* start clamp */
sfra = mpath->start_frame;
- efra = sfra + mpath->length;
- len = mpath->length;
- mpv_start = mpath->points;
}
-
+ if (efra > mpath->end_frame) {
+ /* end clamp */
+ efra = mpath->end_frame;
+ }
+
+ len = efra - sfra;
+
if (len <= 0) {
return;
}
-
+
+ /* get pointers to parts of path */
+ sind = sfra - mpath->start_frame;
+ mpv_start = (mpath->points + sind);
+
/* draw curve-line of path */
glShadeModel(GL_SMOOTH);
@@ -258,7 +270,7 @@ void draw_motion_path_instance(Scene *scene,
* unless an option is set to always use the whole action
*/
if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT) == 0) {
- bActionGroup *agrp = action_groups_find_named(adt->action, pchan->name);
+ bActionGroup *agrp = BKE_action_group_find_name(adt->action, pchan->name);
if (agrp) {
agroup_to_keylist(adt, agrp, &keys, NULL);