You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
Sometimes while exporting 3D-Models with Materials from Blender to Godot, the Shadernode-Names the Export-Addon generates, while converting Shader-Nodes to a Shader-Code, are to long. Now if the Names are to long, the commented Section in the Shader-Code will exceed the "SCRIPT_MAX_WIDTH = 80" and will add a Line Break, which will generate following Compiler-Error in Godot:
After some tinkering in the ../io_scene_godot/converters/material/script_shader/node_tree.py File I came up with the following "solution":
Between Line 122 and 123 I added: self._fragment_code_lines.append("/*") and
between Line 161 and 162 I added: self._fragment_code_lines.append("// */")
After the "Hack" the Shader-Code is as follows:
Now I am a Beginner when it comes to coding and I don't know if this Fix is passable, or not. I attached the Blender-File with the Material the Error occurs with and the changed node_tree.py File
Minimal reproduction project:
Export the Cube from the given Blender-Project with the Godot-Exporter Addon and "Generate external Material" ticked on
OS:
Windows 10 and ArchLinux (5.17.5-arch1-1)
Godot version:
3.4.2 and 3.4.4
Blender version:
3.0 and 3.1
Issue description:
Sometimes while exporting 3D-Models with Materials from Blender to Godot, the Shadernode-Names the Export-Addon generates, while converting Shader-Nodes to a Shader-Code, are to long. Now if the Names are to long, the commented Section in the Shader-Code will exceed the "SCRIPT_MAX_WIDTH = 80" and will add a Line Break, which will generate following Compiler-Error in Godot:
After some tinkering in the ../io_scene_godot/converters/material/script_shader/node_tree.py File I came up with the following "solution":
Between Line 122 and 123 I added:
self._fragment_code_lines.append("/*")
andbetween Line 161 and 162 I added:
self._fragment_code_lines.append("// */")
After the "Hack" the Shader-Code is as follows:
Now I am a Beginner when it comes to coding and I don't know if this Fix is passable, or not. I attached the Blender-File with the Material the Error occurs with and the changed node_tree.py File
Minimal reproduction project:
Export the Cube from the given Blender-Project with the Godot-Exporter Addon and "Generate external Material" ticked on
Blender and PythonFile.zip
I hope this will have some use and have a great Day you all :)
The text was updated successfully, but these errors were encountered: