Bug: Vrmesh in Rhino block duplicated/recreated on every open

I have a set of blocks, each of which contains a .vrmesh. The blocks are then instanced. So far so good.

Since they are vrmeshes, I can set the material on them. So I assign one material to all the vrmeshes and save the file. Here is what it looks when I saved the file. Not that 2 blocks contain the same OH3 Pos and OH3 Neg meshes, so they are shown as 2 separate items, which is already strange, since they link to the same .vrmesh file, but okay.

Now I close Rhino and open the file again. Sometimes it will say there are orphaned materials, sometimes it wont. Here is the asset editor after opening again:

​
See that every .vrmesh is now in there twice and has a new Generic material applied to it.

Not sure what is going on, but its a bug for sure.

Thanks for fixing.

I can send over the files if you want to test it.

Here is a test file. There is a master file with 2 linked blocks each containing a .vrmesh file with a material applied.

Master file:

When I open it a second time:

Weirdly, If I press Keep and open the asset editor everything is the same. If I press Delete, now my Sphere has lost its material slot for some reason. I have not edited the sphere.3dm or sphere.vrmesh files in between!?

So, yeah, something is still buggy about this workflow. I can’t get it to duplicate like in the other file, but the problem I think is the same. It somehow thinks it needs to recreate assets, even though it doesn’t.

It wont let me upload a 850KB zip file, so here is the link to the files: Dropbox

More weirdness with V-Ray Proxy Meshes in linked Rhino Blocks. I go into the block and try to change the preview, but nothing happens. I right-click a Proxy Mesh in the Asset Editor and click Select Objects in Scene and nothing happens. But when I delete the mesh in the viewport and go to Purge unused Assets, the Proxy disappears from the list.

You can see what I mean here: Placeit | Create Amazing Mockups, Logos, Videos & Designs

Can you provide a working way to have:

1. a proxy mesh inside a linked block
2. Instance that block many times
3. Change the preview type of it from the file with the instances

I simply cannot get it to work. It’s in the same file I sent you.

Seems like its a bug with linked block. If its an embedded block, I can change the preview type of the Proxy Mesh inside the block. It would be nice if it would work with linked blocks too, ie. the block is a separate .3dm file.

Hello @seltzdesign ,
We are currently investigating this issue with Orphaned materials and Blocks. Thank you for your files - I will take a look and let you know once there is some more information.

Now I close Rhino and open the file again. Sometimes it will say there are orphaned materials, sometimes it wont.

In that regard I also wanted to ask how do you open Rhino files? With File>Open, File>Recent or with double-click?
​

Good to hear. Yeah, I also noticed another issue that might be related to that. I have that file with the 57.000 block instances with V-Ray meshes in them. I did “Purge” in Rhino and it said it had purged 57.000 legacy materials. Could it be that V-Ray was creating a Rhino material for every block instance? I will keep a look out if I notice anything.

I usually open files from the startup dialog and either click one of the recent files thumbnails or click the open tab on Rhino’s startup screen.

Hi again @seltzdesign ,

So as for the Orphaned materials warning we have it logged as VRW-3964 and some improvements will be introduced in the next update. But I wanted to point out that this issue with how Rhino handles plugin’s materials was also discussed with McNeel and there were also updates on Rhino side.

What Rhino version are you currently using? Make sure that you use the latest update. You can find some more information here in this article.
Apart from that we recommend to open files with File > Open after Rhino has fully been loaded just in case. Avoid double-clicking and opening files from recent files.

Next to your question

Can you provide a working way to have:
1. a proxy mesh inside a linked block
2. Instance that block many times
3. Change the preview type of it from the file with the instances​

While you have already received an answer from Nikolay here in this post, I wanted to add that I have made some tests just to make sure how you got those duplicated instances that are not present in the scene (ie OH3-Neg#1).

When you are inserting a Block instance as Linked definition type, please note that it maintains a link to the external file only. Linked geometry is updated when the external file changes.
If you want to make any changes to the linked geometry you need to make them in the original file (ie changing materials or preview type of the proxy). Then these changes will be updated when you open the master file again or you can update them manually in the BlockManager.

If you attempt to make changes to the linked geometry in the master file it seems to work until you save\open the file again. Because when opening the master file you are updating linked blocks and they load information from the external file, disregarding your prior changes in this master file, which is expected. And once you have opened the file you get the duplicates of plugin data without geometry information, which is why they can be safely purged with the V-Ray Purge Unused tool.

You can try inserting Block with Embed and Link option - in this case you will be able to apply changes in the master file that will be saved, but this will also give you an option to update linked blocks if you want to override all these changes with the external file.

About instancing V-Ray Proxy and Blocks here is a quote from our documentation: V-Ray Proxy can be instanced by using the _Array command or Alt+drag the object in the Rhino viewport. This helps save memory as the .vrmesh file will be loaded only once regardless of the number of instances.
Copying and pasting a Proxy Mesh, however, creates copies that end up loading the same file multiple times. This should be avoided.
A Proxy Mesh within a block definition will be loaded only once regardless of the number of block instances in the project. Therefore, copying and pasting block instances is a safe alternative method to copy/pasting the Proxy Mesh objects directly.

Hope it helps.

​