Notifications
Clear all

[Closed] Checking if a map is visible in the viewport

I’m setting a materials map to visible in the viewpoint using something like:


allObjects = $objects as array

showTexturemap allObjects[1].mat allObjects[1].mat.diff_color_map on

What I can’t figure out is how to check whether the materials map is already visible in the viewport before setting it.

For a material, you can just use ‘if currentMaterial.showInViewport == true’. But for maps, this doesn’t seem to work.

Thanks

2 Replies

Is anyone able to offer some guidance on this? I’ve been the relevant areas of the docs and tried some different approaches but I keep hitting a brick wall.

I’m fairly sure I’m missing something obvious, it’s so easy to check with a material I imagine it must be doable with a map as well… Maybe.

Thanks for the help

check for getMTLMEditFlags
looks like “6” flag in bitarray means “showTexture on”