Hi,
i got some issues assigning a material to a modified mesh.
For some reason after assigning the material, it is not display correctly.
When i check with get_active_material(0), the material is listed correct.
var mdt = MeshDataTool.new()
var nd = this_obj_reference.find_node("object")
var mesh = nd.get_mesh()
mdt.create_from_surface(mesh, 0)
....
-#then some code to change the vertex color
mdt.set_vertex_color(vtx, Color(0,0,0,1))
.....
mesh.surface_remove(0)
mdt.commit_to_surface(mesh)
var mi = MeshInstance.new()
mi.mesh = mesh
-#get the material from my "old" object
var my_mat = this_obj_reference.find_node("object").get_active_material(0)
mi.set_surface_material(0,my_mat)
The picture shows the result.
First small picture before, second after the operation.
On the object, there is a shadermaterial, if a vertex color is black, it will show transparent.
But on the new mesh, it shows just the mesh without shadermaterial.
Any ideas?
Best Regards
Andreas

