Copy material in C++?


Doing that in maxscript is trivial just:

objectA.material = copy objectB.material = "whateveryouwant"

Unfortunately using Clone in 3dsmax retrieves a ReferenceTarget* data instead of a new Material pointer.

Anyone has any tip?

Thank you!



Mtl* clonedMat = reinterpret_cast<Mtl*> (originalMat->Clone());

work ?


My bad I didn’t noticed that I can cast the return data to a Mtl pointer!