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>2011-01-11 05:30:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-11 05:30:01 +0300
commit35e68e97850b00e75a1488a59e7e9b85d240c37f (patch)
treee59a6637d6e5729dfd6f570a73c3aaa918901f9a /source/blender/makesrna/intern/rna_main_api.c
parentd72639323b5a2ab5dfc26e864c43d512ffb3cd58 (diff)
- bpy.data.lamps.new() now takes a type argument since lamp type also sets class type this avoids needing to use ugly lamp.type_recast() after changing type.
- default vertex color layer name was UTTex when added from python.
Diffstat (limited to 'source/blender/makesrna/intern/rna_main_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 20d76b4f386..797baf07605 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -236,9 +236,10 @@ void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
/* XXX python now has invalid pointer? */
}
-Lamp *rna_Main_lamps_new(Main *bmain, const char *name)
+Lamp *rna_Main_lamps_new(Main *bmain, const char *name, int type)
{
Lamp *lamp= add_lamp(name);
+ lamp->type= type;
id_us_min(&lamp->id);
return lamp;
}
@@ -716,6 +717,8 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add a new lamp to the main database");
parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock.");
RNA_def_function_return(func, parm);