Hi guys. I’m trying to act on a material after I drag&drop it to another slot.
This is just an example script:
fn replaceMat =
(
mat = callbacks.notificationParam()
slot = medit.GetActiveMtlSlot() – as #mtlRefAdded is called when you drop a material in another slot in the material editorif mat (something something) do
(
tempMaterials = loadTempMaterialLibrary “C:\matLib.mat”
medit.PutMtlToMtlEditor tempMaterials[1] slot
)
)callbacks.addScript #mtlRefAdded “replaceMat()”
this crashes max. I think this happens, because #mtlRefAdded is called several times after dropping a material to the slot, but when I change the material during that operation - something goes south. How can I execute my replacement AFTER all the #mtlRefAdded are finished? Or should I use some other callback event that happens after that? What is the order of events inside 3dsMAX ?
