Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIyad Ahmed <iyadahmed2001>2021-08-24 19:40:55 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-12-14 19:43:12 +0300
commitcc971e509d26484cc00bf89af7d2599d7dcab34e (patch)
treebcf3fc0c0e11908712b5cfd71ab513c92fff03f9 /node_wrangler.py
parent69c817b87a25022e7413a635c60270a2516d4403 (diff)
Fix T77022: node wranger error with texture files on different drivesv2.93.8v2.93.7
Principled texture setup with relative path option would lead to this, silently use an absolute path instead like other Blender operators. Differential Revision: https://developer.blender.org/D12221
Diffstat (limited to 'node_wrangler.py')
-rw-r--r--node_wrangler.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/node_wrangler.py b/node_wrangler.py
index 118408c4..10b52967 100644
--- a/node_wrangler.py
+++ b/node_wrangler.py
@@ -3171,7 +3171,7 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper):
relative_path: BoolProperty(
name='Relative Path',
- description='Select the file relative to the blend file',
+ description='Set the file path relative to the blend file, when possible',
default=True
)
@@ -3271,10 +3271,10 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper):
import_path = self.directory
if self.relative_path:
if bpy.data.filepath:
- import_path = bpy.path.relpath(self.directory)
- else:
- self.report({'WARNING'}, 'Relative paths cannot be used with unsaved scenes!')
- print('Relative paths cannot be used with unsaved scenes!')
+ try:
+ import_path = bpy.path.relpath(self.directory)
+ except ValueError:
+ pass
# Add found images
print('\nMatched Textures:')