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:
authorCampbell Barton <ideasman42@gmail.com>2008-05-07 11:57:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-05-07 11:57:18 +0400
commit5e493eeb19572e4c70c1b4a9c283616995f2df8a (patch)
tree6bb2004af6d6ddb0cc2726306daba365bc7c4a17 /source/blender/python/api2_2x/Blender.c
parent4aa8dd0b633983b733d0655d583db8cc628a28ed (diff)
Setting frame in python allowed negative numbers (was casting to a short with no clamping!)
disable capslock option isnt used anywhere.
Diffstat (limited to 'source/blender/python/api2_2x/Blender.c')
-rw-r--r--source/blender/python/api2_2x/Blender.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c
index 7c2895d96be..4fc68d138e0 100644
--- a/source/blender/python/api2_2x/Blender.c
+++ b/source/blender/python/api2_2x/Blender.c
@@ -246,7 +246,8 @@ static PyObject *Blender_Set( PyObject * self, PyObject * args )
return EXPP_ReturnPyObjError( PyExc_ValueError,
"expected an integer" );
- G.scene->r.cfra = (short)PyInt_AsLong( arg ) ;
+ G.scene->r.cfra = (int)PyInt_AsLong( arg ) ;
+ CLAMP(G.scene->r.cfra, 1, MAXFRAME);
/* update all objects, so python scripts can export all objects
in a scene without worrying about the view layers */