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:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 16cba7d6758..07bab06e52f 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -860,7 +860,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
RNA_def_property_flag(prop, PROP_HIDDEN);
if(flag & WM_FILESEL_RELPATH)
- RNA_def_boolean(ot->srna, "relative_path", (U.flag & USER_RELPATHS) ? 1:0, "Relative Path", "Select the file relative to the blend file");
+ RNA_def_boolean(ot->srna, "relative_path", TRUE, "Relative Path", "Select the file relative to the blend file");
}
void WM_operator_properties_select_all(wmOperatorType *ot)
@@ -1618,15 +1618,20 @@ static void WM_OT_open_mainfile(wmOperatorType *ot)
static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- if(!RNA_property_is_set(op->ptr, "relative_path"))
- RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
-
if(RNA_property_is_set(op->ptr, "filepath")) {
return WM_operator_call(C, op);
}
else {
/* XXX TODO solve where to get last linked library from */
- RNA_string_set(op->ptr, "filepath", G.lib);
+ if(G.lib[0] != '\0') {
+ RNA_string_set(op->ptr, "filepath", G.lib);
+ }
+ else if(G.relbase_valid) {
+ char path[FILE_MAX];
+ BLI_strncpy(path, G.main->name, sizeof(G.main->name));
+ BLI_parent_dir(path);
+ RNA_string_set(op->ptr, "filepath", path);
+ }
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
}