Node Wrangler - Principled Texture Setup error (with Relative Path option and blendfile and textures are on different drives) #77022

Closed
opened 2020-05-24 13:29:44 +02:00 by Munkhsaikhan Boldsaikhan · 56 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.87

Blender Version
Broken: version: 2.83 (sub 17), branch: master, commit date: 2020-05-22 19:52, hash: blender/blender@e8dd8c2829
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: Node Wrangler (3, 36)
Author: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer

Short description of error
Node Wrangler - "Principled Texture Setup"works normally in 2.82 (stable version as right now). But doesn't work in version 2.83Exact steps for others to reproduce the error
When the blend file and texture images are in the same hard drive it works normally. But when they are indifferent hard drives don't work and shows this (pic) error.
Steps:
blend flile and image textures must be in different hard drives
Shader Editor -> Principled BSDF selected -> Ctrl + Shift + T -> Select texture images -> Principled Texture Setup button

image.png

I thought not necessary to upload the blend file. Since the error can be reproduced in the default blend file.

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.87 **Blender Version** Broken: version: 2.83 (sub 17), branch: master, commit date: 2020-05-22 19:52, hash: `blender/blender@e8dd8c2829` Worked: (newest version of Blender that worked as expected) **Addon Information** Name: Node Wrangler (3, 36) Author: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer **Short description of error** Node Wrangler - **"Principled Texture Setup"**works normally in 2.82 (stable version as right now). But doesn't work in version 2.83**Exact steps for others to reproduce the error** When the blend file and texture images are in the same hard drive it works normally. But when they are indifferent hard drives don't work and shows this (pic) error. Steps: blend flile and image textures must be in different hard drives Shader Editor -> Principled BSDF selected -> Ctrl + Shift + T -> Select texture images -> Principled Texture Setup button ![image.png](https://archive.blender.org/developer/F8550806/image.png) I thought not necessary to upload the blend file. Since the error can be reproduced in the default blend file.

Added subscriber: @MunkhsaikhanBoldsaikhan

Added subscriber: @MunkhsaikhanBoldsaikhan

#98023 was marked as duplicate of this issue

#98023 was marked as duplicate of this issue

#90436 was marked as duplicate of this issue

#90436 was marked as duplicate of this issue

#86327 was marked as duplicate of this issue

#86327 was marked as duplicate of this issue

#76994 was marked as duplicate of this issue

#76994 was marked as duplicate of this issue

blender/blender#84759 was marked as duplicate of this issue

blender/blender#84759 was marked as duplicate of this issue

#84051 was marked as duplicate of this issue

#84051 was marked as duplicate of this issue

#82411 was marked as duplicate of this issue

#82411 was marked as duplicate of this issue

blender/blender#82248 was marked as duplicate of this issue

blender/blender#82248 was marked as duplicate of this issue

#81742 was marked as duplicate of this issue

#81742 was marked as duplicate of this issue

blender/blender#80916 was marked as duplicate of this issue

blender/blender#80916 was marked as duplicate of this issue

#79183 was marked as duplicate of this issue

#79183 was marked as duplicate of this issue

#77843 was marked as duplicate of this issue

#77843 was marked as duplicate of this issue

#77512 was marked as duplicate of this issue

#77512 was marked as duplicate of this issue

This comment was removed by @MunkhsaikhanBoldsaikhan

*This comment was removed by @MunkhsaikhanBoldsaikhan*
Member

Added subscriber: @Calra

Added subscriber: @Calra
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

@MunkhsaikhanBoldsaikhan Please update the task description with description of the error, steps to reproduce and if possible a simple blend file where the error/crash happens.

@MunkhsaikhanBoldsaikhan Please update the task description with description of the error, steps to reproduce and if possible a simple blend file where the error/crash happens.
Munkhsaikhan Boldsaikhan changed title from Principled Texture Setup no longer works in Blender 2.83 beta to Node Wrangler - Principled Texture Setup no longer works in Blender 2.83 beta 2020-05-24 15:41:15 +02:00

Added subscriber: @MeshVoid

Added subscriber: @MeshVoid

This comment was removed by @MeshVoid

*This comment was removed by @MeshVoid*

You are right. I get the same message with the latest build. Win 10 64 bits.
image.png

You are right. I get the same message with the latest build. Win 10 64 bits. ![image.png](https://archive.blender.org/developer/F8550823/image.png)

I'd change the status of this bug to Needs Triage now, since user has provided all the info. That's an interesting bug of Node Wrangler addon, It would be nice if developers could see it. @MunkhsaikhanBoldsaikhan I think you can do it as the author of the report.

I'd change the status of this bug to ***Needs Triage*** now, since user has provided all the info. That's an interesting bug of Node Wrangler addon, It would be nice if developers could see it. @MunkhsaikhanBoldsaikhan I think you can do it as the author of the report.
Member

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'
Member

Ah my bad, forgot and I haven't split my C: drive yet, will wait for other developers to confirm.

Ah my bad, forgot and I haven't split my C: drive yet, will wait for other developers to confirm.

Changed status from 'Needs Developer To Reproduce' to: 'Needs Triage'

Changed status from 'Needs Developer To Reproduce' to: 'Needs Triage'

This bug is in limbo mode now, I guess...

This bug is in limbo mode now, I guess...

Added subscribers: @GregZaal, @BartekSkorupa, @sebastian_k

Added subscribers: @GregZaal, @BartekSkorupa, @sebastian_k

@GregZaal @BartekSkorupa @sebastian_k Terribly sorry to bother you guys, I read that you are authors of that addon in the description. This issue has been reported multiple times (about 4 already in bug reporter). I think it has been overlooked because of a lot of status changes and the duplicate tasks are getting merged. This bug prevents from using Ctrl + Shift + T when textures are on the different drive in 2.83 LTS.

@GregZaal @BartekSkorupa @sebastian_k Terribly sorry to bother you guys, I read that you are authors of that addon in the description. This issue has been reported multiple times (about 4 already in bug reporter). I think it has been overlooked because of a lot of status changes and the duplicate tasks are getting merged. This bug prevents from using Ctrl + Shift + T when textures are on the different drive in 2.83 LTS.

Added subscribers: @Odds57, @Jackie-1

Added subscribers: @Odds57, @Jackie-1

Added subscriber: @GustavoSilva

Added subscriber: @GustavoSilva

Added subscriber: @smramsay

Added subscriber: @smramsay

I don't have Windows to test this on so I don't feel comfortable submitting a fix, but I'm pretty sure this is the problem:
The error is caused by the 'Relative Path' option being enabled by default.
Python's os.path.relpath function, which is ultimately called, doesn't work across drives on Windows.
If you don't want to wait for a fix to be commited, disabling 'Relative Path' option each time in the file browser's N-Panel should fix it.
relative-path-option.jpg

This patch should fix it by falling back to using the absolute path if it fails to get the relative in any situation.
Again though, I can't test it.

diff --git a/node_wrangler.py b/node_wrangler.py
index e9ba5e74..cdb609a4 100644
--- a/node_wrangler.py
+++ b/node_wrangler.py
@@ -3019,7 +3019,11 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper):
         import_path = self.directory
         if self.relative_path:
             if bpy.data.filepath:
-                import_path = bpy.path.relpath(self.directory)
+                try:
+                    import_path = bpy.path.relpath(self.directory)
+                except ValueError:
+                    self.report({'WARNING'}, 'Failed to get relative path, defaulting to absolute.')
+                    print('Failed to get relative path, defaulting to absolute.')
             else:
                 self.report({'WARNING'}, 'Relative paths cannot be used with unsaved scenes!')
                 print('Relative paths cannot be used with unsaved scenes!')

I don't have Windows to test this on so I don't feel comfortable submitting a fix, but I'm pretty sure this is the problem: The error is caused by the 'Relative Path' option being enabled by default. Python's `os.path.relpath` function, which is ultimately called, doesn't work across drives on Windows. If you don't want to wait for a fix to be commited, disabling 'Relative Path' option each time in the file browser's N-Panel should fix it. ![relative-path-option.jpg](https://archive.blender.org/developer/F8654277/relative-path-option.jpg) This patch *should* fix it by falling back to using the absolute path if it fails to get the relative in any situation. Again though, I can't test it. ``` diff --git a/node_wrangler.py b/node_wrangler.py index e9ba5e74..cdb609a4 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -3019,7 +3019,11 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): import_path = self.directory if self.relative_path: if bpy.data.filepath: - import_path = bpy.path.relpath(self.directory) + try: + import_path = bpy.path.relpath(self.directory) + except ValueError: + self.report({'WARNING'}, 'Failed to get relative path, defaulting to absolute.') + print('Failed to get relative path, defaulting to absolute.') else: self.report({'WARNING'}, 'Relative paths cannot be used with unsaved scenes!') print('Relative paths cannot be used with unsaved scenes!') ```

Added subscribers: @neail, @Harvester

Added subscribers: @neail, @Harvester
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

@smramsay: thx for that code, will double-check that and commit if no complaints.

To all others: You can also just uncheck Relative Path in this situation and it should work. (but agree this should be handled more gracefully)
image.png

@smramsay: thx for that code, will double-check that and commit if no complaints. To all others: You can also just **uncheck** Relative Path in this situation and it should work. (but agree this should be handled more gracefully) ![image.png](https://archive.blender.org/developer/F8643936/image.png)
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Philipp Oeser self-assigned this 2020-09-18 15:02:54 +02:00
Member

Added subscriber: @gyanenmhz

Added subscriber: @gyanenmhz
Philipp Oeser changed title from Node Wrangler - Principled Texture Setup no longer works in Blender 2.83 beta to Node Wrangler - Principled Texture Setup error (with Relative Path option and blendfile and textures are on different drives) 2020-09-18 15:05:24 +02:00
Member

Added subscriber: @cg_petey

Added subscriber: @cg_petey

Added subscriber: @clarrot

Added subscriber: @clarrot

I manage to uncheck the relative paths, but my Ctrl+T for wrangler still doesn't work.
image.png

I manage to uncheck the relative paths, but my Ctrl+T for wrangler still doesn't work. ![image.png](https://archive.blender.org/developer/F9117033/image.png)
Member

Added subscriber: @V-prime

Added subscriber: @V-prime
Member

In #77022#1043492, @clarrot wrote:
I manage to uncheck the relative paths, but my Ctrl+T for wrangler still doesn't work.
image.png

That is the one in preferences (not sure this is used in the Addon), but you have the one for the operator as well [sidebar in the file browser]
If it is hidden, use {key N} or the gear icon to show the sidebar
image.png

> In #77022#1043492, @clarrot wrote: > I manage to uncheck the relative paths, but my Ctrl+T for wrangler still doesn't work. > ![image.png](https://archive.blender.org/developer/F9117033/image.png) That is the one in preferences (not sure this is used in the Addon), but you have the one for the operator as well [sidebar in the file browser] If it is hidden, use {key N} or the gear icon to show the sidebar ![image.png](https://archive.blender.org/developer/F9133745/image.png)
Member

Added subscriber: @sprawa

Added subscriber: @sprawa
Philipp Oeser removed their assignment 2020-11-17 14:17:31 +01:00
Member

Added subscriber: @MacherTV_Peter

Added subscriber: @MacherTV_Peter
Member

Added subscriber: @GrzegorzChrymecki

Added subscriber: @GrzegorzChrymecki

Added subscriber: @NaouriRedouane

Added subscriber: @NaouriRedouane

Added subscriber: @ericklestrange

Added subscriber: @ericklestrange

same issue, getting "no matching images found"

same issue, getting "no matching images found"
Member

Added subscriber: @blitzplayz

Added subscriber: @blitzplayz

Added subscriber: @IyadAhmed

Added subscriber: @IyadAhmed

issue still exists, a solution is to use absolute path instead
image.png

issue still exists, a solution is to use absolute path instead ![image.png](https://archive.blender.org/developer/F10282956/image.png)
Eyad Ahmed self-assigned this 2021-08-16 00:12:14 +02:00

This issue was referenced by e37389de77

This issue was referenced by e37389de7721eed6d74c91c9c70a718af6a9846c

This issue was referenced by cc971e509d

This issue was referenced by cc971e509d26484cc00bf89af7d2599d7dcab34e

This issue was referenced by fe12f8b975

This issue was referenced by fe12f8b97589baf56bf02a53cd73fc495a89909f

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

Added subscribers: @catangus, @rjg

Added subscribers: @catangus, @rjg
Sign in to join this conversation.
No Milestone
No project
No Assignees
12 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#77022
No description provided.