Merge branch 'master' into blender2.8
[blender.git] / source / blender / blenkernel / intern / modifier.c
index bd9cd6845482108b6ca5399293332784c6a72cc1..0b904caf375ddbea4a6ae0fc42a455c5d524d556 100644 (file)
@@ -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)
 {