-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Fix emission_shape_changed
signal error when using ShaderMaterial with GPUParticles3D
#101617
Fix emission_shape_changed
signal error when using ShaderMaterial with GPUParticles3D
#101617
Conversation
scene/3d/gpu_particles_3d.cpp
Outdated
if (process_material.is_valid()) { | ||
material_rid = process_material->get_rid(); | ||
} else if (cast_to<ParticleProcessMaterial>(*process_material)) { | ||
process_material->connect("emission_shape_changed", callable_mp((Node3D *)this, &GPUParticles3D::update_gizmos)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work, since the process_material.is_valid()
condition is true, so it will never evaluate the else if
.
It should be:
if (process_material.is_valid()) { | |
material_rid = process_material->get_rid(); | |
} else if (cast_to<ParticleProcessMaterial>(*process_material)) { | |
process_material->connect("emission_shape_changed", callable_mp((Node3D *)this, &GPUParticles3D::update_gizmos)); | |
} | |
if (process_material.is_valid()) { | |
material_rid = process_material->get_rid(); | |
if (Ref<ParticleProcessMaterial>(process_material).is_valid()) { | |
process_material->connect("emission_shape_changed", callable_mp((Node3D *)this, &GPUParticles3D::update_gizmos)); | |
} | |
} |
emission_shape_changed
signal error when using ShaderMaterial with 3DGPUParticlesNode
emission_shape_changed
signal error when using ShaderMaterial with 3DGPUParticlesNodeemission_shape_changed
signal error when using ShaderMaterial with GPUParticles3D
There are some more issues with #100113 and its follow-up #101537:
|
3bc5c7c
to
1d83a95
Compare
Alright, I think I have solved the problem with I tested the various problem cases removing and re-adding the same material, adding a ShaderMaterial instead, using the same material on several GPUParticles3D Nodes and haven't encountered any errors or crashes (together with #101636 that is). |
1d83a95
to
484d6d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be good to get this field-tested early
Thanks! |
Fixes #100113 (comment)