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:
authorgaiaclary <gaia.clary@machinimatrix.org>2013-11-27 23:48:07 +0400
committergaiaclary <gaia.clary@machinimatrix.org>2013-11-30 02:13:55 +0400
commit72272d2e4f4676c5c67483f1005251253edef15f (patch)
treec3fd07c5adf07ae4cab725f7f8088298983a93e8 /source/blender/windowmanager/intern/wm_operators.c
parente2429d6492bb58a87bcbee29a0f78a6ea6bb6dfa (diff)
D54: Added a filepath attribute to the read_homefile operator.
This attribute allows to open a blend file as an alternative start-up file. The attribute is only available from python. This is an example call: bpy.ops.wm.read_homefile(filepath='path/to/a/file.blend') This patch also changes readfile.c to ensure that unintentionally stored cursor states are not imported from the loaded file.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 5d2edcecfba..f2fb4d66300 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2029,12 +2029,19 @@ static void WM_OT_read_history(wmOperatorType *ot)
static void WM_OT_read_homefile(wmOperatorType *ot)
{
+ PropertyRNA *prop;
ot->name = "Reload Start-Up File";
ot->idname = "WM_OT_read_homefile";
ot->description = "Open the default file (doesn't save the current file)";
ot->invoke = WM_operator_confirm;
ot->exec = wm_homefile_read_exec;
+
+ prop = RNA_def_string_file_path(ot->srna, "filepath", "",
+ FILE_MAX, "File Path",
+ "Path to an alternative start-up file");
+ RNA_def_property_flag(prop, PROP_HIDDEN);
+
/* ommit poll to run in background mode */
}