[Closed] Get Map Channel seen in viewports
I’ll try to explain my problem…
I open a scene and have an object with a texture applied (I can see it in shaded viewports). What I want, if possible, is to know in wich MapChannel lies this texture I’m seeing.
Better in SDK.
The only thing I’ve reached is:
node.Mtls.Texture[0].MapChannel;
but, of course, it’s not always the map channel I’m looking for.
Sorry. I can not understand your question. Could you ask the same question somehow else, please?
In general case, texture does not correspond any channel. Material with a specified texture might, but not a texture itself…
it’s a complex task…
#1 you can check what faces are visible in viewport (doing ray-mesh intersection as well)
#2 check faces ids and find material
#3 check what textures this material uses, and find what you need by specified Bitmap
you can cast every material to Mtl* and ask GetMapChannel
you can ask every TextureMap and GetMapChannel
you can find texture’s UVGen and ask GetMapChannel
the problem is – all these are virtual methods. So for some 3d-party materials and textures it might not be defined right, because it’s up to developers to implement it.
Thanks DenisT.
Too complex then. It was just to select a default channel to apply the new mapping in case the user don’t specify it.
As I allow ‘undo’, I don’t think it worth the effort.