UV mapping

Hi All,
I am still having problems with our custom UV unwrapping method. I have the following issues that I cannot solve:

  • Surface UV mapping, I cannot assign a custom mapping to a surface (and before that retrieve the current render mesh)
  • UV editor mesh, is there a way to understand the 2D unwrapped mesh to which original mesh is connected?
  • Whenever I assign my UVs to a mesh, if the object already had UVs my custom UVs are overridden. It seems to me that there is some sort of a cache that is used instead of the mesh geometry’s UVs.

any ideas?

Thanks a lot,
Alberto

Hi Alberto,

First some guidelines that are good to remember when working with texture coordinates on surfaces and polysurfaces:

  1. Texture coordinates are defined by texture mappings. Default texture mapping is surface parameter mapping. It uses the surface parameterisation to generate texture coordinates.
  2. Custom render mesh providers can modify the shape of an object and also override its texture coordinates.
  3. Render meshes are created and controlled by Rhino core and any changes to them have undefined behavior.

Custom mapping is a special type of texture mapping. It is used to apply texture coordinates from another geometry. This video demonstrates the idea. Custom mapping can also be set from a plug-in. This feature has been in the C++ SDK for a while and is also included in the 6.15 version of RhinoCommon (available along the first Rhino 6.15 release candidate in early May).
In general UVEditor shows the object render mesh projected to the texture coordinate space. But if the object has custom mapping and the mapping geometry is mesh then UVEditor shows the custom mapping mesh projected to texture space. This exception is due to the fact that UVEditor was originally designed to modify the texture coordinates of the custom mapping mesh.

Unwrap command applies custom mapping. It makes a copy of the render mesh, flattens it and uses the flattened vertex positions to generate texture coordinates to another copy of the render mesh which is then set as the geometry for a custom mapping.

You can use the same pattern:

  1. Make a copy of the render mesh.
  2. Modify the texture coordinates as you like.
  3. Create a new custom mapping and set the modified mesh as the mapping geometry.
  4. Set the new custom mapping as the texture mapping for the object.

Best regards,
Jussi

2 Likes

Hi Jussi!
thanks a lot for the anwser. So I will wait 6.15 to support surfaces and then if I have trouble will get back :smile:

Alberto