[Bf-python] Patch for Ipocurve
Ken Hughes
khughes at pacific.edu
Fri Mar 4 07:40:59 CET 2005
While I'm waiting for someone to respond to my earlier proposals.....
Here's a patch which correctly prints the name of the Ipocurve object
instead of random garbage. So if you have an object with an IPO curve
and you run this script:
import Blender
print Blender.Ipo.Get('ObIpo').getCurve('LocX')
you get:
[IpoCurve "LocX"]
instead of
IpoCurve H(�@
Ken
-------------------------------
Index: blender/source/blender/python/api2_2x/Ipocurve.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Ipocurve.c,v
retrieving revision 1.21
diff -u -u -r1.21 Ipocurve.c
--- blender/source/blender/python/api2_2x/Ipocurve.c 30 Nov 2004 02:27:46 -0000 1.21
+++ blender/source/blender/python/api2_2x/Ipocurve.c 4 Mar 2005 06:25:53 -0000
@@ -468,10 +468,9 @@
/*****************************************************************************/
static PyObject *IpoCurveRepr( C_IpoCurve * self )
{
- void GetIpoCurveName( IpoCurve * icu, char *s );
- char s[100], s1[100];
- GetIpoCurveName( self->ipocurve, s1 );
- sprintf( s, "IpoCurve %s \n", s1 );
+ char * GetIpoCurveName( IpoCurve * icu );
+ char s[100];
+ sprintf( s, "[IpoCurve \"%s\"]\n", GetIpoCurveName( self->ipocurve) );
return PyString_FromString( s );
}
More information about the Bf-python
mailing list