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:
authorKen Hughes <khughes@pacific.edu>2007-03-31 19:31:37 +0400
committerKen Hughes <khughes@pacific.edu>2007-03-31 19:31:37 +0400
commitbf8bb77abc3f48ab808d76863c653856a9a08507 (patch)
treeaa56abc4d066c5f9fa19e1e70858cdbc0d7f3dae /source/blender/python/api2_2x/World.c
parent417498a86532b3b4c228727c516c5052ef6c8227 (diff)
Python API
---------- Change deprecation printfs to print warning once instead of everytime the deprecated method is called. Also commented out deprecation warnings for code which will eventually be replaced by experimental Blender.Main/bpy module.
Diffstat (limited to 'source/blender/python/api2_2x/World.c')
-rw-r--r--source/blender/python/api2_2x/World.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c
index 580bb3efcc3..c321fccb044 100644
--- a/source/blender/python/api2_2x/World.c
+++ b/source/blender/python/api2_2x/World.c
@@ -450,9 +450,14 @@ static PyObject *M_World_Get( PyObject * self, PyObject * args )
static PyObject *M_World_GetCurrent( PyObject * self )
{
BPy_World *w = NULL;
-
- printf("Blender.World.GetCurrent() deprecated!\n\tuse Blender.Main.scenes.world instead\n");
-
+#if 0 /* add back in when bpy becomes "official" */
+ static char warning = 1;
+ if( warning ) {
+ printf("Blender.World.GetCurrent() deprecated!\n\tuse bpy.scenes.world instead\n");
+ --warning;
+ }
+#endif
+
if( !G.scene->world )
Py_RETURN_NONE;
@@ -890,8 +895,15 @@ static PyObject *World_getScriptLinks( BPy_World * self, PyObject * args )
static PyObject *World_setCurrent( BPy_World * self )
{
World *world = self->world;
+#if 0 /* add back in when bpy becomes "official" */
+ static char warning = 1;
+ if( warning ) {
+ printf("world.setCurrent() deprecated!\n\tuse bpy.scenes.world=world instead\n");
+ --warning;
+ }
+#endif
+
/* If there is a world then it now has one less user */
- printf("world.setCurrent() deprecated!\n\tuse Blender.Main.scenes.world=world instead\n");
if( G.scene->world )
G.scene->world->id.us--;
world->id.us++;