PDA

View Full Version : StandardMaterial not showing in viewport


cyrfer
06-25-2011, 01:01 AM
Hi,
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!

denisT
06-25-2011, 02:41 AM
it's better to show your problem code. i'm absolutely sure there is something very easy to get the result...
have you checked <material>.showInViewport? ... showTextureMap ... showHWTextureMap ... ?

cyrfer
06-27-2011, 06:21 PM
"showInViewport" was the property I needed. I'm new to MaxScript, so I didn't know how to find the properties that might help. Thanks!

CGTalk Moderation
06-27-2011, 06:21 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.