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

Fix material drag and drop #84486

Merged

Conversation

jcostello
Copy link
Contributor

My first PR 😄

Fixes: #74077

Explanation: When dragging over meshes with the same material (as the one dragged) and going over other mesh, material preview were reset but never assign again, causing to have a wrong state

@fire
Copy link
Member

fire commented Nov 5, 2023

@SaracenOne you might be interested in looking at this one.

@SaracenOne SaracenOne self-assigned this Nov 6, 2023
Copy link
Member

@SaracenOne SaracenOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Though it doesn't quite fix it completely because the issue persists when using per-surface overrides (with the CTRL modifier).

My suggestion for fixing this fully is adding:
spatial_editor->set_preview_material_surface(-1); to line 4255

And removing it from line 4274

@jcostello
Copy link
Contributor Author

Good catch! Though it doesn't quite fix it completely because the issue persists when using per-surface overrides (with the CTRL modifier).

Weird, I test it with CTRL and seems to be fixed. But I will re-test and try your solution

@jcostello
Copy link
Contributor Author

@SaracenOne I applied that change. Seems to work fine

I also tried to remove the material override when ctrl is pressed. If there is a material override and you applied a surface override, you wont see anything because the material override is over everything. I couldn't make that change because when reseting the material, the surface information were lost because we only store the material of the last surface

Copy link
Member

@SaracenOne SaracenOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@akien-mga akien-mga changed the title Fix material drop Fix material drag and drop Jan 4, 2024
@akien-mga akien-mga merged commit 3224e47 into godotengine:master Jan 4, 2024
15 checks passed
@akien-mga
Copy link
Member

akien-mga commented Jan 4, 2024

Thanks! And congrats for your first merged Godot contribution 🎉

@jcostello
Copy link
Contributor Author

@akien-mga thanks <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment