diff options
author | Michel Selten <michel@mselten.demon.nl> | 2003-07-27 19:56:32 +0400 |
---|---|---|
committer | Michel Selten <michel@mselten.demon.nl> | 2003-07-27 19:56:32 +0400 |
commit | 916f527253e737b5bd31a0358828b719d251653d (patch) | |
tree | 44d99be0f35a744e77450bf29ebfe3a1e6e9fbee /source/blender/python/api2_2x/Lamp.c | |
parent | 2222fc716812cfd2a5fab4d1a8eb6f775fced1dc (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/Lamp.c')
-rw-r--r-- | source/blender/python/api2_2x/Lamp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index 95c6b0697f0..87ae46c9f90 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -290,6 +290,32 @@ Lamp *Lamp_FromPyObject (PyObject *pyobj) } /*****************************************************************************/ +/* Description: Returns the lamp with the name specified by the argument */ +/* name. Note that the calling function has to remove the first */ +/* two characters of the lamp name. These two characters */ +/* specify the type of the object (OB, ME, WO, ...) */ +/* The function will return NULL when no lamp with the given */ +/* name is found. */ +/*****************************************************************************/ +Lamp * GetLampByName (char * name) +{ + Lamp * lamp_iter; + + lamp_iter = G.main->lamp.first; + while (lamp_iter) + { + if (StringEqual (name, GetIdName (&(lamp_iter->id)))) + { + return lamp_iter; + } + lamp_iter = lamp_iter->id.next; + } + + /* There is no lamp with the given name */ + return NULL; +} + +/*****************************************************************************/ /* Python BPy_Lamp methods: */ /*****************************************************************************/ static PyObject *Lamp_getName(BPy_Lamp *self) |