Implement a way to override material textures on a ModelInstance:
Materials will have a default textures array containing each subimage from its Image.
ModelInstance::override_texture(_submodel, _textures) takes a submodel index and an array of textures. You can get the texture of a Canvas and place it into the input array, for example.
The texture arrays are then stored in the ModelInstance::override_textures array where each index corresponds to a submodel index. If an element is undefined, then the textures of the current skin on the submodel are used.
Texture arrays will also be stored in the submodels cache to make lookups faster.
Implement a way to override material textures on a
ModelInstance
:textures
array containing each subimage from its Image.ModelInstance::override_texture(_submodel, _textures)
takes a submodel index and an array of textures. You can get the texture of a Canvas and place it into the input array, for example.ModelInstance::override_textures
array where each index corresponds to a submodel index. If an element isundefined
, then the textures of the current skin on the submodel are used.