diff options
-rw-r--r-- | source/blender/makesrna/intern/rna_armature.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index ba93f27e5a3..b6d07d079f1 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -234,15 +234,23 @@ static void rna_Armature_layer_set(PointerRNA *ptr, const int *values) static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value) { bArmature *data = (bArmature*)ptr->data; - CLAMP(value, 1, data->ghostef); + CLAMP(value, 1, (int)(MAXFRAMEF/2)); data->ghostsf = value; + + if (data->ghostsf >= data->ghostef) { + data->ghostef = MIN2(data->ghostsf + 1, (int)(MAXFRAMEF/2)); + } } static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value) { bArmature *data = (bArmature*)ptr->data; - CLAMP(value, data->ghostsf, (int)(MAXFRAMEF/2)); + CLAMP(value, 1, (int)(MAXFRAMEF/2)); data->ghostef = value; + + if (data->ghostsf >= data->ghostef) { + data->ghostsf = MAX2(data->ghostef - 1, 1); + } } /* XXX depreceated... old armature only animviz */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 4c4123b2ed3..2305ff770a3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -466,15 +466,23 @@ static void rna_Scene_start_frame_set(PointerRNA *ptr, int value) { Scene *data = (Scene*)ptr->data; /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */ - CLAMP(value, MINFRAME, data->r.efra); + CLAMP(value, MINFRAME, MAXFRAME); data->r.sfra = value; + + if (data->r.sfra >= data->r.efra) { + data->r.efra = MIN2(data->r.sfra + 1, MAXFRAME); + } } static void rna_Scene_end_frame_set(PointerRNA *ptr, int value) { Scene *data = (Scene*)ptr->data; - CLAMP(value, data->r.sfra, MAXFRAME); + CLAMP(value, MINFRAME, MAXFRAME); data->r.efra = value; + + if (data->r.sfra >= data->r.efra) { + data->r.sfra = MAX2(data->r.efra - 1, MINFRAME); + } } static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value) |