AWS Thinkbox Discussion Forums

3dsmax Submitter Single Frame Tile Rendering Mode Not Working

Hi @Bobo, @MikeOwen and all support and everyone,
I tried, but it doesn’t work. It’s still normal.
Diff of Job files --> https://www.diffchecker.com/i04uuO8G

(
global SMTDSettings
global SMTDFunctions
global SMTD_PerformSanityCheck
global SMTD_MainRollout
global SMTD_UserOptions
	
global SMTD_LogStream = #()	
local SMTD_LogShowTimestamp = true
local SMTD_todaysLogFile = "C:\Users\AdminTest\Desktop\test.txt"


try(destroyDialog SimpleDeadlineSubmitter_Rollout)catch()

rollout SimpleDeadlineSubmitter_Rollout "" --rolledup:true
(

group "Logs" 
	(
		dotNetControl dnc_report "ListView" width:365 height:90 align:#center
		button logla "Logla!"
		button btn_submit "Submit!"

		
	)

fn initReportWindow lv =
		(
			local layout_def = #(#("",60), #("",400))
			lv.Clear()
			lv.backColor = (dotNetClass "System.Drawing.Color").fromARGB SMTD_ColorPalette.maxBgColor.r SMTD_ColorPalette.maxBgColor.g SMTD_ColorPalette.maxBgColor.b
			lv.View = (dotNetClass "System.Windows.Forms.View").Details
			lv.gridLines = false
			lv.fullRowSelect = true
			lv.checkboxes = false
			lv.hideSelection = false
			lv.HeaderStyle = lv.HeaderStyle.None
			for i in layout_def do lv.Columns.add i[1] i[2]
		)
		
fn getTimeString =
	(
		timeArray = getLocalTime()
		local hour = if timeArray[5] < 10 then (hour = "0" + (timeArray[5] as string)) else (hour = (timeArray[5] as string))
		local minute = if timeArray[6] < 10 then (minute = "0" + (timeArray[6] as string)) else (minute = (timeArray[6] as string))
		local second = if timeArray[7] < 10 then (second = "0" + (timeArray[7] as string)) else (second = (timeArray[7] as string))
		timeString = hour + ":" + minute + ":" + second
	)

fn Ui_report txt LogFileOnly:false AddTimeStamp:true =
		(
			if not LogFileOnly do
			(
				try
				(
					local strStream = txt as StringStream
					local theRange = #()
					local blackColor = (dotNetClass "System.Drawing.Color").fromARGB SMTD_ColorPalette.textColor.r SMTD_ColorPalette.textColor.g SMTD_ColorPalette.textColor.b
					if SMTD_ColorPalette.maxBgColor.v >= 160 then
					(
						--DARK COLORS
						local redColor = (dotNetClass "System.Drawing.Color").fromARGB 192 0 0
						local orangeColor = (dotNetClass "System.Drawing.Color").fromARGB 192 100 0
						local greenColor = (dotNetClass "System.Drawing.Color").fromARGB 0 92 0
						local blueColor = (dotNetClass "System.Drawing.Color").fromARGB 0 0 128
					)
					else
					(
						--LIGHT COLORS
						local redColor = (dotNetClass "System.Drawing.Color").fromARGB 255 128 128
						local orangeColor = (dotNetClass "System.Drawing.Color").fromARGB 255 180 50
						local greenColor = (dotNetClass "System.Drawing.Color").fromARGB 128 255 128
						local blueColor = (dotNetClass "System.Drawing.Color").fromARGB 192 220 255
					)

					local lineCount = 0
					local foreColor = blackColor
					while not eof strStream do
					(
						local aLine = readLine strStream
						if aLine == "" do continue
						lineCount +=1
						local logLevel = #info
						if lineCount == 1 do	--set the color and log level only if this is the first line of a multi-line log block
						(
							case of
							(
								default: (
									foreColor = blackColor
								)
								(matchPattern aLine pattern:"?--*"): (
									foreColor = redColor
									logLevel = #error
								)
								(matchPattern aLine pattern:"--*"): (
									foreColor = redColor
									logLevel = #error
								)
								(matchPattern aLine pattern:"?!!*"): (
									foreColor = orangeColor
									logLevel = #warning
								)
								(matchPattern aLine pattern:"!!*"): (
									foreColor = orangeColor
									logLevel = #warning
								)
								(matchPattern aLine pattern:"?+*"): (
									foreColor = greenColor
									logLevel = #success
								)
								(matchPattern aLine pattern:"+*"): (
									foreColor = greenColor
									logLevel = #success
								)
								(matchPattern aLine pattern:">*"): (
									foreColor = blueColor
									logLevel = #progress
								)
								(matchPattern aLine pattern:"==*"): (
									foreColor = blueColor
									logLevel = #progress
								)
							)
						)
						local theTimeStamp = (if AddTimeStamp then getTimeString() else "")
						append ::SMTD_LogStream #(theTimeStamp, forecolor, logLevel, aLine)
						if findItem ::SMTD_LogFilters logLevel == 0 do
						(
							local li = dotNetObject "System.Windows.Forms.ListViewItem" (if SMTD_LogShowTimestamp then theTimeStamp else "")
							li.forecolor = foreColor
							local subLi = li.SubItems.add aLine
							append theRange li
						)
					)
					dnc_report.Items.AddRange theRange
					if dnc_report.Items.Count > 0 do dnc_report.Items.Item[dnc_report.Items.Count-1].EnsureVisible()
					local autoRes = dotNetClass "System.Windows.Forms.ColumnHeaderAutoResizeStyle"
					dnc_report.AutoResizeColumns autoRes.ColumnContent
					if not SMTD_LogShowTimestamp do dnc_report.Columns.Item[0].Width = 1
					try(windows.processPostedMessages())catch()
				)catch()
			)
			if AddTimeStamp then
				try( format "[%] : %\n" (getTimeString()) txt to:SMTD_todaysLogFile)catch()
			else
				try( format "%\n" txt to:SMTD_todaysLogFile)catch()
		)
		
on SimpleDeadlineSubmitter_Rollout open do 
(
		initReportWindow dnc_report
		SimpleDeadlineSubmitter_Rollout.title = "Render724 Submitter | " + SMTDSettings.username +" | " + getTimeString() 
		Ui_report ("+Logged in ["+ getTimeString() +"]")
)

on logla pressed do 
(
			Ui_report ("+Solution Man from LOGLA ["+ getTimeString() +"]")
)

on btn_submit pressed do
(

local theNetworkRoot= @"\\FILESERVER\Render724\Cloud\RenderService\DeadlineRepository10"
local remoteScript = theNetworkRoot + @"\submission\3dsmax\main\SubmitMaxToDeadline_Functions.ms" 
local localScript = getDir #userscripts + "\\SubmitMaxToDeadline_Functions.ms"
if doesFileExist remoteScript do
(
if SMTDFunctions == undefined do
(
deleteFile localScript
copyFile remoteScript localScript
fileIn localScript
)

SMTDFunctions.loadSettings()
SMTDSettings.JobName = maxFileName + " [SIMPLE MXS SUBMISSION]"
SMTDSettings.Comment = "Created using the simplest Deadline submission script imaginable."

local maxFileToSubmit = SMTDPaths.tempdir + maxFileName
SMTDFunctions.SaveMaxFileCopy maxFileToSubmit

local SubmitInfoFile = SMTDPaths.tempdir + "\\max_submit_info.job"
local JobInfoFile = SMTDPaths.tempdir+ "\\max_job_info.job"

lastX = 5
lastY = 5
setIniSetting SMTDPaths.InIFile "TilesRendering"  "TilesInX" ( (SMTDSettings.TilesInX= lastX) as string)
setIniSetting SMTDPaths.InIFile "TilesRendering"  "TilesInY" ( (SMTDSettings.TilesInY= lastY) as string)
SMTDSettings.RegionRenderingMode = "#singleFrameTiles"
Ui_report ("+Tile/Region Rendering Mode set to [" + SMTDSettings.RegionRenderingMode + "]")

SMTDFunctions.CreateSubmitInfoFile SubmitInfoFile
SMTDFunctions.CreateJobInfoFile JobInfoFile

local initialArgs = "\""+SubmitInfoFile+"\" \""+JobInfoFile+"\" \""+maxFileToSubmit+"\" "
local result = SMTDFunctions.waitForCommandToComplete initialArgs SMTDSettings.TimeoutSubmission

local renderMsg = SMTDFunctions.getRenderMessage()
SMTDFunctions.getJobIDFromMessage renderMsg
SMTDFunctions.restoreExternalReferencePaths()
if result == #success then
(
format "Submitted successfully as Job %.\n\n%\n\n" \
SMTDSettings.DeadlineSubmissionLastJobID renderMsg
)
else
format "Job Submission FAILED.\n\n%" renderMsg
)--end if
)--end on button presse

)--end rollout

createDialog SimpleDeadlineSubmitter_Rollout width:400   style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox, #style_resizing)
--SMTDFunctions.getMaxVersion()
--SimpleDeadlineSubmitter_Rollout.Ui_report ("+sen kralsin ümit abi ["+ getTimeString() +"]")
)--end script

The above should have been

SMTDSettings.RegionRenderingMode = #singleFrameTiles

A value starting with # denotes a Name value in MAXScript. A Name value is similar to a String value (e.g. “singleFrameTiles”), however it is case-insensitive. Most of MAXScript is case-insensitive, except for Strings. So if you have a logical test like

#SingleFRAMEtiles == #singleFrameTiles

it will always return True, however

"SingleFRAMEtiles" == "singleFrameTiles"

will return False because the cases don’t match!

1 Like

It worked. But it was not what I expected. I don’t know what I’m missing. I thought #singleFrameTiles would be enough. That’s what’s happening now.

Should be --> (SMTD)

That makes no sense.

I tested your script (minus the “”), and it submitted a Single Frame Tiles job with 25 (5x5) tiles correctly.

There might be some setting in SMTDSettings that is interfering with your submission.
You can open the SMTD dialog and call

 try(SMTD_MainRollout.reportSubmissionSettings())catch()

from your submitter during the submission to dump everything into the SMTD log, then upload the resulting log file here so we can inspect the settings…

Yes, a single frame render (5x5) tiles but no puzzle logo. That is to say, there is no draft tile assembly.

Result: (no puzzle logo)


Should be:

Tile Assembly for Tile Rendering is optional. There is a checkbox in the UI, and a property it controls - SMTDSettings.SingleTileJobDependent

Is it set to True?

Yes, SMTDSettings.SingleTileJobDependent is True.

Please see my previous notes about how to dump the SMTDSettings to the SMTD log, then perform a Tiles submission and send me the resulting log - you can find it via the SMTD UI > Tools > Explore SMTD Log Folder… It should be under

C:\Users\[username]\AppData\Local\Thinkbox\Deadline10\logs
----JOB INFO----
Version=2018
SubmittedFromVersion=20.0.0.966
SubmittedRendererName=CoronaRenderer:CoronaRenderer
SubmittedRendererId=#(1655201228L, 1379677700L)
IsMaxDesign=0
SceneSelection=#()
Padding=4
RemovePadding=0
IgnoreMissingExternalFiles=1
IgnoreMissingUVWs=1
IgnoreMissingDLLs=0
IgnoreMissingXREFs=1
DisableMultipass=0
LocalRendering=1
OneCpuPerTask=0
DumpFileProperties=true
Language=Default
UseSlaveMode=1
UseSilentMode=0
PopupHandling=1
IncludeLocalPaths=0
RenderStateSet=0
FrameNumberBase=0
RestartRendererMode=1
DisableProgressUpdateTimeout=0
SkipRender=0
OverrideFailOnExistingMaxProcess=false
FailOnExistingMaxProcess=false
GPUsPerTask=0
GPUsSelectDevices=
Camera=PhysCamera001
Camera0=
Camera1=PhysCamera001
MaxVersionToForce=64bit
MaxVersionToForce0=none
MaxVersionToForce1=32bit
MaxVersionToForce2=64bit
FailOnBlackFrames=0
BlackPixelPercentage=1
BlackPixelThreshold=0.1
BlackFramesCheckRenderElements=0
GammaCorrection=0
GammaInput=1.0
GammaOutput=1.0
IgnoreRenderElements=0
RenderElementsIncludeNameInPath=false
RenderElementsIncludeTypeInPath=false
RenderOutput=\\FILESERVER\Render724-Cloud\Studios\_DemoScene\3dsmax\Renders\Render..jpg
SaveFile=true
ShowFrameBuffer=true
ShowRendererFrameBufferOverride=false
ShowRendererFrameBuffer=true
OverrideBitmapPager=false
BitmapPager=false
RenderWidth=1920
RenderHeight=1080
renderPixelAspect=1.0
rendAtmosphere=true
renderEffects=true
renderDisplacements=true
rendSimplifyAreaLights=false
rendForce2Side=false
rendHidden=false
rendColorCheck=false
rendSuperBlack=false
rendFieldRender=false
SkipRenderedFrames=false
backgroundColor=(color 0 0 0)
useEnvironmentMap=false
ambientColor=(color 0 0 0)
lightTintColor=(color 255 255 255)
lightLevel=1.0
corona_geometry_accelerationStructure=2
corona_shading_primarySolver=1
corona_shading_secondarySolver=4
corona_lights_samplesMult=2.0
corona_shading_renderEngine=2
corona_progressive_timeLimit=0
corona_shading_giToAaRatio=16
corona_image_prefilter_type=2
corona_image_prefilter_width=2.0
corona_geometry_minInstanceSaving=50000
corona_geometry_maxNormalDiff=0.55
corona_progressive_passLimit=100
corona_lights_solver=1
corona_shading_maxSampleIntensity=20.0
corona_shading_maxRayDepth=25
corona_bg_overrideDirect=false
corona_bg_overrideReflect=false
corona_renderStamp=Corona Renderer | %c | Time: %pt | Passes: %pp | Primitives: %si | Rays/s: %pr
corona_lights_renderHidden=false
corona_texmapFiltering=1
corona_bg_overrideRefract=false
corona_alphaAlwaysSolid=false
corona_system_randomSampler=5
corona_renderstamp_use=false
corona_lights_solverFracLocal=0.33
corona_lights_solverFractGlobal=0.33
corona_lights_portalSampleFraction=0.75
corona_colorMap_simpleExposure=0.0
corona_colorMap_highlightCompression=1.0
corona_colorMap_colorTemp=6500.0
corona_colorMap_contrast=1.0
corona_gi_photons_emitted=5000000
corona_gi_photons_lookupCount=50
corona_gi_photons_storeDirect=true
corona_gi_photons_depth=-1
corona_lights_samplingMode=2
corona_geometry_displace_maxSizeScreen=2.0
corona_mb_segmentsTransform=6
corona_mb_segmentsGeometry=3
corona_mb_frameOffset=0.0
corona_gi_ppm_alpha=0.666
corona_gi_ppm_initialRadius=2.0
corona_gi_ppm_ptSamplesPerIter=1
corona_gi_ppm_photonsPerIter=5000000
corona_gi_vcm_mis=true
corona_gi_vcm_mode=4
corona_gi_vpl_emittedCount=1000000
corona_gi_vpl_usedCount=150
corona_gi_vpl_clamping=50.0
corona_gi_vpl_progressiveBatch=150
corona_dof_bokehResolution=500
corona_dof_bokehBlades=6
corona_dof_bokehRotation=0.0
corona_dof_use=false
corona_dof_sensorWidth=36.0
corona_bg_texmapUseReflect=true
corona_bg_texmapUseMain=true
corona_bg_texmapUseRefract=true
corona_bg_texmapUseDirect=true
corona_mtlOverride_enabled=false
corona_mtlOverride_includeMode=false
corona_bg_color=(color 255 255 255)
corona_shading_exitColor=(color 0 0 0)
corona_bg_colorDirect=(color 0 0 0)
corona_bg_colorReflect=(color 0 0 0)
corona_bg_colorRefract=(color 0 0 0)
corona_geometry_displace_maxSizeWorld=1.0
corona_mtlOverride=undefined
corona_bg_texmap=undefined
corona_bg_texmapDirect=undefined
corona_bg_texmapReflect=undefined
corona_bg_texmapRefract=undefined
corona_dof_bokehTexmap=undefined
corona_overrideMtl_exclude=#()
corona_globalVolumeMtl=undefined
corona_lights_enviroDistance=10000.0
corona_dr_slaveAddresses=#()
corona_dr_slaveResolvedNames=#()
corona_dr_enable=false
corona_dr_synchInterval=60
corona_dr_searchDuringRender=false
corona_system_drMaxDumpPixels=500000
corona_globalVolumeMtl_use=false
corona_dof_bokehShape=0
corona_mb_useCamera=false
corona_mb_useGeometry=false
corona_stringOptions=# additional string options: one per line, format: [type] [name] = [value]
corona_gi_uhdCache_precalcMode=0
corona_gi_uhdCache_save=false
corona_gi_uhdCache_file=C:/HdCache.hdc
corona_dr_retainExr=false
corona_vfb_clearBetweenRenders=true
corona_colorMap_iso=100.0
corona_colorMap_fStop=16.0
corona_colorMap_shutterSpeed=50.0
corona_colorMap_tint=(color 255 255 255)
corona_geometry_embree_lowMemory=false
corona_geometry_embree_highQuality=true
corona_geometry_embree_precise=true
corona_bg_source=0
corona_geometry_displace_subdivType=0
corona_shading_firstPassQuality=1.0
corona_interactive_giSamplesMult=1.0
corona_interactive_hdPrecompMult=0.1
corona_interactive_hdQualityMult=0.6
corona_multithreadedParsing=true
corona_cloneTexmaps=true
corona_gi_uhdCache_doViz=false
corona_gi_uhdcache_precision=1.0
corona_gi_uhdcache_precompDensity=1.0
corona_gi_uhdcache_interpolationCount=5
corona_gi_uhdcache_normalSensitivity=2.0
corona_gi_uhdcache_dirSensitivity=3.0
corona_gi_uhdcache_glossThreshold=0.9
corona_rolloutsStatus=0001
corona_mtlEditor_lightsIntensity=1.0
corona_mtlEditor_lightsSize=1.0
corona_gi_uhdcache_preset=0
corona_interactive_passLimit=0
corona_mtlOverride_preserveDisplacement=false
corona_colormap_additionalGamma=0.0
corona_colormap_exposureType=0
corona_lockSamplingPattern=true
corona_dr_numThreads=0
corona_renderSelected_mode=0
corona_renderSelected_objectId=0
corona_renderSelected_list=#()
corona_renderSelected_includeMode=true
corona_adaptivity_enable=true
corona_adaptivity_targetError=0.0
corona_denoise_filterType=0
corona_denoise_sensitivity=1.0
corona_denoise_blendAmount=1.0
corona_shading_fbSampleClamp=0.0
corona_adaptivity_interval=5
corona_denoise_textureBlur=1.0
corona_colorMap_filmic_highlightCompression=0.0
corona_colorMap_filmic_richShadows=0.0
corona_colorMap_saturation=0.0
corona_shading_onlyElements=false
corona_vignette_intensity=0.0
corona_vignette_falloff=0.0
corona_bloomGlare_bloomIntensity=1.0
corona_bloomGlare_glareIntensity=1.0
corona_bloomGlare_colorIntensity=0.3
corona_bloomGlare_colorShift=0.5
corona_bloomGlare_streakCount=3
corona_bloomGlare_rotation=15.0
corona_bloomGlare_streakBlur=0.2
corona_bloomGlare_threshold=1.0
corona_colorMap_lightmixColors=#()
corona_colorMap_lightmixIntensities=#()
corona_colorMap_lut_enable=false
corona_colorMap_lut_path=
corona_colorMap_lut_opacity=1.0
corona_colorMap_lut_convertToLog=false
corona_bloomGlare_enabled=false
corona_colorMap_colorTemp15Hack=false
corona_lights_enviroSolver=3
corona_curves_enable=false
corona_curves_master_nodes=#()
corona_curves_master_interpol=0
corona_curves_r_nodes=#()
corona_curves_r_interpol=0
corona_curves_g_nodes=#()
corona_curves_g_interpol=0
corona_curves_b_nodes=#()
corona_curves_b_interpol=0
corona_bloomGlare_halfFloat=false
corona_sharpening_amount=1.0
corona_sharpening_radius=0.5
corona_renderstamp_fontSize=8
corona_system_vfbRegions=#()
corona_system_vfbRegions_enabled=true
corona_obsoleteTabParam=#(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
corona_colorMap_enabled=true
corona_colormap_lightmix_elementNames=#()
corona_colorMap_lightmixEnabledLayers=#()
corona_blurring_radius=1.33
corona_sharpening_blurring_enable=false
corona_progressive_interlacingLevel=3
corona_dr_slaveEnabled=#()
corona_terminator_shadowShift=0.0
corona_terminator_bumpShadowSharpness=20.0
corona_system_drRenderStripOnly=false
corona_interactive_forcePt=false
corona_interactive_showFps=false
corona_obsoleteParam=0
corona_colormap_exposureType_enums=Use simple exposure
corona_colormap_exposureType_enums0=Use simple exposure
corona_colormap_exposureType_enums1=Use photographic exposure
corona_shading_primary_solver_enums=Path Tracing
corona_shading_primary_solver_enums0=None (biased)
corona_shading_primary_solver_enums1=Path Tracing
corona_shading_secondary_solver_enums=undefined
corona_shading_secondary_solver_enums0=None (biased)
corona_shading_secondary_solver_enums1=Path Tracing
corona_shading_secondary_solver_enums2=UHD Cache
corona_bg_source_enums=Use 3ds max settings (Environment tab)
corona_bg_source_enums0=Use 3ds max settings (Environment tab)
corona_bg_source_enums1=Use Corona:
corona_dof_bokehShape_enums=Circular
corona_dof_bokehShape_enums0=Circular
corona_dof_bokehShape_enums1=Bladed
corona_dof_bokehShape_enums2=Custom
corona_geometry_displace_subdivType_enums=Screen size (px):
corona_geometry_displace_subdivType_enums0=Screen size (px):
corona_geometry_displace_subdivType_enums1=World size (units):
corona_shading_renderEngine_enums=Progressive
corona_shading_renderEngine_enums0=Bucket
corona_shading_renderEngine_enums1=--
corona_shading_renderEngine_enums2=Progressive
corona_shading_renderEngine_enums3=Bidir/VCM
corona_geometry_accelerationStructure_enums=Intel(r) Embree
corona_geometry_accelerationStructure_enums0=None (slooow)
corona_geometry_accelerationStructure_enums1=BVH full SAH
corona_geometry_accelerationStructure_enums2=Intel(r) Embree
corona_system_randomSampler_enums=Per-pixel Xorshift128
corona_system_randomSampler_enums0=Shared PRNG
corona_system_randomSampler_enums1=Per-pixel Shirley
corona_system_randomSampler_enums2=One-sample High-D
corona_system_randomSampler_enums3=5D Deterministic + PRNG
corona_system_randomSampler_enums4=Optimal 1S High-D
corona_system_randomSampler_enums5=Per-pixel Xorshift128
corona_system_randomSampler_enums6=Per-pixel TEA
corona_system_randomSampler_enums7=Per-pixel Xorshift*
corona_system_randomSampler_enums8=5D High-D + PRNG
corona_texmapFiltering_enums=All but opacity
corona_texmapFiltering_enums0=None
corona_texmapFiltering_enums1=All but opacity
corona_texmapFiltering_enums2=All
corona_lights_solver_enums=Better Object-based
corona_lights_solver_enums0=Combined
corona_lights_solver_enums1=Better Object-based
corona_lights_solver_enums2=Object-based
corona_lights_samplingMode_enums=MIS - both (best)
corona_lights_samplingMode_enums0=Lights only
corona_lights_samplingMode_enums1=BSDF only
corona_lights_samplingMode_enums2=MIS - both (best)
corona_gi_vcm_mode_enums=[BDPT] Bidirectional Path Tracing
corona_gi_vcm_mode_enums0=[PT+MIS] Path Tracing + Next Event Estimage
corona_gi_vcm_mode_enums1=[LT] Light Tracing
corona_gi_vcm_mode_enums2=[PPM] Progressive Photon Mapping
corona_gi_vcm_mode_enums3=[BDPM] Bidirectional PPM
corona_gi_vcm_mode_enums4=[BDPT] Bidirectional Path Tracing
corona_gi_vcm_mode_enums5=[VCM] Vertex Connection and Merging
corona_gi_uhdcache_preset_enums=Still frame (fast precomputation)
corona_gi_uhdcache_preset_enums0=Still frame (fast precomputation)
corona_gi_uhdcache_preset_enums1=Animation (flickerfree)
corona_gi_uhdCache_precalcMode_enums=Calculate from scratch
corona_gi_uhdCache_precalcMode_enums0=Calculate from scratch
corona_gi_uhdCache_precalcMode_enums1=Load from file
corona_gi_uhdCache_precalcMode_enums2=Load from file + append
corona_image_prefilter_type_enums=Tent
corona_image_prefilter_type_enums0=None
corona_image_prefilter_type_enums1=Box
corona_image_prefilter_type_enums2=Tent
corona_image_prefilter_type_enums3=Parabolic
corona_image_prefilter_type_enums4=Symmetric Tent
corona_image_prefilter_type_enums5=Hann
corona_image_prefilter_type_enums6=Blackman-Harris
corona_renderSelected_mode_enums=Disabled
corona_renderSelected_mode_enums0=Disabled
corona_renderSelected_mode_enums1=Viewport selection
corona_renderSelected_mode_enums2=Object GBuffer ID
corona_renderSelected_mode_enums3=Include/exclude list
corona_denoise_filterType_enums=None
corona_denoise_filterType_enums0=None
corona_denoise_filterType_enums1=Only remove fireflies
corona_denoise_filterType_enums2=Full denoising
corona_denoise_filterType_enums3=Gather data for later
corona_progressive_timeLimit_override=false
corona_progressive_timeLimit_hours=0
corona_progressive_timeLimit_minutes=0
corona_progressive_timeLimit_seconds=0

------ SUBMIT INFO -----
UserName=adminpc
Group=
ChunkSize=1
SendJobErrorWarning=true
MaxTasksPerSlave=1
EnableAutoTimeout=false
Priority=2
Department=
TaskTimeoutSeconds=0
MachineLimit=0
ForceReloadPlugin=false
FailureDetectionJobErrors=5
FailureDetectionTaskErrors=5
Blacklist=
ExtraInfo8=
ExtraInfo9=
ExtraInfo4=
ExtraInfo5=
ExtraInfo6=
LimitTasksToNumberOfCpus=true
ExtraInfo0=
ExtraInfo1=
Pool=
OutputFilename0=\FILESERVER\Render724-Cloud\Studios_DemoScene\3dsmax\Renders\Render.####.jpg
Comment=Test Single Frame Tiles Rendering
Name=3dsmaxScene-2018.max [SIMPLE MXS SUBMISSION] Orange
Plugin=3dsmax
OverrideJobFailureDetection=false
IncludeEnvironment=false
ExtraInfo7=
OverrideTaskFailureDetection=false
AWSAssetFile0=\FILESERVER\Render724-Cloud\Studios_DemoScene\3dsmax\Projects\maps\color-1.jpg
AWSAssetFile1=\FILESERVER\Render724-Cloud\Studios_DemoScene\3dsmax\Projects\maps\color-2.jpg
AWSAssetFile2=\FILESERVER\Render724-Cloud\Studios_DemoScene\3dsmax\Projects\maps\color-3.jpg
AWSAssetFile3=\FILESERVER\Render724-Cloud\Studios_DemoScene\3dsmax\Projects\maps\color-4.jpg
AWSAssetFile4=\FILESERVER\Render724-Cloud\Studios_DemoScene\3dsmax\Projects\maps\color-5.jpg
AWSAssetFile5=\FILESERVER\Render724-Cloud\Studios_DemoScene\3dsmax\Projects\maps\color-6.jpg
UseJobEnvironmentOnly=false
ScheduledType=None
Interruptible=false
ExtraInfo2=
Frames=0-10
ExtraInfo3=
OnJobComplete=Nothing

We using Custom Submitter. 
(
global SMTDSettings
global SMTDFunctions
global SMTD_PerformSanityCheck
global SMTD_MainRollout
global SMTD_UserOptions
	
global SMTD_LogStream = #()
global SMTD_LogFilters = #()
global SMTD_LogShowTimestamp = true
local SMTD_todaysLogFile = "C:\Users\AdminTest\Desktop\test.txt"
local HelpURL = "https://www.render724.com/eng/Help"
local Costurl = "https://www.render724.com/eng/CostCalculator"
local BuyUrl = "https://www.render724.com/eng/Buy"
	
local credit = "Credits: 25.000,00"

rcmenu SMTD_MainRollout_MainMenu
(

		subMenu "&Account"
		(
			menuItem mnu_openaccount "Login/Logout"
			menuItem mnu_createuser "Add Team Member"
			menuItem mnu_jobhistory "Job History"
		)
		subMenu "&Purchase"
		(
			menuItem mnu_buycredit "Render Credits"
			menuItem mnu_buyserver "Server Rental"
			
		)
		subMenu "&Cost Calculator"
		(
			menuItem mnu_perform_check "Check CPU Performance" --Ciktisini dosyaya yaz
			menuItem mnu_costcalculate "Cost Calculate Now!" enabled:false--yazdigin dosyayi kontrol et.
		)
		subMenu "&Help"
		(
			menuItem mnu_openHelp "&Error Codes"
			menuItem mnu_openTutorials "&Tutorials"
			menuItem mnu_openFeedback "&Feedback"
			menuItem mnu_openAbout "&About"
		)

		
		on mnu_costcalculate picked do shellLaunch Costurl "" --todo ilk ?nce perform check olayini yaptir eger deger yoksa perform checki calistir.. Sonra git sayfaya.
		on mnu_buycredit picked do shellLaunch BuyUrl ""
		on mnu_openHelp picked do shellLaunch HelpURL ""
		on mnu_openaccount picked do ()
		on mnu_perform_check picked do shellLaunch "C:\\Users\\AdminTest\\Desktop\\CINEBENCH_R15\\CINEBENCHWindows64Bit.exe" ""
)			

global SimpleRenderSubmitter_Rollout
try(destroyDialog SimpleRenderSubmitter_Rollout)catch()

rollout SimpleRenderSubmitter_Rollout "Render724 Submitter" rolledup:true
(

		label test ""
		label test2 ""
		label test3 ""
		imgTag logo"logo" style:#bmp_center bitmap:(openBitmap @"\\FILESERVER\Backup\_temp\Logo - 180x50.jpg")  width:180 height:50 offset:[-13,-59] across:3 
		label lbl_username "Name Surname" align:#right offset:[198,-40] width:120 height:20 border:false tooltip:"Username"
		label lbl_credit credit align:#right offset:[-1,-15] width:120 height:20 border:false tooltip:"Username" tooltip:"Current Render Credits"
		--button btn_credit credit width:85 height:50 offset:[0,-55] align:#right   border:false tooltip:"Current Render Credits"
		
	
	group "Advanced Settings"
		(
			checkbox test_render "Test Render:" align:#left across:5 tooltip:"Change output size for test rendering."
			dropdownlist cozunurluk items:#("%50 Resolution","%25 Resolution") align:#left offset:[-33,0] width:120 height:50 enabled:false tooltip:"Select the output size percent for test rendering."
			button btn_openBatchRenderUI "Batch Render" align:#right offset:[111,0] width:120 visible:true tooltip:"Use data from batch render dialog box. \nThe Batch render tool offers you to create multiple render job list."
			button btn_updateInfo "Update List" align:#right offset:[121,0] width:120 enabled:false tooltip:"Get render job list in the batch render dialog box."
			label kactakac ""
		)
		
	
	group "Render Job Settings"
	(
		label lbl_priority "Priority:" align:#left across:2 tooltip:"This option offers you economic and powerful alternatives. The default settings is Low. If this render job pool is slow for your deadline, you should increase your priority. \n\nLow: The most economical pricing pool for your render jobs. \n\nMedium: The pool is that more powerful and your render jobs starts earlier than Low Priority pool.\n\nHigh: The pool is that more powerful and your render jobs starts earlier than Medium Priority pool. \n\nVery High: The pool is that the most powerful pool and your render jobs starts firstly."
		label lbl_priorty_type "[Low] - [$0.005 GHz Hour] [Power of 300 cores]" align:#left offset:[-215,0] tooltip:"This option offers you economic and powerful alternatives. The default settings is Low. If this render job pool is slow for your deadline, you should increase your priority. \n\nLow: The most economical pricing pool for your render jobs. \n\nMedium: The pool is that more powerful and your render jobs starts earlier than Low Priority pool.\n\nHigh: The pool is that more powerful and your render jobs starts earlier than Medium Priority pool. \n\nVery High: The pool is that the most powerful pool and your render jobs starts firstly."
		slider priorty_slider "" orient:#horizontal  align:#left offset:[80,0] across:3 ticks:3 type:#integer range:[1,4,1]  width:270 tooltip:"This option offers you economic and powerful alternatives. The default settings is Low. If this render job pool is slow for your deadline, you should increase your priority. \n\nLow: The most economical pricing pool for your render jobs. \n\nMedium: The pool is that more powerful and your render jobs starts earlier than Low Priority pool.\n\nHigh: The pool is that more powerful and your render jobs starts earlier than Medium Priority pool. \n\nVery High: The pool is that the most powerful pool and your render jobs starts firstly." --offset:[-90,0] 
		--dropdownlist render_credit width:175 offset:[-90,0] items:#("[Low] - [$0.005 GHz Hour] - [Power of 300 cores]","[Medium] - [$0.008 GHz Hour] [Power of 600 cores]","[High] - [$0.011 GHz Hour] [Power of 1200 cores]","[Very High] - [$0.014 GHz Hour] [Power of 3360 cores]") width:270 align:#right
		--label lbl_errorcontrol "Error Control:" align:#left across:2
		button btn_runSanityCheck "Check Scene Now!" align:#right offset:[70,-20] width:120 height:50 tooltip:"Check the scene before submitting project to Render724."
		button btn_submit "RENDER" align:#right offset:[0,-20] width:120 height:50 enabled:false tooltip:"Submit project to Render724." --visible:false 
	)
		
		
	group "Logs" 
	(
		label x ""
		label x2 ""
		dotNetControl dnc_report "ListView" align:#center offset:[0,-35] width:605 height:150
		
	)

--
label lbl_secure "Ready to Submit.." align:#left offset:[0,0]
--label lbl_process "Processing..." align:#center offset:[0,0]
progressbar process value:1 color:[225,125,0] width:600 height:20 range:[0,100,50] type:#integer --align:#center offset:[3,-2]

fn help = (
	local q = querybox ("You couldn't submit your project. Wish we to you help?\nIf you click Yes, You will be redirected to Render724. You can upload your project there..") title:"Do you need help?"
	shellLaunch HelpURL ""
	)


fn job_priority_update val =
		(
			if (val > SMTDSettings.MaximumPriority) do (val = (SMTDSettings.MaximumPriority / 2))

			if val <= SMTDSettings.MaximumPriority do
			(
				if keyboard.shiftPressed do val = ((floor(val/10.0))*10.0) as integer
				theRed = (255.0 - 255.0*val/(SMTDSettings.MaximumPriority as float))*2.0
				if theRed > 255 do theRed = 255
				theGreen = 512.0*val/(SMTDSettings.MaximumPriority as float)
				if theGreen > 255 do theGreen = 255

				spn_priority.value = val

				sld_priority.color = [theRed, theGreen, 0]
				sld_priority.value = (val * 100) / SMTDSettings.MaximumPriority
			)
			val
		)


		fn initReportWindow lv =
		(
			local layout_def = #(#("",60), #("",400))
			lv.Clear()
			lv.backColor = (dotNetClass "System.Drawing.Color").fromARGB SMTD_ColorPalette.maxBgColor.r SMTD_ColorPalette.maxBgColor.g SMTD_ColorPalette.maxBgColor.b
			lv.View = (dotNetClass "System.Windows.Forms.View").Details
			lv.gridLines = false
			lv.fullRowSelect = true
			lv.checkboxes = false
			lv.hideSelection = false
			lv.HeaderStyle = lv.HeaderStyle.None
			for i in layout_def do lv.Columns.add i[1] i[2]
		)
		
fn getTimeString =
	(
		timeArray = getLocalTime()
		local hour = if timeArray[5] < 10 then (hour = "0" + (timeArray[5] as string)) else (hour = (timeArray[5] as string))
		local minute = if timeArray[6] < 10 then (minute = "0" + (timeArray[6] as string)) else (minute = (timeArray[6] as string))
		local second = if timeArray[7] < 10 then (second = "0" + (timeArray[7] as string)) else (second = (timeArray[7] as string))
		timeString = hour + ":" + minute + ":" + second
	)


fn getDayString =
(
	theFilterTime = filterString localtime " /\\-:."
	theTime = "- "
	for i = 1 to 3 do theTime += theFilterTime[i] + "-"
	theTime
)
		
fn Ui_report txt LogFileOnly:false AddTimeStamp:true =
		(
			if not LogFileOnly do
			(
				try
				(
					local strStream = txt as StringStream
					local theRange = #()
					local blackColor = (dotNetClass "System.Drawing.Color").fromARGB SMTD_ColorPalette.textColor.r SMTD_ColorPalette.textColor.g SMTD_ColorPalette.textColor.b
					if SMTD_ColorPalette.maxBgColor.v >= 160 then
					(
						--DARK COLORS
						local redColor = (dotNetClass "System.Drawing.Color").fromARGB 192 0 0
						local orangeColor = (dotNetClass "System.Drawing.Color").fromARGB 192 100 0
						local greenColor = (dotNetClass "System.Drawing.Color").fromARGB 0 92 0
						local blueColor = (dotNetClass "System.Drawing.Color").fromARGB 0 0 128
					)
					else
					(
						--LIGHT COLORS
						local redColor = (dotNetClass "System.Drawing.Color").fromARGB 255 128 128
						local orangeColor = (dotNetClass "System.Drawing.Color").fromARGB 255 180 50
						local greenColor = (dotNetClass "System.Drawing.Color").fromARGB 128 255 128
						local blueColor = (dotNetClass "System.Drawing.Color").fromARGB 0 225 255 --192 220 255
					)

					local lineCount = 0
					local foreColor = blackColor
					while not eof strStream do
					(
						local aLine = readLine strStream
						if aLine == "" do continue
						lineCount +=1
						local logLevel = #info
						if lineCount == 1 do	--set the color and log level only if this is the first line of a multi-line log block
						(
							case of
							(
								default: (
									foreColor = blackColor
								)
								(matchPattern aLine pattern:"?--*"): (
									foreColor = redColor
									logLevel = #error
								)
								(matchPattern aLine pattern:"--*"): (
									foreColor = redColor
									logLevel = #error
								)
								(matchPattern aLine pattern:"?!!*"): (
									foreColor = orangeColor
									logLevel = #warning
								)
								(matchPattern aLine pattern:"!!*"): (
									foreColor = orangeColor
									logLevel = #warning
								)
								(matchPattern aLine pattern:"?+*"): (
									foreColor = greenColor
									logLevel = #success
								)
								(matchPattern aLine pattern:"+*"): (
									foreColor = greenColor
									logLevel = #success
								)
								(matchPattern aLine pattern:">*"): (
									foreColor = blueColor
									logLevel = #progress
								)
								(matchPattern aLine pattern:"==*"): (
									foreColor = blueColor
									logLevel = #progress
								)
							)
						)
						local theTimeStamp = (if AddTimeStamp then getTimeString() else "")
						append ::SMTD_LogStream #(theTimeStamp, forecolor, logLevel, aLine)
						if findItem ::SMTD_LogFilters logLevel == 0 do
						(
							local li = dotNetObject "System.Windows.Forms.ListViewItem" (if SMTD_LogShowTimestamp then theTimeStamp else "")
							li.forecolor = foreColor
							local subLi = li.SubItems.add aLine
							append theRange li
						)
					)
					dnc_report.Items.AddRange theRange
					if dnc_report.Items.Count > 0 do dnc_report.Items.Item[dnc_report.Items.Count-1].EnsureVisible()
					local autoRes = dotNetClass "System.Windows.Forms.ColumnHeaderAutoResizeStyle"
					dnc_report.AutoResizeColumns autoRes.ColumnContent
					if not SMTD_LogShowTimestamp do dnc_report.Columns.Item[0].Width = 1
					try(windows.processPostedMessages())catch()
				)catch()
			)
			if AddTimeStamp then
				try( format "[%] : %\n" (getTimeString()) txt to:SMTD_todaysLogFile)catch()
			else
				try( format "%\n" txt to:SMTD_todaysLogFile)catch()
		)
		
fn batch_render = (
		if SMTDSettings.UseBatchRender == true and SMTDSettings.BatchRenderMode == 1 then
						(
							process.value +=10
							Ui_report ">Batch Submission Requested..."
							result = SMTDFunctions.spawnBatchJobsLocal() --forceMaxFile:TempMaxFile
							process.value +=5
							Ui_report  ">End Batch Submission."
							--theMessage = SMTDFunctions.SubmitJobFromUI()
						)
)
fn singletiles = (
	if rendTimeType == 1 then (
	Ui_report("Single Frame Detected..")
	process.value +=5
	SMTDSettings.SingleTileJobDependent = true --setIniSetting SMTDPaths.InIFile "TilesRendering" "SingleTileJobDependent" ( (SMTDSettings.SingleTileJobDependent = state) as string)
	SMTDSettings.SingleTileJobCleanup = true --setIniSetting SMTDPaths.InIFile "TilesRendering" "SingleTileJobCleanup" ( (SMTDSettings.SingleTileJobCleanup = true) as string) 
	SMTDSettings.MultiRegionCopyDraftConfig = false --setIniSetting SMTDPaths.InIFile "MultiRegionRendering" "MultiRegionCopyDraftConfig " ( (SMTDSettings.MultiRegionCopyDraftConfig = false) as string)
	if renderWidth > 2500 then 
	(
		lastX = 5
		lastY = 5
	)  
	else if renderWidth > 1900 and renderWidth < 2500  then 
	(
			lastX = 4
			lastY = 4
	)
	
	else
	(
		lastX = 3
		lastY = 3
	)
	setIniSetting SMTDPaths.InIFile "TilesRendering"  "TilesInX" ( (SMTDSettings.TilesInX= lastX) as string)
	setIniSetting SMTDPaths.InIFile "TilesRendering"  "TilesInY" ( (SMTDSettings.TilesInY= lastY) as string)
	--Ui_report ("+Tiles Rendering: Tiles In X set to [ X: "+ lastX as string+ " Y: "+ lasty as string + "] for this session. Not Sticky.")
	--Ui_report ("+Tiles Rendering: Single Tile Dependent Assembly Job set to [" + state as string + "].")
	--Ui_report ("+Tile/Region Rendering: Copy Draft Config Files To Output Folder set to [" + SMTDSettings.MultiRegionCopyDraftConfig as string + "].")
	--Ui_report ("+Tile/Region Rendering: Single Tile Cleanup Assembly Job set to [" + (SMTDSettings.SingleTileJobCleanup as string + "]."))
	SMTDSettings.RegionRenderingMode = #singleFrameTiles --"#singleFrameTiles" --setIniSetting SMTDPaths.InIFile "MultiRegionRendering"  "RegionRenderingMode" ( (SMTDSettings.RegionRenderingMode = "#singleFrameTiles") as string)
	--Ui_report ("+Tile/Region Rendering Mode set to [" + SMTDSettings.RegionRenderingMode + "]")
    )
	else Ui_report("Multiple Frame Detected..")
)

	fn printFrameSequence mode:#log =
		(
			renderSceneDialog.commit()
			local frames = "1"

			case rendTimeType of
			(
				1: (
					local frames = SMTDFunctions.GetSequenceString #(currentTime.frame as integer)
					case mode of
					(
						#log: (
							(setclipboardText frames) 
							Ui_report (">+SINGLE FRAME:" + frames)
							)
					)
				)
			)
	    )
		
fn updateBatchRenderInfo =
		(
			SMTDSettings.UseBatchRender = true
			SMTDSettings.BatchRenderMode = 1
			local numViews = batchRenderMgr.numViews
			local numActiveViews = (for i = 1 to numViews where (batchRenderMgr.getView i).enabled collect i).count
			kactakac.text =  numActiveViews as string  +" of " + numViews  as string + " Views are Enabled."
			batch_render()

		)
		fn reportSubmissionSettings =
		(
			Ui_report ("File Path: ["+maxFilePath + "]")
			Ui_report("File Name: ["+maxFileName + "]" )
			local txt = ">SCENE INFO:\n"
			try(txt += ("\t\tScene Nodes: "+objects.count as string + "\n") )catch()
			try(txt += ("\t\t\tGeometry: "+geometry.count as string + "\n") )catch()
			try(txt += ("\t\t\tShapes: "+shapes.count as string + "\n") )catch()
			try(txt += ("\t\t\tLights: "+lights.count as string  + "\n") )catch()
			try(txt += ("\t\t\tCameras: "+cameras.count as string + "\n") )catch()
			try(txt += ("\t\t\tHelpers: "+helpers.count as string  + "\n") )catch()
			try(txt += ("\t\t\tSpaceWarps: "+spacewarps.count as string + "\n" ) )catch()
			Ui_report  txt --logFileOnly:true

			local theCam = viewport.getCamera()
			if isValidNode theCam then
				Ui_report ("Current View: ["+ theCam.name + "]" )
			else
				Ui_report ("Current View: Not A Camera" )

		)
		
		on btn_runSanityCheck pressed do
		(
			btn_submit.enabled = true
			--SMTD_MainRollout.Ui_report (">Performing SANITY CHECK...")
			--local st = timestamp()
			local result = SMTD_PerformSanityCheck()
			--SMTD_MainRollout.Ui_report (">Sanity Check took " + ((timestamp()-st)/1000.0) as string + " sec." )
			/*
			if result then
				print "Passed"
				--SMTD_MainRollout.Ui_report (">+The Scene PASSED the Sanity Check.")
			else
				print "Failed"
				--SMTD_MainRollout.Ui_report (">--The Scene DID NOT PASS the Sanity Check!")
			*/
		)
		
		on spn_priority changed value do
		(
			--setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( (SMTDSettings.Priority= (job_priority_update value)) as string )
			SMTDSettings.Priority= (job_priority_update value) as string
			
		)
		
		on sld_priority clicked value do
		(
			setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( (SMTDSettings.Priority= (job_priority_update ((value * SMTDSettings.MaximumPriority) / 100))) as string )
			SMTDSettings.Priority= (job_priority_update value) as string
		)
		
		on btn_openBatchRenderUI pressed do (actionMan.executeAction -43434444 "4096"
			btn_updateInfo.enabled=true)
		on btn_updateInfo pressed do updateBatchRenderInfo()
		--on btn_utils pressed do (SMTDFunctions.openPipelineToolsWindow())
		on btn_credit pressed  do (shellLaunch BuyUrl ""
		)
		
			
		on check_usebatchrender changed state do
		(
			--updateBatchRenderInfo()
			SMTDSettings.UseBatchRender = state
			--setIniSetting SMTDPaths.InIFile "BatchRender" "UseBatchRender" (state as string)
			if check_usebatchrender.checked then (btn_openBatchRenderUI.enabled=true) else btn_openBatchRenderUI.enabled=false
			if not check_usebatchrender.checked then (btn_updateInfo.enabled=false)
		)
		
			on test_render changed state do(
				if test_render.checked then (cozunurluk.enabled=true) else cozunurluk.enabled=false
		)
		
		
		on render_credit selected itm do(
			if render_credit.selected == "[Low] - [$0.005 GHz Hour] [Power of 300 cores]" then setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 1 as string )
			if render_credit.selected == "[Medium] - [$0.008 GHz Hour] [Power of 600 cores]" then setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 2 as string )
			if render_credit.selected == "[High] - [$0.011 GHz Hour] [Power of 1200 cores]" then setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 3 as string)
			if render_credit.selected == "[Very High] - [$0.014 GHz Hour] - [Power of 3360 cores]" then setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 4 as string )
			)
		on priorty_slider changed val  do 
			(
				
				--format "%\n" priorty_slider.value
			
				if priorty_slider.value == 1 then (
					
					lbl_priorty_type.text = "[Low] - [$0.005 GHz Hour] [Power of 300 Cores]"
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 1 as string)
				)
				
				if priorty_slider.value == 2 then (
					lbl_priorty_type.text = "[Medium] - [$0.008 GHz Hour] [Power of 600 cores]"
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 2 as string )
				)
				if priorty_slider.value == 3 then (
					
					lbl_priorty_type.text = "[High] - [$0.011 GHz Hour] [Power of 1200 cores]"
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 3 as string )
				)
				if priorty_slider.value == 4 then (
					
					lbl_priorty_type.text = "[Very High] - [$0.014 GHz Hour] [Power of 3360 cores]"
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 4 as string )
				)
				Ui_report ("+Priority Set "+ lbl_priorty_type.text as string +"]")
				
			/*
			case val of (

				default: (
					lbl_priorty_type.text = "[Low] - $0.005 GHz Hour" 
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 1 as string)
				)
				1: (
				lbl_priorty_type.text = "[Low] - $0.005 GHz Hour"
				setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 1 as string)
				)
				2: (
					lbl_priorty_type.text = "[Medium] - $0.008 GHz Hour"
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 2 as string )
				)
				3: (
					lbl_priorty_type.text = "[High] - $0.011 GHz Hour"
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 3 as string )
				)
				4: (
					lbl_priorty_type.text = "[Very High] -  $0.014 GHz Hour"
					setIniSetting SMTDPaths.InIFile "JobSettings"  "Priority" ( SMTDSettings.Priority = 4 as string )
				)
			)

			*/

			)
					
		on SimpleRenderSubmitter_Rollout open do (
			initReportWindow dnc_report
			SimpleRenderSubmitter_Rollout.title = "Render724 Cloud Render Farm Services  |  " + "User: "+ SMTDSettings.username +"  |  " + getTimeString() 
			Ui_report ("> Ready for ["+ maxfilename +"]")
			--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
			::SMTDFunctions.storeSettingsWithScene()
			local purgeAllFolders = matchPattern (getIniSetting SMTDPaths.InIFile "TempFolders" "PurgeAll") pattern:"true"
			SMTDFunctions.cleanUpSubmissionFolders all:purgeAllFolders
			gc light:true
		)
			
			
			
			
on btn_submit pressed do
(
lbl_secure.text = "Submitting project to Render724.."
Ui_report ">SUBMIT Button Pressed."
btn_submit.enabled = false
local theNetworkRoot= @"\\FILESERVER\Render724-Cloud\cloud_render724\DeadlineRepository10"
local remoteScript = theNetworkRoot + @"\submission\3dsmax\main\SubmitMaxToDeadline_Functions.ms" 
local localScript = getDir #userscripts + "\\SubmitMaxToDeadline_Functions.ms"
if doesFileExist remoteScript do
(
if SMTDFunctions == undefined do
(
deleteFile localScript
copyFile remoteScript localScript
format "%\n" "Kopyalaniliyor"
fileIn localScript
)
---------------------------------------------------------------------------------------------------------------------------------------------
SMTDFunctions.loadSettings()
SMTDSettings.JobName = maxFileName + " [SIMPLE MXS SUBMISSION]  " + "Orange"
SMTDSettings.Comment = "Test Single Frame Tiles Rendering"
--SMTDSettings.SubmitSceneMode = #reposave
SMTDSettings.FailureDetectionJobErrors = 5
SMTDSettings.FailureDetectionTaskErrors = 5
if test_render.checked then
( 
	if cozunurluk.selected == "%50 Resolution" then 
	(
		format "%\n" "%50 Resolution secildi"
		renderWidth = renderWidth / 2
		renderHeight = renderHeight / 2
	)
	
	if cozunurluk.selected == "%25 Resolution" then 
	(	
			format "%\n" "%25 Resolution secildi"
			renderWidth = renderWidth / 4
			renderHeight = renderHeight / 4
	)
	
	SMTDSettings.JobName = maxFileName + " [TEST RENDER SUBMISSION " + cozunurluk.selected + "]" 

)


reportSubmissionSettings()
Ui_report ">Checking For Missing External Files..."

			if SMTDSettings.MissingFiles.count > 0 then
			(
				try(Ui_report ">Missing Files:")catch()
				for i in SMTDSettings.MissingFiles do 
					try(Ui_report ("   " + i ))catch()
				local txt = if SMTDSettings.MissingFiles.count == 1 then "File" else "Files"
				local theMessage = "The Scene Contains "+  SMTDSettings.MissingFiles.count as string +" Missing External "+ txt + ".\n\n"
				if SMTDSettings.WarnAboutMissingExternalFiles then
				(
					if SMTDSettings.IgnoreMissingExternalFiles then
					(
						theMessage += "The 'Ignore Missing External File Errors' option is checked - \n"
						theMessage += "The job will render successfully but incorrectly!\n\n"
					)
					else
					(	
						theMessage += "The 'Ignore Missing External File Errors' option is NOT checked -\n"
						theMessage += "The job will not render correctly. It is suggested to cancel the submission\n\n!"
					)	
					
					theMessage += "Press Yes to Continue Submission.\nPress No to Cancel Submission and Correct the Problems."
					local theAnswer = querybox theMessage title:"Render724: Missing External Files"
					if not theAnswer do (Ui_report("--Submission Canceled by User - Missing External Files Found!")break)
				)
			)

if rendTimeType == 1 then (
	SMTDSettings.SingleTileJobDependent = true
	singletiles()
)
/*
if check_usebatchrender.checked then 
(
	SMTDSettings.UseBatchRender = true
	SMTDSettings.BatchRenderMode = 1
	batch_render()
)
*/	

----------------------------------------------------------------------------------------------------------------------------------------------
process.value = 40
local maxFileToSubmit = SMTDPaths.tempdir + maxFileName
SMTDFunctions.SaveMaxFileCopy maxFileToSubmit

local SubmitInfoFile = SMTDPaths.tempdir + "\\max_submit_info.job"
local JobInfoFile = SMTDPaths.tempdir+ "\\max_job_info.job"
process.value +=15 
SMTDFunctions.CreateSubmitInfoFile SubmitInfoFile
SMTDFunctions.CreateJobInfoFile JobInfoFile
process.value +=5
local initialArgs = "\""+SubmitInfoFile+"\" \""+JobInfoFile+"\" \""+maxFileToSubmit+"\" "
process.value +=5
Ui_report("+ Submitting.. ")
local result = SMTDFunctions.waitForCommandToComplete initialArgs SMTDSettings.TimeoutSubmission --dontWait:true
Ui_report("+ Submitted.. ")

process.value +=30

local renderMsg = SMTDFunctions.getRenderMessage()
SMTDFunctions.getJobIDFromMessage renderMsg
SMTDFunctions.restoreExternalReferencePaths()
Ui_report(result)
if result == #success or result == #queued then 
(
format "Submitted successfully as Job %.\n\n%\n\n" \
SMTDSettings.DeadlineSubmissionLastJobID renderMsg
	process.value = 100
)
else (
format "Job Submission FAILED.\n\n%" renderMsg
process.color = red 
help()
)
btn_submit.enabled = true	
shellLaunch "notepad.exe" SubmitInfoFile
shellLaunch "notepad.exe" JobInfoFile
)--end if
)--end on button presse


		
)--end rollout


createDialog SimpleRenderSubmitter_Rollout height:455 width:625   style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox, #style_resizing ) menu:SMTD_MainRollout_MainMenu
SMTDFunctions.getMaxVersion()
)--end script
@Bobo, @eamsler 
if rendTimeType == 1 then (

singletiles()

)

---------------------------------------------------------------------
fn singletiles = (
	if rendTimeType == 1 then (
	Ui_report("Single Frame Detected..")
	process.value +=5
	SMTDSettings.SingleTileJobDependent = true --setIniSetting SMTDPaths.InIFile "TilesRendering" "SingleTileJobDependent" ( (SMTDSettings.SingleTileJobDependent = state) as string)
	SMTDSettings.SingleTileJobCleanup = true --setIniSetting SMTDPaths.InIFile "TilesRendering" "SingleTileJobCleanup" ( (SMTDSettings.SingleTileJobCleanup = true) as string) 
	SMTDSettings.MultiRegionCopyDraftConfig = false --setIniSetting SMTDPaths.InIFile "MultiRegionRendering" "MultiRegionCopyDraftConfig " ( (SMTDSettings.MultiRegionCopyDraftConfig = false) as string)
	if renderWidth > 2500 then 
	(
		lastX = 5
		lastY = 5
	)  
	else if renderWidth > 1900 and renderWidth < 2500  then 
	(
			lastX = 4
			lastY = 4
	)
	
	else
	(
		lastX = 3
		lastY = 3
	)
	setIniSetting SMTDPaths.InIFile "TilesRendering"  "TilesInX" ( (SMTDSettings.TilesInX= lastX) as string)
	setIniSetting SMTDPaths.InIFile "TilesRendering"  "TilesInY" ( (SMTDSettings.TilesInY= lastY) as string)
	--Ui_report ("+Tiles Rendering: Tiles In X set to [ X: "+ lastX as string+ " Y: "+ lasty as string + "] for this session. Not Sticky.")
	--Ui_report ("+Tiles Rendering: Single Tile Dependent Assembly Job set to [" + state as string + "].")
	--Ui_report ("+Tile/Region Rendering: Copy Draft Config Files To Output Folder set to [" + SMTDSettings.MultiRegionCopyDraftConfig as string + "].")
	--Ui_report ("+Tile/Region Rendering: Single Tile Cleanup Assembly Job set to [" + (SMTDSettings.SingleTileJobCleanup as string + "]."))
	SMTDSettings.RegionRenderingMode = #singleFrameTiles --"#singleFrameTiles" --setIniSetting SMTDPaths.InIFile "MultiRegionRendering"  "RegionRenderingMode" ( (SMTDSettings.RegionRenderingMode = "#singleFrameTiles") as string)
	--Ui_report ("+Tile/Region Rendering Mode set to [" + SMTDSettings.RegionRenderingMode + "]")
    )
	else Ui_report("Multiple Frame Detected..")
)

Updated.

Very Thanks.

I took a look at the two scripts. I have not tried to run them yet (because they are dependent on stuff I have to localize back to work on a computer that is not yours). However I can see in line 506 of the submitter that you are calling within the submit button’s handler this function:

SMTDFunctions.loadSettings()

This function will RESET all settings in the SMTDSettings to their sticky values (depending on a bunch of INI files in the Repository and the local workstation). So if you set any properties like

SMTDSettings.RegionRenderingMode = #singleFrameTiles 

if that value is not sticky via a local INI file, after pressing the submit button the value of the property would be reset to full frames…

The SMTDFunctions.loadSettings() should only be called once when the submitter is starting, before you start modifying any of its settings via the UI or other MAXScript code.

Hope this helps!

Privacy | Site terms | Cookie preferences