[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27434] branches/render25: - menu for selecting add scenes for the sequencer.
Campbell Barton
ideasman42 at gmail.com
Fri Mar 12 11:33:49 CET 2010
Revision: 27434
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27434
Author: campbellbarton
Date: 2010-03-12 11:33:48 +0100 (Fri, 12 Mar 2010)
Log Message:
-----------
- menu for selecting add scenes for the sequencer.
- update internal 'btempdir' from userprefs on changing and initializing the temp dir.
- add sequence strip operators nolonger require the sequence view to be active (better for automation).
Modified Paths:
--------------
branches/render25/CMakeLists.txt
branches/render25/release/scripts/ui/space_sequencer.py
branches/render25/source/blender/editors/space_sequencer/sequencer_add.c
branches/render25/source/blender/makesrna/intern/rna_userdef.c
branches/render25/source/blender/windowmanager/intern/wm_files.c
branches/render25/source/creator/creator.c
Modified: branches/render25/CMakeLists.txt
===================================================================
--- branches/render25/CMakeLists.txt 2010-03-12 09:36:42 UTC (rev 27433)
+++ branches/render25/CMakeLists.txt 2010-03-12 10:33:48 UTC (rev 27434)
@@ -1,4 +1,4 @@
- # $Id$
+# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -84,9 +84,9 @@
# Unix defaults to OpenMP On
IF(UNIX AND NOT APPLE)
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
-ELSE()
+ELSE(UNIX AND NOT APPLE)
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
-ENDIF()
+ENDIF(UNIX AND NOT APPLE)
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF)
Modified: branches/render25/release/scripts/ui/space_sequencer.py
===================================================================
--- branches/render25/release/scripts/ui/space_sequencer.py 2010-03-12 09:36:42 UTC (rev 27433)
+++ branches/render25/release/scripts/ui/space_sequencer.py 2010-03-12 10:33:48 UTC (rev 27434)
@@ -185,7 +185,7 @@
layout.operator_context = 'INVOKE_REGION_WIN'
layout.column()
- layout.operator("sequencer.scene_strip_add", text="Scene")
+ layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...")
layout.operator("sequencer.movie_strip_add", text="Movie")
layout.operator("sequencer.image_strip_add", text="Image")
layout.operator("sequencer.sound_strip_add", text="Sound")
Modified: branches/render25/source/blender/editors/space_sequencer/sequencer_add.c
===================================================================
--- branches/render25/source/blender/editors/space_sequencer/sequencer_add.c 2010-03-12 09:36:42 UTC (rev 27433)
+++ branches/render25/source/blender/editors/space_sequencer/sequencer_add.c 2010-03-12 10:33:48 UTC (rev 27434)
@@ -191,7 +191,7 @@
start_frame= RNA_int_get(op->ptr, "start_frame");
channel= RNA_int_get(op->ptr, "channel");
- sce_seq= BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "type"));
+ sce_seq= BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));
if (sce_seq==NULL) {
BKE_report(op->reports, RPT_ERROR, "Scene not found");
@@ -232,6 +232,11 @@
static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ if(ED_operator_sequencer_active(C)) {
+ BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
+ return OPERATOR_CANCELLED;
+ }
+
sequencer_generic_invoke_xy__internal(C, op, event, 0);
return sequencer_add_scene_strip_exec(C, op);
// needs a menu
@@ -252,14 +257,15 @@
ot->invoke= sequencer_add_scene_strip_invoke;
ot->exec= sequencer_add_scene_strip_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->poll= ED_operator_scene_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
- prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, 0, "Type", "");
+ prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", "");
RNA_def_enum_funcs(prop, RNA_scene_itemf);
+ ot->prop= prop;
}
static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoadFunc seq_load_func)
@@ -318,7 +324,12 @@
static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
+{
+ if(ED_operator_sequencer_active(C)) {
+ BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
+ return OPERATOR_CANCELLED;
+ }
+
sequencer_generic_invoke_xy__internal(C, op, event, 0);
return WM_operator_filesel(C, op, event);
//return sequencer_add_movie_strip_exec(C, op);
@@ -337,7 +348,7 @@
ot->invoke= sequencer_add_movie_strip_invoke;
ot->exec= sequencer_add_movie_strip_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->poll= ED_operator_scene_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -355,7 +366,12 @@
}
static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
+{
+ if(ED_operator_sequencer_active(C)) {
+ BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
+ return OPERATOR_CANCELLED;
+ }
+
sequencer_generic_invoke_xy__internal(C, op, event, 0);
return WM_operator_filesel(C, op, event);
//return sequencer_add_sound_strip_exec(C, op);
@@ -374,7 +390,7 @@
ot->invoke= sequencer_add_sound_strip_invoke;
ot->exec= sequencer_add_sound_strip_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->poll= ED_operator_scene_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -442,6 +458,11 @@
static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ if(ED_operator_sequencer_active(C)) {
+ BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
+ return OPERATOR_CANCELLED;
+ }
+
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME);
return WM_operator_filesel(C, op, event);
//return sequencer_add_image_strip_exec(C, op);
@@ -460,7 +481,7 @@
ot->invoke= sequencer_add_image_strip_invoke;
ot->exec= sequencer_add_image_strip_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->poll= ED_operator_scene_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -581,6 +602,11 @@
/* add color */
static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ if(ED_operator_sequencer_active(C)) {
+ BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
+ return OPERATOR_CANCELLED;
+ }
+
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME);
if (RNA_property_is_set(op->ptr, "type") && RNA_enum_get(op->ptr, "type")==SEQ_PLUGIN) {
@@ -603,7 +629,7 @@
ot->invoke= sequencer_add_effect_strip_invoke;
ot->exec= sequencer_add_effect_strip_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->poll= ED_operator_scene_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
Modified: branches/render25/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- branches/render25/source/blender/makesrna/intern/rna_userdef.c 2010-03-12 09:36:42 UTC (rev 27433)
+++ branches/render25/source/blender/makesrna/intern/rna_userdef.c 2010-03-12 10:33:48 UTC (rev 27434)
@@ -228,8 +228,13 @@
BLI_freelinkN(&U.addons, bext);
}
+static void rna_userdef_temp_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ extern char btempdir[];
+ UserDef *userdef = (UserDef*)ptr->data;
+ strncpy(btempdir, userdef->tempdir, FILE_MAXDIR+FILE_MAXFILE);
+}
-
#else
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
@@ -2621,6 +2626,7 @@
prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "tempdir");
RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
+ RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "image_editor");
Modified: branches/render25/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- branches/render25/source/blender/windowmanager/intern/wm_files.c 2010-03-12 09:36:42 UTC (rev 27433)
+++ branches/render25/source/blender/windowmanager/intern/wm_files.c 2010-03-12 10:33:48 UTC (rev 27434)
@@ -238,6 +238,8 @@
/* in case UserDef was read, we re-initialize all, and do versioning */
static void wm_init_userdef(bContext *C)
{
+ extern char btempdir[];
+
UI_init_userdef();
MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
sound_init(CTX_data_main(C));
@@ -245,6 +247,8 @@
/* set the python auto-execute setting from user prefs */
if (U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
else G.f |= G_SCRIPT_AUTOEXEC;
+
+ if(U.tempdir[0]) strncpy(btempdir, U.tempdir, FILE_MAXDIR+FILE_MAXFILE);
}
void WM_read_file(bContext *C, char *name, ReportList *reports)
Modified: branches/render25/source/creator/creator.c
===================================================================
--- branches/render25/source/creator/creator.c 2010-03-12 09:36:42 UTC (rev 27433)
+++ branches/render25/source/creator/creator.c 2010-03-12 10:33:48 UTC (rev 27434)
@@ -980,7 +980,7 @@
WM_init(C, argc, argv);
- // XXX BRECHT SOLVE
+ /* this is properly initialized with user defs, but this is default */
BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */
#ifndef DISABLE_SDL
More information about the Bf-blender-cvs
mailing list