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:
-rw-r--r--doc/manpage/blender.18
-rw-r--r--source/blender/blenkernel/BKE_global.h3
-rw-r--r--source/blender/editors/interface/resources.c2
-rw-r--r--source/blender/python/intern/bpy_interface.c3
-rw-r--r--source/blender/windowmanager/WM_api.h3
-rw-r--r--source/blender/windowmanager/intern/wm_files.c16
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
-rw-r--r--source/creator/creator.c13
9 files changed, 36 insertions, 18 deletions
diff --git a/doc/manpage/blender.1 b/doc/manpage/blender.1
index 9265fbc190a..6b2876a46b1 100644
--- a/doc/manpage/blender.1
+++ b/doc/manpage/blender.1
@@ -1,4 +1,4 @@
-.TH "BLENDER" "1" "January 01, 2011" "Blender Blender 2\&.56 (sub 0) "
+.TH "BLENDER" "1" "January 19, 2011" "Blender Blender 2\&.56 (sub 0) "
.SH NAME
blender \- a 3D modelling and rendering package
@@ -208,6 +208,12 @@ Turn debugging on
Enable floating point exceptions
.br
+.TP
+.B \-\-factory\-startup
+.br
+Skip reading the "startup.blend" in the users home directory
+.br
+
.IP
.TP
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 65567262441..b23fbd3601c 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -61,7 +61,8 @@ typedef struct Global {
struct ListBase recent_files;
short afbreek, moving, file_loaded;
- short background;
+ char background;
+ char factory_startup;
short winpos, displaymode; /* used to be in Render */
short rendering; /* to indicate render is busy, prevent renderwindow events etc */
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 5e3a0c6022a..3a29419074b 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1015,7 +1015,7 @@ void init_userdef_do_versions(void)
}
if (U.savetime <= 0) {
U.savetime = 1;
-// XXX error("startup.blend is buggy, please consider removing it.\n");
+// XXX error(STRINGIFY(BLENDER_STARTUP_FILE)" is buggy, please consider removing it.\n");
}
/* transform widget settings */
if(U.tw_hotspot==0) {
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index f2ba9f604be..38efb4523c4 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -62,8 +62,7 @@
static int py_call_level= 0;
BPy_StructRNA *bpy_context_module= NULL; /* for fast access */
-// only for tests
-#define TIME_PY_RUN
+// #define TIME_PY_RUN // simple python tests. prints on exit.
#ifdef TIME_PY_RUN
#include "PIL_time.h"
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index a7aad83d471..c9d74cbb39d 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -81,7 +81,8 @@ void WM_window_open_temp (struct bContext *C, struct rcti *position, int type);
/* files */
-int WM_read_homefile (struct bContext *C, struct wmOperator *op);
+int WM_read_homefile_exec(struct bContext *C, struct wmOperator *op);
+int WM_read_homefile (struct bContext *C, struct ReportList *reports, short from_memory);
int WM_write_homefile (struct bContext *C, struct wmOperator *op);
void WM_read_file (struct bContext *C, const char *name, struct ReportList *reports);
int WM_write_file (struct bContext *C, const char *target, int fileflags, struct ReportList *reports, int copy);
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 31cb3172013..80b88309883 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -352,11 +352,10 @@ void WM_read_file(bContext *C, const char *name, ReportList *reports)
/* called on startup, (context entirely filled with NULLs) */
/* or called for 'New File' */
/* op can be NULL */
-int WM_read_homefile(bContext *C, wmOperator *op)
+int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
{
ListBase wmbase;
char tstr[FILE_MAXDIR+FILE_MAXFILE];
- int from_memory= op && strcmp(op->type->idname, "WM_OT_read_factory_settings")==0;
int success= 0;
free_ttfont(); /* still weird... what does it here? */
@@ -369,9 +368,7 @@ int WM_read_homefile(bContext *C, wmOperator *op)
} else {
tstr[0] = '\0';
from_memory = 1;
- if (op) {
- BKE_report(op->reports, RPT_INFO, "Config directory with startup.blend file not found.");
- }
+ BKE_report(reports, RPT_INFO, "Config directory with "STRINGIFY(BLENDER_STARTUP_FILE)" file not found.");
}
}
@@ -385,7 +382,7 @@ int WM_read_homefile(bContext *C, wmOperator *op)
success = (BKE_read_file(C, tstr, NULL) != BKE_READ_FILE_FAIL);
if(U.themes.first==NULL) {
- printf("\nError: No valid startup.blend, fall back to built-in default.\n\n");
+ printf("\nError: No valid "STRINGIFY(BLENDER_STARTUP_FILE)", fall back to built-in default.\n\n");
success = 0;
}
}
@@ -436,9 +433,14 @@ int WM_read_homefile(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
CTX_wm_window_set(C, NULL); /* exits queues */
- return OPERATOR_FINISHED;
+ return TRUE;
}
+int WM_read_homefile_exec(bContext *C, wmOperator *op)
+{
+ int from_memory= strcmp(op->type->idname, "WM_OT_read_factory_settings") == 0;
+ return WM_read_homefile(C, op->reports, from_memory) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+}
void read_history(void)
{
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 19bb92d72e0..405aa5bd8af 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -136,7 +136,7 @@ void WM_init(bContext *C, int argc, char **argv)
BLF_lang_init();
/* get the default database, plus a wm */
- WM_read_homefile(C, NULL);
+ WM_read_homefile(C, NULL, G.factory_startup);
/* note: there is a bug where python needs initializing before loading the
* startup.blend because it may contain PyDrivers. It also needs to be after
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index f6b3cfed2eb..0aaa3088142 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1353,7 +1353,7 @@ static void WM_OT_read_homefile(wmOperatorType *ot)
ot->description="Open the default file (doesn't save the current file)";
ot->invoke= WM_operator_confirm;
- ot->exec= WM_read_homefile;
+ ot->exec= WM_read_homefile_exec;
ot->poll= WM_operator_winactive;
}
@@ -1364,7 +1364,7 @@ static void WM_OT_read_factory_settings(wmOperatorType *ot)
ot->description="Load default file and user preferences";
ot->invoke= WM_operator_confirm;
- ot->exec= WM_read_homefile;
+ ot->exec= WM_read_homefile_exec;
ot->poll= WM_operator_winactive;
}
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 1a0188e0c47..90f579a9d9e 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -245,6 +245,7 @@ static int print_help(int UNUSED(argc), char **UNUSED(argv), void *data)
printf ("Misc Options:\n");
BLI_argsPrintArgDoc(ba, "--debug");
BLI_argsPrintArgDoc(ba, "--debug-fpe");
+ BLI_argsPrintArgDoc(ba, "--factory-startup");
printf("\n");
@@ -392,6 +393,12 @@ static int set_fpe(int UNUSED(argc), char **UNUSED(argv), void *UNUSED(data))
return 0;
}
+static int set_factory_startup(int UNUSED(argc), char **UNUSED(argv), void *UNUSED(data))
+{
+ G.factory_startup= 1;
+ return 0;
+}
+
static int playback_mode(int UNUSED(argc), char **UNUSED(argv), void *UNUSED(data))
{
/* not if -b was given first */
@@ -1006,7 +1013,9 @@ void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
BLI_argsAdd(ba, 1, "-a", NULL, playback_doc, playback_mode, NULL);
BLI_argsAdd(ba, 1, "-d", "--debug", debug_doc, debug_mode, ba);
- BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
+ BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
+
+ BLI_argsAdd(ba, 1, NULL, "--factory-startup", "\n\tSkip reading the "STRINGIFY(BLENDER_STARTUP_FILE)" in the users home directory", set_factory_startup, NULL);
/* second pass: custom window stuff */
BLI_argsAdd(ba, 2, "-p", "--window-geometry", "<sx> <sy> <w> <h>\n\tOpen with lower left corner at <sx>, <sy> and width and height as <w>, <h>", prefsize, NULL);
@@ -1139,7 +1148,7 @@ int main(int argc, char **argv)
BLI_argsParse(ba, 3, NULL, NULL);
WM_init(C, argc, argv);
-
+
/* this is properly initialized with user defs, but this is default */
BLI_where_is_temp( btempdir, 1 ); /* call after loading the startup.blend so we can read U.tempdir */