diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-07 01:42:03 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-07 01:42:03 +0400 |
commit | 7c59666a278d086b10f9e3dd0f13b5009ba30271 (patch) | |
tree | 6b6968967cc504f05820a1bc2beb726725c12f91 | |
parent | 2fd7a56526a356a984e5c03354834bd7ada94014 (diff) |
Mango request: for range buttons copy start+1 to end if start>=0
Also copy end-1 to start if changing end boundary and end<=start.
Scene's start/end frames and ghost range in armature buttons are affected.
-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) |