Notifications
Clear all

[Closed] How to know if a texmap is displayed in viewport

Hello fellaz,

We have this showTextureMap function which activates the display of a texmap or a shader in the viewport.
It’s possible to know if a shader is displayed using the .showInViewport value, but this member doesn’t exist for texmap objects.

Do you know a way to determinate if a Texmap is currently displayed (even C# answers are welcome) ?

Thx dolby surround.

3 Replies

Try this.


(getMTLMEditFlags $.mat.diffusemap)[6]

Change “diffusemap” for the texture mapyou need.
Not fully tested.

Thanks a lot, I give it a try right now !
Nice magic number by the way, the mxs help doesn’t mention that value !

@Jorge: nice one!

@Laurent: this is from the method itself:

	flags.Set(0,(mtl->TestMtlFlag(MTL_BEING_EDITED))); // read-only
	flags.Set(1,(mtl->TestMtlFlag(MTL_MEDIT_BACKGROUND)));
	flags.Set(2,(mtl->TestMtlFlag(MTL_MEDIT_BACKLIGHT)));
	flags.Set(3,(mtl->TestMtlFlag(MTL_MEDIT_VIDCHECK)));
	flags.Set(4,(mtl->TestMtlFlag(MTL_SUB_DISPLAY_ENABLED))); // read-only
	flags.Set(5,(mtl->TestMtlFlag(MTL_TEX_DISPLAY_ENABLED))); // read-only
	flags.Set(6,(mtl->SupportTexDisplay())); // read-only