# UVW Randomization not retained in .vrmesh?

**URL:** <https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894>\
**Category:** Issues\
**Created:** [May 2, 2023, 5:25pm UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894 "2023-05-02T17:25:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![seltzdesign](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/seltzdesign/32/34753_2.png) [@seltzdesign](https://forums.chaos.com/u/seltzdesign)\
**Post date:** [May 2, 2023, 5:25pm UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/1 "2023-05-02T17:25:28Z")

</div>

I have a large number of instances in Rhino, all using the same geometry. In this first test case they are just differently transformed cubes that overlap each other slightly.

Now while they are instances I can add a UVW Placement Texture and randomize the UV of every instance (I had to select by Render ID in the material for it to work). Here is the result before with a test texture:

 ![Screenshot 2023-05-02 191914.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/8/2/8216d26137eb6a1ea0ec015d448c729815df279d.jpeg)

and the result after randomization:

 ![Screenshot 2023-05-02 192031.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/b/9/b9be0b544b7474971f442a71a6af25173a4c693d.jpeg)

As you can see its much better.

Now my problem. I want to export everything as a .vrmesh for easier handling. Rhino is terrible at dealing with large quantities of instances, so exporting everything as a .vrmesh makes sense. That way I can use it elsewhere and still change the material of it.

But how can I retain the randomization of each cube? I have tried all the Randomization methods (by instance, by object ID, etc), but once exported as a .vrmesh it no longer randomizes.

Is this even possible? If so, how? Is there some way to “bake” the randomization first?

---

<div class="post-metadata">

**Author:** ![natalia.gruzdova](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/natalia.gruzdova/32/62693_2.png) [@natalia.gruzdova](https://forums.chaos.com/u/natalia.gruzdova)\
**Post date:** [May 3, 2023, 12:58pm UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/2 "2023-05-03T12:58:41Z")

</div>

Hello @seltzdesign ,  
Thank you for your question.

When you export the whole geometry as a .vrmesh single Render ID is being applied to this Proxy Mesh. You can add the Render ID render element to see the difference before and after exporting.  
Randomization is a render time effect that Proxy Mesh does not store as an information.

That being said you have two options:

- Export your whole geometry as a . **vrscene**. In this case you can set UVW Randomization to By Render ID, By Node Handle or By Node Name. Information about materials will be stored in .vrscene and you will get the same result.
- Another option is to export one object as . **vrmesh** (box in your case) with By Render ID option and instance the Proxy Mesh itself the way you need.

 ![1_Before_exporting.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/6/3/63b4bae33b1c3ae4486f75a8310b6f4743ee845d.jpeg) ![2_Whole_mesh_export.jpg](https://europe1.discourse-cdn.com/chaosprd/original/2X/5/54f919ed17af9f6c3ba2b12b2593c042ddc8a022.jpeg) ​ ![3_Mesh_instance.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/c/1/c197ad370eed6b2b48eb4ca6444df1b5222d0333.jpeg) ![4_Proxy_scene.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/6/2/6273b83041cfaf36a3b8e64b384b0401524c11d5.jpeg)  
I am attaching an archive with a simple test scene from my screenshots (Rhino 7 / V-Ray 6.00.03).  
​  
[UVW\_Random\_mesh.zip](https://forums.chaos.com/uploads/short-url/3BczLuk435WElYnHdRFwLHWgUhB.zip) (996 KB)

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/seltzdesign/32/34753_2.png) [@seltzdesign](https://forums.chaos.com/u/seltzdesign)\
**Post date:** [May 3, 2023, 2:50pm UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/3 "2023-05-03T14:50:41Z")

</div>

Hi @natalia.gruzdova ,

Thanks for taking the time to answer again in such detail.

A single .vrmesh would be the best, since you can still change the material, which you don’t have in a .vrscene. Since you can’t really edit a .vrscene per se, using a .vrscene is not an option. Right? You can’t open a .vrscene somewhere, change the material, save and close it again? If you could that would be an option. A bit like using BlockEdit!? What would be the alternative? Open a new Rhino, import the .vrscene, make the changes, export as .vrscene again?

Using the instances of a proxy is a good idea and one we will probably do anyways.

The big advantage of exporting all instances as a .vrmesh is that the viewport performance is so much better in Rhino. Rhino is terrible at dealing with large numbers of instances (say, above 10k) and the viewport becomes super slow, even in wireframe mode. If you save and replace it as a .vrmesh the viewport is super fast.

I think it would be a nice feature to be able to have a .vrmesh, where I can set the material of the contents, but also the UVW Placement of the contents. I was just thinking: are the Cosmos assets .vrmesh or .vrscene files? It would make sense that they are .vrmesh, but if you have some model that uses lots of copies of an object, say like a picket fence, wouldn’t you want to use instances and UVW Placement for those?

A .vrscene file saves all the V-Ray settings though? So what happens if I import multiple .vrscene files into a scene?

Our usecase is the following: We have a large building we are designing, that is like a gallery for all our outputs. Each output is potentially made up of a lot of instances. So it makes sense to have a master file with the building and so on and then for each artwork there is a separate file for it, so you can still change the material at least and so that the master file is not so heavy.

We could use .3dm files and nest them as blocks, but that doesn’t take the V-Ray settings with it.

This is quite a difficult problem, because Rhino Blocks are already complex and then you have .vrscene and .vrmesh files that also have their complexities.

---

<div class="post-metadata">

**Author:** ![natalia.gruzdova](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/natalia.gruzdova/32/62693_2.png) [@natalia.gruzdova](https://forums.chaos.com/u/natalia.gruzdova)\
**Post date:** [May 4, 2023, 10:12am UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/4 "2023-05-04T10:12:30Z")

</div>

Hello @seltzdesign ,

Please see my answers below.

> A single .vrmesh would be the best, since you can still change the material, which you don’t have in a .vrscene.

In this case you can try another option with .vrscene - importing .vrscene files directly as Rhino models. The tool imports geometries, material assignments, and texture placement. [Please check our documentation for more information.](https://docs.chaos.com/display/VRHINO/V-Ray+Scene+Importer)

 ![5_Import_vrscene.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/d/7/d727397ddcec8c0f9f22610cc4f36726afa837ad.jpeg)

> A .vrscene file saves all the V-Ray settings though? So what happens if I import multiple .vrscene files into a scene?

V-Ray render settings are saved in .vrscene for purposes of further rendering with V-Ray Standalone or with Chaos Cloud for example. But when you import .vrscene in your current scene, the rendering settings of the .vrscene are not imported.

> Are the Cosmos assets .vrmesh or .vrscene files? It would make sense that they are .vrmesh, but if you have some model that uses lots of copies of an object, say like a picket fence, wouldn’t you want to use instances and UVW Placement for those?

Yes, Cosmos Assets are created as .vrmesh. When you merge any Cosmos Asset you can see that it is Proxy Mesh with standard settings. Initial model is created in a different host platform, that contrary to Rhino allows to set Face IDs or to randomize UVW placement for the objects themselves before exporting. Or none of the listed is necessary because textures are unwrapped for the whole geometry.

Please check [our documentation](https://docs.chaos.com/display/VRHINO/Proxy+Mesh) about Proxy Mesh file format, especially take a look at _The .vrmesh File Format_ description and _Notes_ about instancing proxies, perhaps it will be useful to you.

​Also, in Rhino there is another interesting option to save proxies as .vrmat files. [Please check this tutorial.](https://support.chaos.com/hc/en-us/articles/4412704786321-V-Ray-Proxy-Tutorial-Saving-proxies-as-vrmat-files)​

---

<div class="post-metadata">

**Author:** ![nikolay.bakalov](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/nikolay.bakalov/32/48732_2.png) [@nikolay.bakalov](https://forums.chaos.com/u/nikolay.bakalov)\
**Post date:** [May 9, 2023, 7:19am UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/5 "2023-05-09T07:19:31Z")

</div>

Hi, you said above:

> [@seltzdesign](#):
>
> I think it would be a nice feature to be able to have a .vrmesh, where I can set the material of the contents, but also the UVW Placement of the contents.

The UV coordinates is baked in the .vrmesh file. You can have multiple UV channels on the geometry, and you can take advantage of that to activate different UV placement.  
However all mapping is controlled by the material. That is both - UV randomization and multi-channel mapping. So I don’t really understand the formulation of your query.  
You already have multiple UV coordinates options on the same faces in the .vrmesh file, and then you set the material that adds the mapping (incl. mapping randomization).

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/seltzdesign/32/34753_2.png) [@seltzdesign](https://forums.chaos.com/u/seltzdesign)\
**Post date:** [May 9, 2023, 7:46am UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/6 "2023-05-09T07:46:23Z")

</div>

> [@natalia.gruzdova](#):
>
> When you export the whole geometry as a .vrmesh single Render ID is being applied to this Proxy Mesh. You can add the Render ID render element to see the difference before and after exporting.  
> Randomization is a render time effect that Proxy Mesh does not store as an information.​

@nikolay.bakalov I am referring to this. It would be nice if a .vrmesh that is made up of many elements, like instances of a geometry would retain the render IDs of the parts so I can randomize across them.

If I understand it correctly now a .vrmesh will not retain any instancing information and just create a single mesh out of everything? So if I have 1000 cubes instanced and turn them all into a .vrmesh, they will be one big mesh!? But in a .vrscene they remain 1000 instances of cubes with their own Render IDs and I can randomize the UV for each cube!?

But when I use a .vrscene instead of a .vrmesh, I lose the ability to change materials, correct?

It seems to me there is currently no way to consolidate 1000 cubes for example and place them in a scene as some Vray asset, where I can actually change the material of the cubes and have them remain instances? That is what I want to achieve and I don’t see how at the moment.

---

<div class="post-metadata">

**Author:** ![nikolay.bakalov](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/nikolay.bakalov/32/48732_2.png) [@nikolay.bakalov](https://forums.chaos.com/u/nikolay.bakalov)\
**Post date:** [May 9, 2023, 9:56am UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/7 "2023-05-09T09:56:36Z")

</div>

Currently what we export to a.vrmesh is baked into a single mesh, hence since node and single RenderID.  
.vrmesh itself does support objects and particle instancing, so in theory, what you need is possible. However I’m not sure whether that is exposed in the API at all

You can instead use alembic files, which all have these features natively, and are also supported by our vrmesh reader. However you will need some third-party .abc exporter in Rhino  
and also you will not get the instancing part in the viewport preview when you import an .abc file as V-Ray proxy.

On the other hand, a .vrscene is just a read-only cut of the model. It is not supposed to be modifiable.

As far as I can see, you need something like certain parts of three worlds - vrmesh, vrscenes and rhino block instancing.  
That sounds more like a smart programable object that is what Grasshopper is typically used for.

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/seltzdesign/32/34753_2.png) [@seltzdesign](https://forums.chaos.com/u/seltzdesign)\
**Post date:** [May 9, 2023, 10:03am UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/8 "2023-05-09T10:03:39Z")

</div>

Thanks for your insights. Correct, what we would need would be some kind of mix of vrmesh, vrscene and the rhino instancing. We’ll find a way. I am now playing with using vrmeshes in block instances, which are then instanced. It’s not ideal, but it will do.

Grasshopper is great and we have done many very advanced things with it. 3 things it is not very good at is handling blocks (have to rely on plugins with varying success), changing any kind of render parameters like materials (although V-Ray has some cool things, but still exposes way too little to Grasshopper) and dealing with large numbers of items. Once you go past 10k items in a list that is not just numbers, it gets really slow real quick.

---

<div class="post-metadata">

**Author:** ![nikolay.bakalov](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/nikolay.bakalov/32/48732_2.png) [@nikolay.bakalov](https://forums.chaos.com/u/nikolay.bakalov)\
**Post date:** [May 10, 2023, 2:53pm UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/9 "2023-05-10T14:53:30Z")

</div>

hi,  
fortunately GH is getting all missing stuff natively - blocks, materials, lights, textures .. it was presented on the STF last month

with the next release V-Ray will have a lot of new stuff to GH as well. we’re on the path of putting all major stuff you can find in the Asset Editor in GH. this will happen gradually with the time.

I’ll appreciate any input from you and anyone else about what the community need. This will greatly help me in my battle with the project manager on this topic.

---

<div class="post-metadata">

**Author:** ![seltzdesign](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/seltzdesign/32/34753_2.png) [@seltzdesign](https://forums.chaos.com/u/seltzdesign)\
**Post date:** [May 10, 2023, 4:12pm UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/10 "2023-05-10T16:12:34Z")

</div>

> [@nikolay.bakalov](#):
>
> hi,  
> fortunately GH is getting all missing stuff natively - blocks, materials, lights, textures .. it was presented on the STF last month
> 
> with the next release V-Ray will have a lot of new stuff to GH as well. we’re on the path of putting all major stuff you can find in the Asset Editor in GH. this will happen gradually with the time.
> 
> I’ll appreciate any input from you and anyone else about what the community need. This will greatly help me in my battle with the project manager on this topic.

Thanks for the information. I assume you are referring to GH2. Last I heard it is still going to take quite while before it is a proper replacement for GH1, because all plugins need to be rewritten. Or is McNeel adding blocks and so on to GH1?

Does that mean V-Ray will have a plugin for GH2?

But great to hear improvements are coming!  
​

---

<div class="post-metadata">

**Author:** ![nikolay.bakalov](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/nikolay.bakalov/32/48732_2.png) [@nikolay.bakalov](https://forums.chaos.com/u/nikolay.bakalov)\
**Post date:** [May 10, 2023, 5:33pm UTC](https://forums.chaos.com/t/uvw-randomization-not-retained-in-vrmesh/114894/11 "2023-05-10T17:33:08Z")

</div>

The new plugins are for GH1. And they will not arrive exactly tomorrow. V-Ray will have a GH2 plugin, as soon as it has sort-of-a-final a public API
