How to strip all VRay references from a scene file?

How to strip all VRay references from a scene file?

Anonymous
Not applicable
5,470 Views
8 Replies
Message 1 of 9

How to strip all VRay references from a scene file?

Anonymous
Not applicable

I downloaded a few freebie max scenes which appear to have been saved and configured to use vRay but I don't have vRay installed and as a result I get a truck load of missing DLL errors when loading them as well as all the objects show up as black blobs probably due to the scene requiring vRay lights and/or materials.

 

How can I strip all this stuff and revert back to a "standard" max scene with no dependence on any external DLLs, lights or materials?

 

Thanks in advance.

0 Likes
Accepted solutions (1)
5,471 Views
8 Replies
Replies (8)
Message 2 of 9

ads_royje
Alumni
Alumni

Hi TheXennon,

 

vRay or any render with specific materials will be referenced in a few places.

First, you need to change the renderer.

 

Max Main menu : Rendering > Render Set up > Common tab > Assign Renderer

Pick for instance, Scanline, or any renderer you have available.

 

Then there are some materials that are vRay and assigned to objects.

It would be very 'hard' to recreate them , specially if you do not have vRay installed.

 

So the follow is 'destructive', as it will remove all materials from objects and the scene.

That's what I would do.

 

First, set all object not to have materials anymore.

Using Maxscript will be the fastest way.

 

-- all scene objects, set them to have no material.

allObjts = $*
for obj in allObjts do (
obj.material = undefined
)

 

Second, remove all vRay material from the material editor.

-- set to use Max Standard material.

 

for i = 1 to meditMaterials.count do (
meditMaterials[i] = Standardmaterial ()

 

Save your scene as a new scene, not to lose your master file.

You can reset max and re-open the scene, vRay dependencies should all be gone.

 

I hope that can help! 🙂

Message 3 of 9

Anonymous
Not applicable

@ads_royje wrote:

Hi TheXennon,

 

vRay or any render with specific materials will be referenced in a few places.

First, you need to change the renderer.

 

Max Main menu : Rendering > Render Set up > Common tab > Assign Renderer

Pick for instance, Scanline, or any renderer you have available.

 

Then there are some materials that are vRay and assigned to objects.

It would be very 'hard' to recreate them , specially if you do not have vRay installed.

 

So the follow is 'destructive', as it will remove all materials from objects and the scene.

That's what I would do.

 

First, set all object not to have materials anymore.

Using Maxscript will be the fastest way.

 

-- all scene objects, set them to have no material.

allObjts = $*
for obj in allObjts do (
obj.material = undefined
)

 

Second, remove all vRay material from the material editor.

-- set to use Max Standard material.

 

for i = 1 to meditMaterials.count do (
meditMaterials[i] = Standardmaterial ()

 

Save your scene as a new scene, not to lose your master file.

You can reset max and re-open the scene, vRay dependencies should all be gone.

 

I hope that can help! 🙂


Thanks for the reply and suggestion.  (I don' t know anything about MaxScript yet)

I assigned the default scanline renderer and then managed to manually remove all the missing assigned materials by simply selecting all objects in the scene and assigning a "standard" material to them as well as deleting all the "missing" materials from the material editor.  That solved the BLACK look of everything but I am still getting the missing DLLs errors/warnings when I open the scene even though all materials are now standard ones.

 

How can I find/delete these DLL references?

 

Does MAX have any kind of purge utility that strips unused or references to missing assets?  Would be nice if it did.

 

 

0 Likes
Message 4 of 9

Anonymous
Not applicable
Accepted solution

I had the same question a while back. I found the attached script on scriptspot that seems to work quite well. I've used it with success.

 

To use it, unzip it and save the file somewhere you can get to it. Then in MAX, go to the "Scripting" menu, and click "run script". In the run script dialog, go find your *.ms file.

Message 5 of 9

Anonymous
Not applicable

Although I don't know what it did, but it worked and removed/replaced 47 missing plugin(s) with default objects.

 

Not sure what these "default objects" are but the output window shows (47) lines of "RenderElement"  ... What are they, where were they hiding and is there some manual way to do the same thing? (so as to better understand what's actually happening)

 

Thanks for the script - I'll be hanging on to this one coz many of the freebie scenes seem to use vray and give this same annoying problem.  I wish there was a more straight forward built-in way to fix this issue.

0 Likes
Message 6 of 9

ads_royje
Alumni
Alumni

Yes, that script looks better! 🙂

It does remove/change, vRay objects too, by class.

Which I haven't mentioned indeed. 😞

 

0 Likes
Message 7 of 9

Anonymous
Not applicable

I'm surprised Max doesn't include this kind of functionality natively.  Browsing the forums I've seen similar posts by many other users going back several years and yet Max has not added a built-in tool to clean out redundant/unused components - we rely on script writers to do it for us.  Given that it's clearly an issue for a lot of people over a long time it seems strange to me.  Maybe one day ...

0 Likes
Message 8 of 9

Anonymous
Not applicable

I agree...it would be really nice if MAX had something like this included in the program. I wish I had the time and desire to learn scripting. It saves a lot of time.

0 Likes
Message 9 of 9

Alfred.DeFlaminis
Alumni
Alumni

Just to piggy back on the posts here, I have had issues occasionally with this as well.  Those render elements mentioned above were probably Render To Texture elements.  I recently had a problem finding those myself in a scene I was posting.  When you switch away from Vray, those elements are hidden but still part of the object properties.  I'm guessing that this is where those elements were hiding. 

 

Also, checking the particle flow window is helpful too in case a material was assigned to a particle system.  

 

The problem with a tool like this is that the plugin makers themselves are in a better position to create it for their own plugins because they know where everything is put and how it works internally.  Most plugins won't report in the Listener and it's not likely that the developers can learn every in and out about all plugins.  

 

I want to learn more about scripting... maybe this is a good place to start. 

 

Best Regards,

0 Likes