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:
authorCampbell Barton <ideasman42@gmail.com>2020-06-18 08:25:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-18 08:49:10 +0300
commit3ada1949f8633293b4a424bf20789d94cf924c43 (patch)
treec996f2c6a612922e3eeee5822864bb2fbb716dc1 /source/blender/blenkernel/BKE_global.h
parentaab165b575ce312675e543f519c962cbf9939d34 (diff)
Python API: path mapping options for library writing function
When "Relative Remap" option was added, the intention was only to remap paths that were already relative. However it remapped all paths. This was reported as T62612 and fixed recently, however some Python script authors depended on the old behavior. For users, it's reasonable to use the existing operators to make paths absolute/relative. For scripts however it's useful to be able to write out individual data-blocks with the ability to make all paths relative. Now `bpy.data.libraries.write()` takes a path_remap argument which can be `NONE/RELATIVE/RELATIVE_ALL/ABSOLUTE` allowing the script author to choose how paths are handled when writing out data-blocks. Addresses T77768.
Diffstat (limited to 'source/blender/blenkernel/BKE_global.h')
-rw-r--r--source/blender/blenkernel/BKE_global.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index a1871d22da7..a134f29228f 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -177,13 +177,11 @@ enum {
/** On read, use #FileGlobal.filename instead of the real location on-disk,
* needed for recovering temp files so relative paths resolve */
G_FILE_RECOVER = (1 << 23),
- /** On write, remap relative file paths to the new file location. */
- G_FILE_RELATIVE_REMAP = (1 << 24),
/** On write, make backup `.blend1`, `.blend2` ... files, when the users preference is enabled */
G_FILE_HISTORY = (1 << 25),
/** BMesh option to save as older mesh format */
/* #define G_FILE_MESH_COMPAT (1 << 26) */
- /** On write, restore paths after editing them (G_FILE_RELATIVE_REMAP) */
+ /** On write, restore paths after editing them (see #BLO_WRITE_PATH_REMAP_RELATIVE). */
G_FILE_SAVE_COPY = (1 << 27),
/* #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) */ /* deprecated */
};
@@ -192,8 +190,7 @@ enum {
* Run-time only #G.fileflags which are never read or written to/from Blend files.
* This means we can change the values without worrying about do-versions.
*/
-#define G_FILE_FLAG_ALL_RUNTIME \
- (G_FILE_NO_UI | G_FILE_RELATIVE_REMAP | G_FILE_HISTORY | G_FILE_SAVE_COPY)
+#define G_FILE_FLAG_ALL_RUNTIME (G_FILE_NO_UI | G_FILE_HISTORY | G_FILE_SAVE_COPY)
/** ENDIAN_ORDER: indicates what endianness the platform where the file was written had. */
#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)