[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/python/api2_2x Draw.c Draw.h blender/source/blender/python/api2_2x/doc Draw.py

Ken Hughes khughes at pacific.edu
Sun May 21 08:04:37 CEST 2006


Campbell Barton wrote:
> Hey Martin,
> theres a realy weired problem with this function.
> 
> Now this raises an error.
>  Draw.Create(0.0)
> TypeError: argument 1 must be 3-item sequence, not int
> 
> 
> Its odd because even though theres only 1 floatng point the line below 
> is running. - did a printf test.
> Even stranger is that even if this is below the other IF's it gets run...
> 
>    but = newbutton();
>    if ( PyArg_ParseTuple( args, "fff", but->val.asvec, but->val.asvec+1, 
> but->val.asvec+2 ) ) {
>        but->type = BVECTOR_TYPE;
>    }

I don't think you can use PyArg_ParseTuple() like this (in a series of 
"if" statements, as in Method_Create); whenever it fails "it returns 
false and raises the appropriate exception", so even if the first one 
fails and the second one succeeds, there's an error exception set 
somewhere which you need to get rid of.

Ken


More information about the Bf-committers mailing list