Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Faulty GamePath hendling #179

Open
nilBrain opened this issue Sep 22, 2023 · 5 comments
Open

[Bug Report] Faulty GamePath hendling #179

nilBrain opened this issue Sep 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@nilBrain
Copy link

The path specifications are not referenced to the BaseGame.
Example:

I3D Shader Settings | Shader Source: D:\Program Files (x86)\Steam\steamapps\common\Farming Simulator 22\data\shaders\vehicleShader.xml

Add-Ons | FS Data Folder: D:\Program Files (x86)\Farming Simulator 2022\data\

When exporting, the Shader Source path is used and not the Game Data Path.

Log file:
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\node_classes\material.py", line 43, in populate_xml_element
self._export_shader_settings()
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\node_classes\material.py", line 158, in export_shader_settings
shader_file_id = self.i3d.add_file_shader(shader_settings.source)
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\i3d.py", line 229, in add_file_shader
return self.add_file(Shader, path_to_file)
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\i3d.py", line 217, in add_file
file = file_type(file_id, self, path_to_file)
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\node_classes\file.py", line 33, in init
super().init(id
, i3d, None)
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\node_classes\node.py", line 43, in init
self._create_xml_element()
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\node_classes\file.py", line 55, in _create_xml_element
self._resolve_filepath()
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\node_classes\file.py", line 64, in _resolve_filepath
self._copy_file()
File "C:\Users\userX\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\i3dio\node_classes\file.py", line 106, in _copy_file
shutil.copy(bpy.path.abspath(self.blender_path), write_directory)
File "D:\Program Files\Blender Foundation\Blender 3.4\3.4\python\lib\shutil.py", line 417, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "D:\Program Files\Blender Foundation\Blender 3.4\3.4\python\lib\shutil.py", line 254, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\Program Files (x86)\Steam\steamapps\common\Farming Simulator 22\data\shaders\vehicleShader.xml'

@nilBrain nilBrain added bug Something isn't working Needs Auditing Issues that should be audited by a dev before being considered labels Sep 22, 2023
@StjerneIdioten
Copy link
Owner

Do you have FS in two places? Or how did you end up in a situation where selecting a shader from the game doesn't have the same path as the game? If I recall correctly the shader export code does compare it's own paths with the FS Data folder and correctly does the $Data replacement, but in your case the paths aren't the same and thus it considers the shader to be a custom shader and tries to copy it. But apparently the folder path you have selected the shader from doesn't actually exists?

@StjerneIdioten
Copy link
Owner

@NMC-TBone I know that you are looking into this a bit. PR #170 is tangibly related to this and if it isn't already solved by your solution, it should at least be consider to get that one out of the way as well in the same go 😅

@nilBrain
Copy link
Author

Do you have FS in two places? Or how did you end up in a situation where selecting a shader from the game doesn't have the same path as the game? If I recall correctly the shader export code does compare it's own paths with the FS Data folder and correctly does the $Data replacement, but in your case the paths aren't the same and thus it considers the shader to be a custom shader and tries to copy it. But apparently the folder path you have selected the shader from doesn't actually exists?

It is a Team File...
Member01 started ingaming, handed it over to me. He has FS in Steam, I from the eShop.

When several People are working on a blend file, it becomes quite exhausting to always adjust the path 😅

@StjerneIdioten
Copy link
Owner

It is a Team File... Member01 started ingaming, handed it over to me. He has FS in Steam, I from the eShop.

When several People are working on a blend file, it becomes quite exhausting to always adjust the path 😅

Ahhh, that has never been supported by the shader picker though, by (poor) design 😆 But we are looking into changing it 👍🏻

@StjerneIdioten StjerneIdioten removed the Needs Auditing Issues that should be audited by a dev before being considered label Oct 27, 2023
@StjerneIdioten
Copy link
Owner

On top of the shaders I suppose using images from the $data folder would also be a problem for sharing .blend files in a team. It should be fairly easy to check and fix that though: https://blender.stackexchange.com/questions/280337/find-missing-files-per-script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants