I’m trying to figure out how to determine if a
Rhino.DocObjects.Texture instance is using WCS mapping in RhinoCommon. However, there doesn’t seem to be anything in the
Texture object interface to indicate which type of mapping the texture is using.
I noticed that the
Texture.MappingChannelId property seems to be -13 for WCS mapping and -14 for WCS/Box mapping but I couldn’t find any documentation confirming if that is intended or reliable behaviour. Although, this post seems to confirm the existence of hard-coded ChannelId values for certain types of mapping.
I’ve also tried to use the
Rhino.Render.RenderTexture.GetProjectionMode(), but I’m having issues matching
Texture instances to their
RenderTexture counter-part. I’ve tried to use RenderContent.FromId() but it doesn’t seem to work with “generated” textures like “Tile Textures” or “Noise Textures”, passing the ID of those
Texture instances fails to return a
RenderContent object. I’ve tried matching generated texture manually by comparing some other property than the Id, but somehow the names of those RenderTextures are all “??? 005”, and comparing the file name hidden in the Xml property didn’t give me any match with the Texture.FileName either.
At that point, my only option seems to rely on the undocumented behaviour of
Texture.MappingChannelId but I’m reluctant to do so since I could be wrong here. Could someone explain to me what is the proper way to determine the type of mapping used by a