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:
authorCampbell Barton <ideasman42@gmail.com>2007-03-11 19:25:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-03-11 19:25:17 +0300
commite0c77c0f14f6ad3a742ab7b556ccb46b1ef4fbdf (patch)
treed3795bc43f7fa7cecf49471a4a72e827a2b24e78 /source/blender/python/api2_2x/Lamp.c
parentf84c02429ebc03faca8413d08540fa04d2461b93 (diff)
made all data adding functions accept a name such as add_mesh or add_curve, previously only some datatypes adding functions accepted a name.
also updated the Bpy.py epydocs
Diffstat (limited to 'source/blender/python/api2_2x/Lamp.c')
-rw-r--r--source/blender/python/api2_2x/Lamp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c
index 535a13a8431..eb7b353d089 100644
--- a/source/blender/python/api2_2x/Lamp.c
+++ b/source/blender/python/api2_2x/Lamp.c
@@ -599,7 +599,7 @@ static PyObject *M_Lamp_New( PyObject * self, PyObject * args,
PyObject * keywords )
{
char *type_str = "Lamp";
- char *name_str = "LampData";
+ char *name_str = "Lamp";
static char *kwlist[] = { "type_str", "name_str", NULL };
BPy_Lamp *py_lamp; /* for Lamp Data object wrapper in Python */
Lamp *bl_lamp; /* for actual Lamp Data we create in Blender */
@@ -608,8 +608,9 @@ static PyObject *M_Lamp_New( PyObject * self, PyObject * args,
&type_str, &name_str ) )
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
"expected string(s) or empty argument" ) );
-
- bl_lamp = add_lamp( ); /* first create in Blender */
+
+ bl_lamp = add_lamp( name_str ); /* first create in Blender */
+
if( bl_lamp ) /* now create the wrapper obj in Python */
py_lamp = ( BPy_Lamp * ) Lamp_CreatePyObject( bl_lamp );
else
@@ -639,11 +640,6 @@ static PyObject *M_Lamp_New( PyObject * self, PyObject * args,
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
"unknown lamp type" ) );
- if( strcmp( name_str, "LampData" ) == 0 )
- return ( PyObject * ) py_lamp;
- else /* user gave us a name for the lamp, use it */
- rename_id( &bl_lamp->id, name_str );
-
return ( PyObject * ) py_lamp;
}