Skip to content

Add a method to retrieve active material from MeshInstance

Rafał Mikrut requested to merge github/fork/clayjohn/master into master

Created by: clayjohn

Closes: https://github.com/godotengine/godot/issues/31558#issuecomment-580364068

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.

Merge request reports

Loading