From bd993f13d40d1b08798bd0145e3466239ab29277 Mon Sep 17 00:00:00 2001 From: Stephen Swaney Date: Wed, 12 Nov 2003 07:46:07 +0000 Subject: [PATCH] unfix previous fix. Scene and Text don't need their user counts adjusted. --- source/blender/python/api2_2x/Scene.c | 8 ++++++-- source/blender/python/api2_2x/Text.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c index b675a9b0708..fd3e3bfb9b4 100644 --- a/source/blender/python/api2_2x/Scene.c +++ b/source/blender/python/api2_2x/Scene.c @@ -230,8 +230,12 @@ static PyObject *M_Scene_New(PyObject *self, PyObject *args, PyObject *kword) blscene = add_scene(name); /* first create the Scene in Blender */ if (blscene){ - /* return user count to zero because add_scene() inc'd it */ - blscene->id.us = 0; + /* normally, for most objects, we set the user count to zero here. + * Scene is different than most objs since it is the container + * for all the others. Since add_scene() has already set + * the user count to one, we leave it alone. + */ + /* now create the wrapper obj in Python */ pyscene = Scene_CreatePyObject (blscene); } diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c index e2819de3bab..933191eda56 100644 --- a/source/blender/python/api2_2x/Text.c +++ b/source/blender/python/api2_2x/Text.c @@ -50,8 +50,8 @@ static PyObject *M_Text_New(PyObject *self, PyObject *args, PyObject *keywords) bl_text = add_empty_text(); if (bl_text) { - /* return user count to zero because add_empty_text() inc'd it */ - bl_text->id.us = 0; + /* do not set user count because Text is already linked */ + /* create python wrapper obj */ py_text = Text_CreatePyObject (bl_text); }