FBX importer fails when importing from a junction or symlink location. #104953

Closed
opened 2023-10-15 00:15:47 +02:00 by Steve-Inaba · 5 comments

System Information
Operating system: win10
Graphics card: rtx4090

Blender Version
Broken: 3.3, 3.6. 4.0
Worked: Presumably never

When importing an FBK from a system location that passes through a symlink or junction the importer will process for a while, then fail and report that the file was not found.

FileNotFoundError: [WinError 3] The system cannot find the path specified:

Exact steps for others to reproduce the error

  • System must have a junction or symlink folder bridging between two drives.
  • Import an FBX from the junction location to a blank scene. In the case of a bridge between C:\ and D:\ where the FBX exists on D:\ the import path should be through C:\symlink_folder\file.fbx
  • The process will churn for a while and eventually fail.

No sample file because this is system configuration dependent.

**System Information** Operating system: win10 Graphics card: rtx4090 **Blender Version** Broken: 3.3, 3.6. 4.0 Worked: Presumably never When importing an FBK from a system location that passes through a symlink or junction the importer will process for a while, then fail and report that the file was not found. `FileNotFoundError: [WinError 3] The system cannot find the path specified:` **Exact steps for others to reproduce the error** - System must have a junction or symlink folder bridging between two drives. - Import an FBX from the junction location to a blank scene. _In the case of a bridge between C:\ and D:\ where the FBX exists on D:\ the import path should be through C:\symlink_folder\file.fbx_ - The process will churn for a while and eventually fail. No sample file because this is system configuration dependent.
Steve-Inaba added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-10-15 00:15:47 +02:00
Member

Importing through a symlink or junction works fine here, please post the full error.

Importing through a symlink or junction works fine here, please post the full error.
Author

Please excuse the gibberish folder names, but out of concern for adhering NDA I've scrambled the names while keeping the same character count in the very off chance there were a character limit issue.

Read prefs: "C:\Users\steveinaba\AppData\Roaming\Blender Foundation\Blender\3.6\config\userpref.blend"
Info: Deleted 3 object(s)

FBX version: 7700
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\__init__.py", line 207, in execute
    if import_fbx.load(self, context, filepath=path, **keywords) == {'FINISHED'}:
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2891, in load
    _(); del _
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2885, in _
    fbx_item[1] = blen_read_texture_image(fbx_tmpl_img, fbx_obj, basedir, settings)
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 1760, in blen_read_texture_image
    image = image_utils.load_image(
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy_extras\image_utils.py", line 156, in load_image
    bpy.path.resolve_ncase(filepath_test),
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 327, in resolve_ncase
    ncase_path, found = _ncase_path_found(path)
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 296, in _ncase_path_found    dirpath, found = _ncase_path_found(dirpath)
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 296, in _ncase_path_found    dirpath, found = _ncase_path_found(dirpath)
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 306, in _ncase_path_found    files = _os.listdir(dirpath)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\files\\new\\junct_folderd\\xyx\\sources5\\sources5_cur\\cal_to_hela_larger\\textures\\vip_xyx_map_to_hela_larger_bungo1\\Assets\\Models\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\Users\\steveinaba\\Downloads\\A136371TLirLirp_TouringP000A1\\A136371TLirLirp_TouringP000A1CutsPart1'

FBX location through junction, where junct_folderd is the link folder to a separate drive: C:\files\new\junct_folderd\xyx\sources5\sources5_cur\cal_to_hela_larger\textures\vip_xyx_map_to_hela_larger_bungo1\Assets\Models\

The associated texture map does exist and is pathed at: Users\steveinaba\Downloads\A136371TLirLirp_TouringP000A1\A136371TLirLirp_TouringP000A1CutsPart1\text\'A136371TLirLirp_TouringP000A1CutsPart1.fbm\A136371TLirLirp_TouringP000A1CutsPart1_50M16K_u1_v1.png
This is correct to what is in the FBX itself when checking it with n++.

Please excuse the gibberish folder names, but out of concern for adhering NDA I've scrambled the names while keeping the same character count in the very off chance there were a character limit issue. ``` Read prefs: "C:\Users\steveinaba\AppData\Roaming\Blender Foundation\Blender\3.6\config\userpref.blend" Info: Deleted 3 object(s) FBX version: 7700 Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\__init__.py", line 207, in execute if import_fbx.load(self, context, filepath=path, **keywords) == {'FINISHED'}: File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2891, in load _(); del _ File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2885, in _ fbx_item[1] = blen_read_texture_image(fbx_tmpl_img, fbx_obj, basedir, settings) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 1760, in blen_read_texture_image image = image_utils.load_image( File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy_extras\image_utils.py", line 156, in load_image bpy.path.resolve_ncase(filepath_test), File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 327, in resolve_ncase ncase_path, found = _ncase_path_found(path) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 296, in _ncase_path_found dirpath, found = _ncase_path_found(dirpath) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 296, in _ncase_path_found dirpath, found = _ncase_path_found(dirpath) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\modules\bpy\path.py", line 306, in _ncase_path_found files = _os.listdir(dirpath) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\files\\new\\junct_folderd\\xyx\\sources5\\sources5_cur\\cal_to_hela_larger\\textures\\vip_xyx_map_to_hela_larger_bungo1\\Assets\\Models\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\Users\\steveinaba\\Downloads\\A136371TLirLirp_TouringP000A1\\A136371TLirLirp_TouringP000A1CutsPart1' ``` FBX location through junction, where `junct_folderd` is the link folder to a separate drive: `C:\files\new\junct_folderd\xyx\sources5\sources5_cur\cal_to_hela_larger\textures\vip_xyx_map_to_hela_larger_bungo1\Assets\Models\` The associated texture map does exist and is pathed at: `Users\steveinaba\Downloads\A136371TLirLirp_TouringP000A1\A136371TLirLirp_TouringP000A1CutsPart1\text\'A136371TLirLirp_TouringP000A1CutsPart1.fbm\A136371TLirLirp_TouringP000A1CutsPart1_50M16K_u1_v1.png` This is correct to what is in the FBX itself when checking it with n++.

Windows itself has a 260 character limit on paths which might be part of the problem here: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

The path from the original error message is cut off very close to that limit. You can see it's not actually the entire path and is missing the remaining \text\'A136371TLirLirp_TouringP000A1CutsPart1.fbm\A136371TLirLirp_TouringP000A1CutsPart1_50M16K_u1_v1.png portion of the filepath.

Windows itself has a 260 character limit on paths which might be part of the problem here: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation The path from the original error message is cut off very close to that limit. You can see it's not actually the entire path and is missing the remaining `\text\'A136371TLirLirp_TouringP000A1CutsPart1.fbm\A136371TLirLirp_TouringP000A1CutsPart1_50M16K_u1_v1.png` portion of the filepath.
Member

The error has occurred in the bpy.path module called from the bpy_extras.image_utils module, both of which are part of Blender's Python API and not the FBX importer, so I think it's likely that if there is a code issue here, the issue should be re-created over at https://projects.blender.org/blender/blender/issues.

Going to line 1760 of C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py and adding the verbose=True argument to the function call will print the imagepath(filepath) and dirname arguments, that were passed to the bpy_extras.image_utils.load_image function, to the System Console. Printing something like load_image('<imagepath>', '<dirname>', ...).
If what's printed is not the unscrambled equivalents of
C:\files\new\junct_folderd\xyx\sources5\sources5_cur\cal_to_hela_larger\textures\vip_xyx_map_to_hela_larger_bungo1\Assets\Models\..\..\..\..\..\..\..\..\..\..\..\Users\steveinaba\Downloads\A136371TLirLirp_TouringP000A1\A136371TLirLirp_TouringP000A1CutsPart1.fbm\A136371TLirLirp_TouringP000A1CutsPart1_50M16K_u1_v1.png
and
C:\files\new\junct_folderd\xyx\sources5\sources5_cur\cal_to_hela_larger\textures\vip_xyx_map_to_hela_larger_bungo1\Assets\Models\, then I would mention what they actually were.

    image = image_utils.load_image(
        filepath,
        dirname=basedir,
        place_holder=True,
        recursive=settings.use_image_search,
        verbose=True,  # New line
        )

I did notice that the path from the original error message is cut off before the . in the directory containing a . character, but I can't think of any reasons why the path might accidentally be cut off at a . specifically.


A little odd is that looking at the line of code that raised the error, in order to call _os.listdir(dirpath), it must have first passed the _os.path.isdir(dirpath) check that checks whether the path is a directory that exists (_os is just an alias of the os module in the file in question).

The error has occurred in the `bpy.path` module called from the `bpy_extras.image_utils` module, both of which are part of Blender's Python API and not the FBX importer, so I think it's likely that if there is a code issue here, the issue should be re-created over at https://projects.blender.org/blender/blender/issues. Going to line 1760 of `C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py` and adding the `verbose=True` argument to the function call will print the `imagepath`(`filepath`) and `dirname` arguments, that were passed to the `bpy_extras.image_utils.load_image` function, to the System Console. Printing something like `load_image('<imagepath>', '<dirname>', ...)`. If what's printed is not the unscrambled equivalents of `C:\files\new\junct_folderd\xyx\sources5\sources5_cur\cal_to_hela_larger\textures\vip_xyx_map_to_hela_larger_bungo1\Assets\Models\..\..\..\..\..\..\..\..\..\..\..\Users\steveinaba\Downloads\A136371TLirLirp_TouringP000A1\A136371TLirLirp_TouringP000A1CutsPart1.fbm\A136371TLirLirp_TouringP000A1CutsPart1_50M16K_u1_v1.png` and `C:\files\new\junct_folderd\xyx\sources5\sources5_cur\cal_to_hela_larger\textures\vip_xyx_map_to_hela_larger_bungo1\Assets\Models\`, then I would mention what they actually were. ```py image = image_utils.load_image( filepath, dirname=basedir, place_holder=True, recursive=settings.use_image_search, verbose=True, # New line ) ``` --- I did notice that the path from the original error message is cut off before the `.` in the directory containing a `.` character, but I can't think of any reasons why the path might accidentally be cut off at a `.` specifically. --- A little odd is that looking at the [line of code that raised the error](https://projects.blender.org/blender/blender/src/branch/blender-v3.6-release/scripts/modules/bpy/path.py#L306), in order to call `_os.listdir(dirpath)`, it must have first passed the `_os.path.isdir(dirpath)` check that checks whether the path is a directory that exists (`_os` is just an alias of the `os` module in the file in question).
Member

Going through the discussion, the issue here seems to be related to reading filepath or path limit, and not related to FBX i/o
Closing in that case. Please report bug at https://projects.blender.org/blender/blender/issues with possible way of redoing it locally.

Going through the discussion, the issue here seems to be related to reading filepath or path limit, and not related to FBX i/o Closing in that case. Please report bug at https://projects.blender.org/blender/blender/issues with possible way of redoing it locally.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-11-10 07:28:31 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#104953
No description provided.