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

Crash when duplicating ShaderMaterial or when making it local to scene #91306

Closed
Armynator opened this issue Apr 29, 2024 · 0 comments · Fixed by #91307
Closed

Crash when duplicating ShaderMaterial or when making it local to scene #91306

Armynator opened this issue Apr 29, 2024 · 0 comments · Fixed by #91307

Comments

@Armynator
Copy link

Armynator commented Apr 29, 2024

Tested versions

#90161 broke duplicating ShaderMaterials

Reproducible on 9286ac7
Not reproducible on c205f02

System information

Godot v4.3.dev (9286ac7) - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 Ti (NVIDIA; 31.0.15.5176) - Intel(R) Core(TM) i9-14900K (32 Threads)

Issue description

When trying to duplicate a ShaderMaterial resource by script (either GDScript or C#), the game crashes at runtime.
editor_log.txt

An alternative way to crash it is to just mark "Local to Scene" in the Resource dropdown of the ShaderMaterial in the editor.
editor_log_2.txt

Steps to reproduce

  1. Create a ShaderMaterial and assign it to a MeshInstance3D
  2. Add a script to the MeshInstance3D
  3. Call material_override.duplicate() in _ready() in the script attached to the MeshInstance3D
  4. Run the game and notice the crash

Another way to crash:

  1. Create a ShaderMaterial and assign it to a MeshInstance3D
  2. Don't add a script but mark "Local to Scene" in the ShaderMaterial Resource dropdown in editor
  3. Run the game and notice the crash

Minimal reproduction project (MRP)

Minimal project with just a ShaderMaterial and a script that calls duplicate on it.
shader_mat_repro.zip

You can use the same project to reproduce both crashes. Simply remove the script from the MeshInstance3D and mark Local to Scene for the ShaderMaterial before running the game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Immediate Blocker
Development

Successfully merging a pull request may close this issue.

2 participants