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:
authorJacques Guignot <guignot@wanadoo.fr>2003-07-04 20:06:39 +0400
committerJacques Guignot <guignot@wanadoo.fr>2003-07-04 20:06:39 +0400
commit82e1783dcb9397de1b83dff1186fccc15707531f (patch)
tree159065c0dc14e2a688e498f765bce02317250c95 /source/blender
parent28b8e667a0c2ef77dd862bc40909d089a96d1324 (diff)
Following Willian's proposal,deleted the print function, which caused crashes.
The objects are now printed with the repr function.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/python/api2_2x/Build.c10
-rw-r--r--source/blender/python/api2_2x/Build.h2
-rw-r--r--source/blender/python/api2_2x/Effect.c4
-rw-r--r--source/blender/python/api2_2x/Effect.h4
-rw-r--r--source/blender/python/api2_2x/Ipo.c5
-rw-r--r--source/blender/python/api2_2x/Ipo.h4
-rw-r--r--source/blender/python/api2_2x/Metaball.c7
-rw-r--r--source/blender/python/api2_2x/Metaball.h2
-rw-r--r--source/blender/python/api2_2x/Particle.c7
-rw-r--r--source/blender/python/api2_2x/Particle.h2
-rw-r--r--source/blender/python/api2_2x/World.c6
11 files changed, 28 insertions, 25 deletions
diff --git a/source/blender/python/api2_2x/Build.c b/source/blender/python/api2_2x/Build.c
index 5dc275e5451..915b5b253c8 100644
--- a/source/blender/python/api2_2x/Build.c
+++ b/source/blender/python/api2_2x/Build.c
@@ -44,7 +44,7 @@ PyTypeObject Build_Type =
0, /* tp_itemsize */
/* methods */
(destructor)BuildDeAlloc, /* tp_dealloc */
- (printfunc)BuildPrint, /* tp_print */
+ 0, /* tp_print */
(getattrfunc)BuildGetAttr, /* tp_getattr */
(setattrfunc)BuildSetAttr, /* tp_setattr */
0, /* tp_compare */
@@ -72,7 +72,6 @@ int type = EFF_BUILD;
BPy_Effect *pyeffect;
Effect *bleffect = 0;
- printf ("In Effect_New()\n");
bleffect = add_effect(type);
if (bleffect == NULL)
@@ -104,7 +103,6 @@ PyObject *M_Build_Get(PyObject *self, PyObject *args)
Effect *eff;
BPy_Build *wanted_eff;
int num,i;
- printf ("In Effect_Get()\n");
if (!PyArg_ParseTuple(args, "si", &name, &num ))
return(EXPP_ReturnPyObjError(PyExc_AttributeError,\
"expected string int argument"));
@@ -267,11 +265,12 @@ int BuildSetAttr (BPy_Build *self, char *name, PyObject *value)
/* Description: This is a callback function for the BPy_Build type. It */
/* builds a meaninful string to 'print' build objects. */
/*****************************************************************************/
+/*
int BuildPrint(BPy_Build *self, FILE *fp, int flags)
{
return 0;
}
-
+*/
/*****************************************************************************/
/* Function: BuildRepr */
/* Description: This is a callback function for the BPy_Build type. It */
@@ -279,14 +278,13 @@ int BuildPrint(BPy_Build *self, FILE *fp, int flags)
/*****************************************************************************/
PyObject *BuildRepr (BPy_Build *self)
{
- return 0;
+ return PyString_FromString("Build effect");
}
PyObject* BuildCreatePyObject (struct Effect *build)
{
BPy_Build * blen_object;
- printf ("In BuildCreatePyObject\n");
blen_object = (BPy_Build*)PyObject_NEW (BPy_Build, &Build_Type);
diff --git a/source/blender/python/api2_2x/Build.h b/source/blender/python/api2_2x/Build.h
index 542a2560d16..b6fe985c394 100644
--- a/source/blender/python/api2_2x/Build.h
+++ b/source/blender/python/api2_2x/Build.h
@@ -111,7 +111,7 @@ static PyMethodDef BPy_Build_methods[] = {
/* Python Build_Type callback function prototypes: */
/*****************************************************************************/
void BuildDeAlloc (BPy_Build *msh);
-int BuildPrint (BPy_Build *msh, FILE *fp, int flags);
+//int BuildPrint (BPy_Build *msh, FILE *fp, int flags);
int BuildSetAttr (BPy_Build *msh, char *name, PyObject *v);
PyObject *BuildGetAttr (BPy_Build *msh, char *name);
PyObject *BuildRepr (BPy_Build *msh);
diff --git a/source/blender/python/api2_2x/Effect.c b/source/blender/python/api2_2x/Effect.c
index 6e881d56e21..13afa2a5ad8 100644
--- a/source/blender/python/api2_2x/Effect.c
+++ b/source/blender/python/api2_2x/Effect.c
@@ -271,6 +271,7 @@ int EffectSetAttr (BPy_Effect *self, char *name, PyObject *value)
/* Description: This is a callback function for the BPy_Effect type. It */
/* builds a meaninful string to 'print' effcte objects. */
/*****************************************************************************/
+/*
int EffectPrint(BPy_Effect *self, FILE *fp, int flags)
{
if (self->effect->type == EFF_BUILD)puts("Effect Build");
@@ -279,12 +280,13 @@ if (self->effect->type == EFF_WAVE)puts("Effect Wave");
return 0;
}
-
+*/
/*****************************************************************************/
/* Function: EffectRepr */
/* Description: This is a callback function for the BPy_Effect type. It */
/* builds a meaninful string to represent effcte objects. */
/*****************************************************************************/
+
PyObject *EffectRepr (BPy_Effect *self)
{
char*str="";
diff --git a/source/blender/python/api2_2x/Effect.h b/source/blender/python/api2_2x/Effect.h
index 544f80f7a09..711afad0a2d 100644
--- a/source/blender/python/api2_2x/Effect.h
+++ b/source/blender/python/api2_2x/Effect.h
@@ -72,7 +72,7 @@ PyObject *M_Effect_Get (PyObject *self, PyObject *args);
/* Python Effect_Type callback function prototypes: */
/*****************************************************************************/
void EffectDeAlloc (BPy_Effect *msh);
-int EffectPrint (BPy_Effect *msh, FILE *fp, int flags);
+//int EffectPrint (BPy_Effect *msh, FILE *fp, int flags);
int EffectSetAttr (BPy_Effect *msh, char *name, PyObject *v);
PyObject *EffectGetAttr (BPy_Effect *msh, char *name);
PyObject *EffectRepr (BPy_Effect *msh);
@@ -91,7 +91,7 @@ static PyTypeObject Effect_Type =
0, /* tp_itemsize */
/* methods */
(destructor)EffectDeAlloc, /* tp_dealloc */
- (printfunc)EffectPrint, /* tp_print */
+ 0, /* tp_print */
(getattrfunc)EffectGetAttr, /* tp_getattr */
(setattrfunc)EffectSetAttr, /* tp_setattr */
0, /* tp_compare */
diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c
index d082f10f05b..4b3f31dc227 100644
--- a/source/blender/python/api2_2x/Ipo.c
+++ b/source/blender/python/api2_2x/Ipo.c
@@ -442,12 +442,13 @@ static int IpoSetAttr (C_Ipo *self, char *name, PyObject *value)
/* Description: This is a callback function for the C_Ipo type. It */
/* builds a meaninful string to 'print' ipo objects. */
/*****************************************************************************/
+/*
static int IpoPrint(C_Ipo *self, FILE *fp, int flags)
{
fprintf(fp, "[Ipo \"%s\"]", self->ipo->id.name+2);
return 0;
}
-
+*/
/*****************************************************************************/
/* Function: IpoRepr */
/* Description: This is a callback function for the C_Ipo type. It */
@@ -455,7 +456,7 @@ static int IpoPrint(C_Ipo *self, FILE *fp, int flags)
/*****************************************************************************/
static PyObject *IpoRepr (C_Ipo *self)
{
- return PyString_FromString(self->ipo->id.name+2);
+ return PyString_FromFormat("[Ipo \"%s\"]", self->ipo->id.name+2);
}
/* Three Python Ipo_Type helper functions needed by the Object module: */
diff --git a/source/blender/python/api2_2x/Ipo.h b/source/blender/python/api2_2x/Ipo.h
index 602e8cc4b14..6418801cc12 100644
--- a/source/blender/python/api2_2x/Ipo.h
+++ b/source/blender/python/api2_2x/Ipo.h
@@ -144,7 +144,7 @@ static PyMethodDef C_Ipo_methods[] = {
/* Python Ipo_Type callback function prototypes: */
/*****************************************************************************/
static void IpoDeAlloc (C_Ipo *self);
-static int IpoPrint (C_Ipo *self, FILE *fp, int flags);
+//static int IpoPrint (C_Ipo *self, FILE *fp, int flags);
static int IpoSetAttr (C_Ipo *self, char *name, PyObject *v);
static PyObject *IpoGetAttr (C_Ipo *self, char *name);
static PyObject *IpoRepr (C_Ipo *self);
@@ -161,7 +161,7 @@ PyTypeObject Ipo_Type =
0, /* tp_itemsize */
/* methods */
(destructor)IpoDeAlloc, /* tp_dealloc */
- (printfunc)IpoPrint, /* tp_print */
+ 0, /* tp_print */
(getattrfunc)IpoGetAttr, /* tp_getattr */
(setattrfunc)IpoSetAttr, /* tp_setattr */
0, /* tp_compare */
diff --git a/source/blender/python/api2_2x/Metaball.c b/source/blender/python/api2_2x/Metaball.c
index 04e4ad413bc..dcf4a16b088 100644
--- a/source/blender/python/api2_2x/Metaball.c
+++ b/source/blender/python/api2_2x/Metaball.c
@@ -44,7 +44,7 @@ PyTypeObject Metaball_Type =
0, /* tp_itemsize */
/* methods */
(destructor)MetaballDeAlloc, /* tp_dealloc */
- (printfunc)MetaballPrint, /* tp_print */
+ 0, /* tp_print */
(getattrfunc)MetaballGetAttr, /* tp_getattr */
(setattrfunc)MetaballSetAttr, /* tp_setattr */
0, /* tp_compare */
@@ -671,13 +671,14 @@ static void MetaballDeAlloc (BPy_Metaball *self)
{
PyObject_DEL (self);
}
-
+/*
static int MetaballPrint (BPy_Metaball *self, FILE *fp, int flags)
{
fprintf(fp, "[MetaBall \"%s\"]", self->metaball->id.name+2);
return 0;
}
+*/
/*****************************************************************************/
/* Function: MetaballGetAttr */
/* Description: This is a callback function for the BPy_Metaball type. It is */
@@ -739,6 +740,6 @@ static int MetaballSetAttr (BPy_Metaball *self, char *name, PyObject *value)
/*****************************************************************************/
static PyObject *MetaballRepr (BPy_Metaball *self)
{
- return PyString_FromString(self->metaball->id.name+2);
+ return PyString_FromFormat("[Metaball \"%s\"]", self->metaball->id.name+2);
}
diff --git a/source/blender/python/api2_2x/Metaball.h b/source/blender/python/api2_2x/Metaball.h
index 4fdf301a95c..8165f8c4c24 100644
--- a/source/blender/python/api2_2x/Metaball.h
+++ b/source/blender/python/api2_2x/Metaball.h
@@ -186,7 +186,7 @@ static PyMethodDef BPy_Metaball_methods[] = {
/* Python Metaball_Type callback function prototypes: */
/*****************************************************************************/
static void MetaballDeAlloc (BPy_Metaball *self);
-static int MetaballPrint (BPy_Metaball *self, FILE *fp, int flags);
+//static int MetaballPrint (BPy_Metaball *self, FILE *fp, int flags);
static int MetaballSetAttr (BPy_Metaball *self, char *name, PyObject *v);
static PyObject *MetaballGetAttr (BPy_Metaball *self, char *name);
static PyObject *MetaballRepr (BPy_Metaball *self);
diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c
index f438eb5ad3f..4df78194cdb 100644
--- a/source/blender/python/api2_2x/Particle.c
+++ b/source/blender/python/api2_2x/Particle.c
@@ -137,7 +137,7 @@ PyTypeObject Particle_Type =
0,
(destructor)ParticleDeAlloc,
- (printfunc)ParticlePrint,
+ 0,
(getattrfunc)ParticleGetAttr,
(setattrfunc)ParticleSetAttr,
0,
@@ -573,8 +573,6 @@ PyObject *Particle_setForce(BPy_Particle *self,PyObject *args)
val[0] = PyFloat_AsDouble(PyTuple_GetItem(args,0));
val[1] = PyFloat_AsDouble(PyTuple_GetItem(args,1));
val[2] = PyFloat_AsDouble(PyTuple_GetItem(args,2));
- printf("In Particle_setForce %f %f %f \n",val[0],val[1],val[2]);
- printf("%d %d \n",PyTuple_Check(args),PyTuple_Size(args));
/*
if (!PyArg_ParseTuple(args, "fff", val,val+1,val+2 ))
return(EXPP_ReturnPyObjError(PyExc_AttributeError,\
@@ -859,12 +857,13 @@ int ParticleSetAttr (BPy_Particle *self, char *name, PyObject *value)
/* Description: This is a callback function for the BPy_Particle type. It */
/* particles a meaninful string to 'print' particle objects. */
/*****************************************************************************/
+/*
int ParticlePrint(BPy_Particle *self, FILE *fp, int flags)
{
printf("Hi, I'm a particle!");
return 0;
}
-
+*/
/*****************************************************************************/
/* Function: ParticleRepr */
/* Description: This is a callback function for the BPy_Particle type. It */
diff --git a/source/blender/python/api2_2x/Particle.h b/source/blender/python/api2_2x/Particle.h
index b20ebb37bd9..04dc9abbaa4 100644
--- a/source/blender/python/api2_2x/Particle.h
+++ b/source/blender/python/api2_2x/Particle.h
@@ -107,7 +107,7 @@ PyObject *Particle_setDefvec(BPy_Particle *self,PyObject*a);
/* Python Particle_Type callback function prototypes: */
/*****************************************************************************/
void ParticleDeAlloc (BPy_Particle *msh);
-int ParticlePrint (BPy_Particle *msh, FILE *fp, int flags);
+//int ParticlePrint (BPy_Particle *msh, FILE *fp, int flags);
int ParticleSetAttr (BPy_Particle *msh, char *name, PyObject *v);
PyObject *ParticleGetAttr (BPy_Particle *msh, char *name);
PyObject *ParticleRepr (BPy_Particle *msh);
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c
index 84d82a2fe70..feb94c91037 100644
--- a/source/blender/python/api2_2x/World.c
+++ b/source/blender/python/api2_2x/World.c
@@ -73,7 +73,7 @@ PyTypeObject World_Type =
0, /* tp_itemsize */
/* methods */
(destructor)World_DeAlloc, /* tp_dealloc */
- (printfunc)World_Print, /* tp_print */
+ 0, /* tp_print */
(getattrfunc)World_GetAttr, /* tp_getattr */
(setattrfunc)World_SetAttr, /* tp_setattr */
(cmpfunc)World_Compare, /* tp_compare */
@@ -838,11 +838,13 @@ static int World_Compare (BPy_World *a, BPy_World *b)
* World. It builds a string with the name of the wrapped Blender World.
*/
+/*
static int World_Print(BPy_World *self, FILE *fp, int flags)
{
fprintf(fp, "[World \"%s\"]", self->world->id.name+2);
return 0;
}
+*/
/**
* \brief The World PyType repr callback
@@ -853,7 +855,7 @@ static int World_Print(BPy_World *self, FILE *fp, int flags)
static PyObject *World_Repr (BPy_World *self)
{
- return PyString_FromString(self->world->id.name+2);
+ return PyString_FromFormat("[World \"%s\"]", self->world->id.name+2);
}
/*@}*/