diff options
author | Iyad Ahmed <iyadahmed2001> | 2021-08-24 19:40:55 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-01-18 13:02:26 +0300 |
commit | e37389de7721eed6d74c91c9c70a718af6a9846c (patch) | |
tree | b6d1e752846c20d389b0059c741c55e747704b7c /node_wrangler.py | |
parent | 85dab78f0086fe5aef4014fbb66f63dd90ef27fc (diff) |
Fix T77022: node wranger error with texture files on different drivesv2.83.20v2.83.19blender-v2.83-release
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.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/node_wrangler.py b/node_wrangler.py index e26da88b..c1156581 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -2716,7 +2716,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 ) @@ -2816,10 +2816,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:') |