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

Add a method to retrieve active material from MeshInstance #35765

Merged
merged 1 commit into from
Mar 31, 2020

Conversation

clayjohn
Copy link
Member

Closes: #31558 (comment)

Adds a new method to MeshInstance. get_active_material() returns the material that will be used to draw the mesh in order of overrides.

This should help fix the confusion users have when trying to retrieve the active material. Users often set the material in the mesh and then attempt to retrieve the MeshInstance surface material override and get null.

@clayjohn clayjohn added this to the 4.0 milestone Jan 31, 2020
@clayjohn clayjohn requested a review from a team as a code owner January 31, 2020 01:26
@akien-mga akien-mga requested a review from reduz February 6, 2020 10:00
@akien-mga
Copy link
Member

Needs a rebase after the 3D nodes renaming.

@clayjohn
Copy link
Member Author

Ah, of course. And now we see the dangers of making a "simple" PR from your master branch.

@akien-mga
Copy link
Member

Well it's the same as any branch in the end, updating it shouldn't impact your other branches/PRs in any way (only future branches if you base them off master, but I assume you've been using upstream/master for your PRs since then).

@clayjohn
Copy link
Member Author

I've avoided touching my upstream master for many months. But my local master is another thing. It'll take a little got wrangling, but I should be able to get this under control. I'll do a little searching around and see if I can just move this over to another branch.

@akien-mga
Copy link
Member

akien-mga commented Mar 30, 2020

Note: By upstream I meant godotengine/godot.

You can't move the PR to another branch, you'd have to close it and create a new one.

But you can update your remote master branch easily from any local branch:

git remote clayjohn https://github.com/clayjohn/godot
git remote upstream https://github.com/godotengine/godot
git checkout clayjohn-master-fixed
git reset --hard clayjohn/master
git rebase -i upstream/master
// solve merge conflicts
git push --force clayjohn clayjohn-master-fixed:master

The key is the last command, git push's fully specified syntax is git push <remote> <local branch>:<remote branch> (so the local and remote branches can have different names).

@clayjohn clayjohn force-pushed the master branch 2 times, most recently from d8230e4 to 8885954 Compare March 30, 2020 23:52
@clayjohn
Copy link
Member Author

@akien-mga Should be good now.

Your magic worked wonders, but for some reason it wasn't picking up on the last couple commits so the docs changes weren't captured. Had to do a manual, git pull --rebase to fix that up.

@akien-mga
Copy link
Member

akien-mga commented Mar 31, 2020

Right, upstream/master actually points to your local reference of the remote branch, so you need to git fetch upstream or git pull (which does a fetch) to update that reference and get the actaul godotengine/godot master HEAD. That's Git's intuitive interface for you :P

@akien-mga akien-mga merged commit a30bfe5 into godotengine:master Mar 31, 2020
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

get_surface_material
2 participants