Bizarre File type issue with Tiles Rendering... Update 03/09

Aha, found the bug, it’s to do with RebuildRenderElement Function that I wrote for fixing the first issue, fix coming up…

So here’s the fix (If you’re using this function I wrote). Added on the first page of this thread, in your…SubmitMaxToDeadline_Function.ms

The previous function was stripping the render elements and then adding them back in again but wasn’t setting any path names, it was letting the RenderSceneDialog’s background RenderElementManager working do it automatically, thus if you didn’t have it open the paths weren’t getting updated then on a fresh launch with the rendersceneDialog closed the render element paths were getting stripped. I’ve put in code to store the render element filename and add it back in again with the filetype set to the same as as the Render output. The purpose of this function is to make sure your Render element format matches your main render output.

[code]fn RebuildRenderElements =
(
local reManager = maxOps.GetCurRenderElementMgr()
local AR_Elements = #()
local AR_ElementProps = #()
local AR_ElementFilenames = #()
for i = 1 to reManager.numrenderelements() do
(
local theelement = reManager.getrenderelement (i - 1)
append AR_Elements (classof theelement)
local a = #()
for prop in (getPropNames theelement) do
try(append a (getproperty theelement prop))catch(append a “”)
append AR_ElementProps a

			append AR_ElementFilenames (reManager.GetRenderElementFilename (i - 1))
		)
		reManager.RemoveAllRenderElements()
		for i = 1 to AR_Elements.count do
		(
			reManager.addrenderelement (execute((AR_Elements[i] as string) + "()"))
			local theelement = reManager.getrenderelement (i - 1)
			
			for j = 1 to (getPropNames theelement).count do
				try(setproperty theelement (getPropNames theelement)[j] AR_elementProps[i][j])catch()
			
			reManager.SetRenderElementFilename (i - 1) (getFilenamePath AR_ElementFilenames[i] + getFilenameFile AR_ElementFilenames[i] + getFilenameType RendOutputFilename)
		)
	),[/code]

Thanks! Added this to the todo list for the next release.

Cheers,

  • Ryan

Another update, there is a bug with the VrayExtraTex which resets its name after submission, so on a second submission the output is different for that element.

I’ve put in a simple work-around which seems to fix the issue, The issue happens because…

showproperties (VRayExtraTex())
.enabled : boolean
.filterOn : boolean
.atmosphereOn : boolean
.shadowOn : boolean
.elementName : string
.bitmap : bitmap
.vrayVFB : boolean
.texture : texturemap
.consider_for_antialiasing : boolean
.affect_matte_objects : boolean

The .elementname property gets set and then the .texture property gets set afterwards which changes the .elementname property, so i’ve put some code in to store the names and set them once all the properties have been set, simple but annoying fix.

[code](
local reManager = maxOps.GetCurRenderElementMgr()
local AR_Elements = #()
local AR_ElementProps = #()
local AR_ElementFilenames = #()
local AR_Elementnames = #()
for i = 1 to reManager.numrenderelements() do
(
local theelement = reManager.getrenderelement (i - 1)
append AR_Elements (classof theelement)
local a = #()
for prop in (getPropNames theelement) do
try(append a (getproperty theelement prop))catch(append a “”)
append AR_ElementProps a
append AR_ElementNames theelement.elementname
append AR_ElementFilenames (reManager.GetRenderElementFilename (i - 1))
)
reManager.RemoveAllRenderElements()
for i = 1 to AR_Elements.count do
(
reManager.addrenderelement (execute((AR_Elements[i] as string) + “()”))
local theelement = reManager.getrenderelement (i - 1)

	for j = 1 to (getPropNames theelement).count do
		try(setproperty theelement (getPropNames theelement)[j] AR_elementProps[i][j])catch()
	reManager.SetRenderElementFilename (i - 1) (getFilenamePath AR_ElementFilenames[i] + getFilenameFile AR_ElementFilenames[i] + getFilenameType RendOutputFilename)
	theelement.elementname = AR_ElementNames[i]
)

)[/code]

Small fix for a bug if you don’t set a Render Output… I guess sometimes you don’t have/want/need to.

[code]fn RebuildRenderElements =
(
if RendOutputFilename != “” or RendOutputFilename != undefined do
(
local reManager = maxOps.GetCurRenderElementMgr()
local AR_Elements = #()
local AR_ElementProps = #()
local AR_ElementFilenames = #()
local AR_Elementnames = #()
for i = 1 to reManager.numrenderelements() do
(
local theelement = reManager.getrenderelement (i - 1)
append AR_Elements (classof theelement)
local a = #()
for prop in (getPropNames theelement) do
try(append a (getproperty theelement prop))catch(append a “”)
append AR_ElementProps a
append AR_ElementNames theelement.elementname
append AR_ElementFilenames (reManager.GetRenderElementFilename (i - 1))
)
reManager.RemoveAllRenderElements()
for i = 1 to AR_Elements.count do
(
reManager.addrenderelement (execute((AR_Elements[i] as string) + “()”))
local theelement = reManager.getrenderelement (i - 1)

				for j = 1 to (getPropNames theelement).count do
					try(setproperty theelement (getPropNames theelement)[j] AR_elementProps[i][j])catch()
				reManager.SetRenderElementFilename (i - 1) (getFilenamePath AR_ElementFilenames[i] + getFilenameFile AR_ElementFilenames[i] + getFilenameType RendOutputFilename)
				theelement.elementname = AR_ElementNames[i]
			)
		)
	),[/code]