Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to get which UVW map channel is actully being used with C++?

How to get which UVW map channel is actully being used with C++?

jeremyliu1989
Enthusiast Enthusiast
486 Views
2 Replies
Message 1 of 3

How to get which UVW map channel is actully being used with C++?

jeremyliu1989
Enthusiast
Enthusiast

Hey guys,

 

I want to get the actual using UVW map channel with C++. For now, I could enum all the UVW map channels of mesh with Meshmap and that class also has a function as follows:

 

BOOL IsUsed () const
 Returns TRUE if this mapping channel is being used; otherwise FALSE.

 

However, it always returns TRUE when I call this function with multi UVW map channels.

 

Actually, the mesh has been collapsed after apply a UVW map modifier. Does the IsUsed() function not work with a collapsing mesh? Or should I do some other operations before calling this function?

 

If you have any suggestions about my problems are very welcome. Thanks for your help in advance.

0 Likes
487 Views
2 Replies
Replies (2)
Message 2 of 3

jeremyliu1989
Enthusiast
Enthusiast

Up, Up, Up. I need your help~

0 Likes
Message 3 of 3

denisT.MaxDoctor
Advisor
Advisor

you need to know that some channel is not just used but used in a certain way... let's say as map texture channel by a specific modifier. So in this case you have to ask the modifier what channel it uses.

 

If all modifiers are collapsed, it is impossible to say how a supported channel is used. You can only know that the channel is supported or not, and it is initialized enough to be used as a map texture channel. (usually it means that the number of geo faces in the mesh is the same as the number of map faces in the channel)

 

Another way is to ask the applied material or shader what map channel(s) it needs, and check it they are supported and built. 

 

I know that sometimes content creators mark map channels to indicate their meaning (usage). But these are their own rules, and therefore a special case.

 

0 Likes