I'm using MaxScript (2010) to create a Standard Material with a diffuse map and applying it to an existing Editable Mesh (with UVW modifier), like this:
for m in selection do
if classof m==Editable_Mesh do
newMtl = myCreateMaterialFunction
m.material = newMtl
The script seems to run fine, but I do not see the diffuse map in the view-port. When I use the material 'picker' tool (next to the material name on the Material Editor) to confirm that my material was applied, the diffuse map suddenly appears in the view-port! Also, the material looks correct in the M Editor, so I think my code is working correctly, except for the view-port issue.
Does anyone know what value is being changed so that I am able to see the material suddenly start working in the view-port? I would like my script to make sure the view-port shows properly without needing to 'tickle' each mesh.
Thanks for any help!