Hi,
Since a lot of people get confused about this matter, I’ll take some time to explain what really happens behind the scenes in details
Although the above is a valid solution, there is a simple alternative to that.
But let me first explain why this happens
First
In Rhino the mapping is actually a separate object. It is rather a generator, that is associated with specific Rhino geometric objects. Rhino keeps a table where for every object zero or more custom mappings are associated. For newly created objects - there is no association.
Second
Most Rhino objects does not have UV mapping, because they don’t have fixed vertices and faces - like breps or nurbs, or renderable curves. By “vertices” I mean triangulated mesh points.
During rendering export, all such objects are converted to meshes (triangles) that have fixed vertices, and can also hold UV coordinates. After the conversion the associated mapping object generates actual UV values for the mesh vertices.
And Third
In Rhino there is no local coordinate system. That means once you move (for example) an object, that object is copied at the new location, and then the old one is deleted. In most of the cases people work with trimmed surfaces or breps, not actual meshes,
so that strategy is super fast - much faster than copying & transforming huge number of vertices/normals/faces, etc.. breps are really tiny structures.
Combining all that into one is what happens in GH. Consider the following graph:
When you reference a Rhino object, your component holds not an actual geometry, but a reference to a Rhino geometry. Including possible associated mappings.
When you move the object, the result is just “Brep” - not a referenced any more. It is a modified copy of the original, but since it has a different ID, there is no associated mapping to that instance - hence nowhere to take the UVs from.
Mind that we’re talking Breps here, and they intrinsically do not hold any faces/vertices nor UVs. Once you render them, V-Ray will ask Rhino to mesh the object, considering any associated mappings, and the result will have the expected UVs.
For the second object - no associated mapping => no UVs. Well almost - Rhino will apply default “surface” mapping and generate “some” UVs based on some fixed logic.
Now lets consider that “Brep” thing. As it is clear already only meshes retain UVs, hence if you mesh your object in Rhino, reference it in GH (with the UVs already generated), and then move it, that will work. You will get the UVs in your copied object, just because you copy a mesh, not a brep.
Note that it still says “Referenced Mesh” and “Mesh”. When that second mesh is exported for rendering, there is no associated mapping with it, but that’s fine - there are generated UVs copied from the source object, which V-Ray will take. And that renders fine (custom spherical mapping applied):
Mind that transforming mesh in GH, also transforms its already present UVs - so rotation and scaling are also OK
Final thoughts.
If you need mapping over transformed breps in GH. It is much better to have the mapping specified in GH instead. It is not available by default, but there are plugins like Human | Food4Rhino, that creates that mapping association in Grasshopper.
V-Ray will take advantage of that as well