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-04-25 04:37:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-04-25 04:37:19 +0400
commit0c7e145dcedaf3e22abaead61c1b1cb431a7da0a (patch)
treee5a63e7207912ba5e03b124834e52c4e7b2239f2 /source/blender/python/api2_2x/bpy_data.c
parent77f08ddc12870b90064273fa314d462ccdd473ba (diff)
Object.c - made object action writable
gen_library - fixed bug, wasnt adjusting user counts properly. bpy_data.c - added default new names for new data
Diffstat (limited to 'source/blender/python/api2_2x/bpy_data.c')
-rw-r--r--source/blender/python/api2_2x/bpy_data.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/python/api2_2x/bpy_data.c b/source/blender/python/api2_2x/bpy_data.c
index 61951069ae7..2ccb1dfe109 100644
--- a/source/blender/python/api2_2x/bpy_data.c
+++ b/source/blender/python/api2_2x/bpy_data.c
@@ -502,18 +502,18 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
}
switch (self->type) {
- case ID_SCE:
- id = (ID *)add_scene( name );
+ case ID_SCE:
+ id = (ID *)add_scene( name?name:"Scene" );
user_count = 1;
break;
case ID_OB:
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Add objects through the scenes objects iterator" );
case ID_ME:
- id = (ID *)add_mesh__internal( name );
+ id = (ID *)add_mesh__internal( name?name:"Mesh" );
break;
case ID_CU:
- id = (ID *)add_curve( name, data_code );
+ id = (ID *)add_curve( name?name:"Curve", data_code );
if (data_code==OB_FONT) {
Text3d *text3d = (Text3d *)id;
text3d->vfont= get_builtin_font();
@@ -527,17 +527,17 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
} /*else { CURVE - Dont need to do anything } */
break;
case ID_MB:
- id = (ID *)add_mball( name );
+ id = (ID *)add_mball( name?name:"MBall" );
break;
case ID_MA:
- id = (ID *)add_material( name );
+ id = (ID *)add_material( name?name:"Material" );
break;
case ID_TE:
- id = (ID *)add_texture( name );
+ id = (ID *)add_texture( name?name:"Texture" );
break;
case ID_IM:
{
- id = (ID *)BKE_add_image_size(img_width, img_height, name, 0);
+ id = (ID *)BKE_add_image_size(img_width, img_height, name?name:"Image", 0);
if( !id )
return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
"couldn't create PyObject Image_Type" ) );
@@ -545,39 +545,39 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
break;
}
case ID_LT:
- id = (ID *)add_lattice( name );
+ id = (ID *)add_lattice( name?name:"Lattice" );
break;
case ID_LA:
- id = (ID *)add_lamp( name );
+ id = (ID *)add_lamp( name?name:"Lamp" );
break;
case ID_CA:
- id = (ID *)add_camera( name );
+ id = (ID *)add_camera( name?name:"Camera" );
break;
case ID_IP:
- id = (ID *)add_ipo( name, data_code );
+ id = (ID *)add_ipo( name?name:"Ipo", data_code );
break;
case ID_WO:
- id = (ID *)add_world( name );
+ id = (ID *)add_world( name?name:"World" );
break;
case ID_VF:
return EXPP_ReturnPyObjError( PyExc_TypeError,
"Cannot create new fonts, use the load() function to load from a file" );
case ID_TXT:
- id = (ID *)add_empty_text( name );
+ id = (ID *)add_empty_text( name?name:"Text" );
user_count = 1;
break;
case ID_SO:
return EXPP_ReturnPyObjError( PyExc_TypeError,
"Cannot create new sounds, use the load() function to load from a file" );
case ID_GR:
- id = (ID *)add_group( name );
+ id = (ID *)add_group( name?name:"Group" );
user_count = 1;
break;
case ID_AR:
- id = (ID *)add_armature( name );
+ id = (ID *)add_armature( name?name:"Armature" );
break;
case ID_AC:
- id = (ID *)add_empty_action( name );
+ id = (ID *)add_empty_action( name?name:"Action" );
user_count = 1;
break;
}