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/Camera.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/Camera.c')
-rw-r--r--source/blender/python/api2_2x/Camera.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Camera.c b/source/blender/python/api2_2x/Camera.c
index f1317c876e5..645e1f08b00 100644
--- a/source/blender/python/api2_2x/Camera.c
+++ b/source/blender/python/api2_2x/Camera.c
@@ -218,6 +218,32 @@ Camera *Camera_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. */
+/*****************************************************************************/
+Camera * GetCameraByName (char * name)
+{
+ Camera * cam_iter;
+
+ cam_iter = G.main->camera.first;
+ while (cam_iter)
+ {
+ if (StringEqual (name, GetIdName (&(cam_iter->id))))
+ {
+ return (cam_iter);
+ }
+ cam_iter = cam_iter->id.next;
+ }
+
+ /* There is no camera with the given name */
+ return (NULL);
+}
+
+/*****************************************************************************/
/* Python BPy_Camera methods: */
/*****************************************************************************/
static PyObject *Camera_getName(BPy_Camera *self)