diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-09 16:18:21 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-09 16:18:21 +0300 |
commit | 70f8eaf1b769c402ec61d86f25237d6b64186861 (patch) | |
tree | 035d1da0dc7ca1ff1cfefad013181dc0ce3084ed /source/blender/blenkernel | |
parent | 2ca8230f67db3d6c4693d0a2e0997dfd5de43091 (diff) | |
parent | 638de722775fc43c3543a30aaa888372fe93fe98 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/editors/space_view3d/drawobject.c
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_modifier.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index b5d3e67b970..b40d32203f6 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -468,7 +468,7 @@ void modifier_mdef_compact_influences(struct ModifierData *md); void modifier_path_init(char *path, int path_maxlen, const char *name); const char *modifier_path_relbase(struct Main *bmain, struct Object *ob); - +const char *modifier_path_relbase_from_global(struct Object *ob); /* wrappers for modifier callbacks that ensure valid normals */ diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index bd9cd684548..0b904caf375 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -809,6 +809,18 @@ const char *modifier_path_relbase(Main *bmain, Object *ob) } } +const char *modifier_path_relbase_from_global(Object *ob) +{ + if (G.relbase_valid || ID_IS_LINKED(ob)) { + return ID_BLEND_PATH_FROM_GLOBAL(&ob->id); + } + else { + /* last resort, better then using "" which resolves to the current + * working directory */ + return BKE_tempdir_session(); + } +} + /* initializes the path with either */ void modifier_path_init(char *path, int path_maxlen, const char *name) { |