Smart Vrmesh Converter

49 votes
Date Updated: 
Author Name: 

Here is a little script I wrote a while ago. Basically, it converts all selected objects into Vray Proxy format. The main difference between this script and standard quad menu that comes with Vray, is that script preserves instanced objects, so the resulting Vray Proxys will be instanced and this, in turn, will save memory during render. Besides, it lets you select and convert entire groups of objects, without opening them. And finally, the most useful part of it – it keeps original meshes in the same folder as Vray meshes, and can restore original geometry back in scene, all with one click. Of course, it won’t restore geometry, converted to Vray mesh using default tool, only converted with this script.

Additional Info: 

Here is a demonstration object. It consists of several groups, which, in turn, have instanced objects inside. Each color represents set of instanced objects. What I'm going to do is convert entire group with all subgroups into Vray Proxy format while keep instances instanced :) Then, I'm going to revert this operation simply by running this script again.

Other Software Required: 
Video URL: 
Cooper-SmartVrmeshConverter.mcr2.31 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
C00PER's picture

Such script would be very

Such script would be very simple to create, however its not related in any way with Smart VrayMesh converter. And maybe a useful thing for you to know is that max 64 bit can attach enormous amounts of polygons without crashing. I've experienced same problems when I was on max 32, but in 64 everything was just fine. Also try to use different geometry format - i.e. if you're using Editable Mesh, try to convert to Editable Poly before attaching and vice versa.

C00PER's picture

Can you give more detailed

Can you give more detailed information? I don't have max 2010, but I don't see any reason why script shouldn't work there. It doesn't depend on max version.

crystal3d's picture

summary: lets say; you have a

summary: lets say; you have a tree object with all leaves as separate meshes , when i explode and attach them into one big heavy mesh at once, max crashes.

but i can attach them one by one which takes quite alot of time...

how long does it take to make a script like this one below?is it beginner level?

get selected group's name

explode group

rename the meshes inside , sequentially according to group name like: "groupname_01-02-03"

count polygon of each mesh.

attach small(number of polygon) meshes to "groupname_01" until
mesh reaches 1000 polygons.

attach medium meshes untill mesh reaches 1000 polygons and name it:"groupname_M_01,02..."

rename large meshes that has more than 1000 polygons as "groupname_L_01,02,03.."

attach all created meshes in to one big mesh , named"groupname"

looking foward to any replies.


crystal3d's picture

CAN you ADd a feature to this

CAN you ADd a feature to this amazing script?

mare96's picture

with max 2010 doesnt work!

with max 2010 doesnt work!

C00PER's picture

Script updated to 1.02 as I

Script updated to 1.02 as I promised in previous comment.

C00PER's picture

Sorry for late reply, I

Sorry for late reply, I completely forgot about this thread :D. Will keep an eye from now on.

Ok, first of all, I've made a couple of fixes, that make process of reverting from Vray Mesh more correct. I'll upload update in next reply later today. The fixes are following:

In older version, when you were about to revert FROM VrayMesh it was necessary to select exactly same object that was selected when objects were being converted TO VrayMesh (my bad). It is fixed now and any object can be selected regardless of order.

Also, now when you convert, script stores paths to both original geometry and to proxy file inside object properties. This gives you excellent opportunity to transfer your converted VrayProxy into another project, restore its geometry if needed (for precise placing purposes) and then turn back into proxy WITHOUT creating new vrmesh file. It just reuses already stored path.

Now about keeping modifiers instanced upon restoring. It seems to me that the only way to do this is to store original mesh INSIDE max file and simply hiding it. But the downside of this – the max file will grow, savetimes will grow, memory consumption will grow. Have to figure out another way.

About animations – I didn’t have enought time to work on this, I think this should not be a problem.

des_illacom's picture

WOW , I just gave this script

WOW , I just gave this script a test drive and I must say it's very useful :) I'm working on a project right now that is very heavy on geo and vray proxies are used alot in my workflow. One limitation that really cripples the script's potential is the handling of animated proxies and of course the modifier linking. Do you think it's possible to work out those limitations soon? Or is it a max limitation?
Never the less I applaud your effort, great job so far.

C00PER's picture

Known bugs and limitations.

Known bugs and limitations.

  • Since script stores Vrmesh files inside a new subfolder which is created in the same folder as the current opened scene resides, the scene must be saved and have a name. If you try this script on unsaved scene - it won't work.
  • Upon restoring, instanced modifier links will be broken. This means, that if you had NON instanced objects with INSTANCED modifiers between them, they no longer will be instanced.
  • For some reason, script may randomly throw an error on the same scene where just a second ago everything worked perfectly. I'll try to catch it later.
  • Animated Vray Proxys not supported yet.
  • Script uses object names for object identification, so if you have objects with same names, you may run into problems.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.