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:
authorMichel Selten <michel@mselten.demon.nl>2003-07-27 19:56:32 +0400
committerMichel Selten <michel@mselten.demon.nl>2003-07-27 19:56:32 +0400
commit916f527253e737b5bd31a0358828b719d251653d (patch)
tree44d99be0f35a744e77450bf29ebfe3a1e6e9fbee /source/blender/python/api2_2x/Scene.c
parent2222fc716812cfd2a5fab4d1a8eb6f775fced1dc (diff)
* Fixed problems in with script linking.
I had to update many files to get this to work.
Diffstat (limited to 'source/blender/python/api2_2x/Scene.c')
-rw-r--r--source/blender/python/api2_2x/Scene.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c
index 573f797aa7e..600878df3d1 100644
--- a/source/blender/python/api2_2x/Scene.c
+++ b/source/blender/python/api2_2x/Scene.c
@@ -364,6 +364,32 @@ Scene *Scene_FromPyObject (PyObject *pyobj)
}
/*****************************************************************************/
+/* Description: Returns the object with the name specified by the argument */
+/* name. Note that the calling function has to remove the first */
+/* two characters of the object name. These two characters */
+/* specify the type of the object (OB, ME, WO, ...) */
+/* The function will return NULL when no object with the given */
+/* name is found. */
+/*****************************************************************************/
+Scene * GetSceneByName (char * name)
+{
+ Scene * scene_iter;
+
+ scene_iter = G.main->scene.first;
+ while (scene_iter)
+ {
+ if (StringEqual (name, GetIdName (&(scene_iter->id))))
+ {
+ return (scene_iter);
+ }
+ scene_iter = scene_iter->id.next;
+ }
+
+ /* There is no object with the given name */
+ return (NULL);
+}
+
+/*****************************************************************************/
/* Python BPy_Scene methods: */
/*****************************************************************************/
static PyObject *Scene_getName(BPy_Scene *self)