Notifications
Clear all

[Closed] Removing Vray missing DLL's

Does anybody have any idea how the Vray render embeds itself into a max scene?
I have been handed a scene setup for Vray, which I don’t use and I am looking at writing a script to remove it from the scene.

I have managed to remove the usual missing maps etc but I am getting one stubborn Missing Dlls

FileName: vrender2012.dlr Class:VRayShadow     Superclass:0x10D0

I have removed all the scene lights and any render elements. I have tried exporting the scene to fbx and re-importing back in. It’s more out of curiosity as to how Vray embeds itself into the scene? Anybody have any useful suggestions?

Cheers,

D.

2 Replies

Just checking the obvious, but you have reassigned production, material editor and active shade renderers to use anything other than VRay?

For anybody who may be interested or suggest improvements here is a snippet of code I managed to source from http://scripts.breidt.net that removes / replaces missing DLL plugins. This seems to resolve my problem, hopefully this may be of use to somebody else?

Note this does not target Vray specifically, it just searches for any missing plugins and removes the dll references.


Fn ClearMissingPluginInstances  =
(
		Local str = stringStream ""
		apropos "*missing*" to:str
		seek str 0
		Local cls = #()
		while not (eof str) do
		(
			Local ln = readLine str
			Local tk = filterString ln " "
			if tk.count == 4 do
			(
				Local clsName = tk[1]
				try 
				(
					Local val = (execute clsName)
					Local sc = superClassOf val
					-- Alternative: check for .classID == #(-1,0)
					if sc==MAXWrapper or sc==node or sc==material or sc==MAXWrapperNonRefTarg do 
					(
						append cls val
					) 
				) 
				catch ()
			) 
		)
		
		Local c = 0
		Local foundMissing = #()
		for j = 1 to cls.count do 
		(
			Local cc = cls[j]
			Local ci = getClassInstances cc
			if ci.count > 0 then 
			(
			for i = 1 to ci.count do 
				(
					Local myClass = classOf cc -- get current class
					append foundMissing myClass
					allClasses = myClass.classes-- get list of all subclasses
						
					for k = 1 to allClasses.count do 
					(
						if allClasses[k].creatable then -- search for useful replacement
						(
							newInst = createInstance allClasses[k] -- create new instance of default (first) class
							try 
							(
								-- replace all instances (requires 3ds Max 2008+ or AVG extensions)
								q = replaceInstances ci[i] newInst
								c += 1
								-- and exit for k loop
								exit
							)
								catch()
						)
					) -- end: for k
				) -- end: for i
			) -- end: if
		) -- end: for j
		
		
		if c > 0 then -- produce summary message for user
		(
			Local str = "Replaced "
			append str (c as string)
			append str " missing plugin(s) with default objects:
"
			for i in foundMissing do 
			(
				append str "	"
				append str (i as string)
				append str "
"
			)
			append str "
USE RESULT WITH CAUTION!
SAVE TO A DIFFERENT FILE NAME!"
			messageBox str title:"removeMissingPlugins v0.1" beep:true
			print foundMissing
		)
		else 
		(
			messageBox "No missing plugins found" title:"removeMissingPlugins v0.1"
		)
)