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-03-31 18:33:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-03-31 18:33:59 +0400
commit76d7a3562c448d431def367e2e444696efb6c97e (patch)
treea1741b69b36b8c9fe3c48388b2fe27731a255405 /source/blender/editors/screen
parent2900557568077f0164e83dbb544c664cb8b7c300 (diff)
blender had no option to add a new scene from the UI, only to copy the existing one.
added a new scene option which doesnt copy any render settings from the previous.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/screen_ops.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 289296fd817..afda6c5088f 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3164,14 +3164,21 @@ static int scene_new_exec(bContext *C, wmOperator *op)
Scene *newscene, *scene= CTX_data_scene(C);
Main *bmain= CTX_data_main(C);
int type= RNA_enum_get(op->ptr, "type");
-
- newscene= copy_scene(scene, type);
-
- /* these can't be handled in blenkernel curently, so do them here */
- if(type == SCE_COPY_LINK_DATA)
- ED_object_single_users(bmain, newscene, 0);
- else if(type == SCE_COPY_FULL)
- ED_object_single_users(bmain, newscene, 1);
+
+ if(type == SCE_COPY_NEW) {
+ newscene= add_scene("Scene");
+ }
+ else { /* different kinds of copying */
+ newscene= copy_scene(scene, type);
+
+ /* these can't be handled in blenkernel curently, so do them here */
+ if(type == SCE_COPY_LINK_DATA) {
+ ED_object_single_users(bmain, newscene, 0);
+ }
+ else if(type == SCE_COPY_FULL) {
+ ED_object_single_users(bmain, newscene, 1);
+ }
+ }
WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, newscene);
@@ -3181,7 +3188,8 @@ static int scene_new_exec(bContext *C, wmOperator *op)
static void SCENE_OT_new(wmOperatorType *ot)
{
static EnumPropertyItem type_items[]= {
- {SCE_COPY_EMPTY, "EMPTY", 0, "Empty", "Add empty scene"},
+ {SCE_COPY_NEW, "NEW", 0, "New", "Add new scene"},
+ {SCE_COPY_EMPTY, "EMPTY", 0, "Copy Settings", "Make a copy without any objects"},
{SCE_COPY_LINK_OB, "LINK_OBJECTS", 0, "Link Objects", "Link to the objects from the current scene"},
{SCE_COPY_LINK_DATA, "LINK_OBJECT_DATA", 0, "Link Object Data", "Copy objects linked to data from the current scene"},
{SCE_COPY_FULL, "FULL_COPY", 0, "Full Copy", "Make a full copy of the current scene"},