Vray IR Map, Nth Frame problem...Max Version of this....

Having the same issue as on this thread for Maya…
viewtopic.php?f=11&t=7989&p=33218&hilit=irradiance+map#p33218

Is there any hack for 3dsmax to make it work?

What we need is a secret setting in deadline to specify Nth frame rendering that gets picked up by 3dsmax.py…

I’m currently digging, will report back when I’ve found a hack…

So we can set “for frame in range( self.StartFrame, self.EndFrame + 1 ):” to have a ‘by’ value…

Just need to pass the NthFrame value from Max to Deadline…

in 3dsmax.py

StartFrame = 0 EndFrame = 0 CurrentFrame = 0 NthFrame = 1 ##DW## Added Nth Frame value

[code]# This renders the current task.
def RenderTasks( self ):
if self.RegionRenderingSingleJob:
self.StartFrame = GetIntegerPluginInfoEntryWithDefault( “RegionSingleFrame”, 0 )
self.EndFrame = GetIntegerPluginInfoEntryWithDefault( “RegionSingleFrame”, 0 )
else:
self.StartFrame = GetStartFrame()
self.EndFrame = GetEndFrame()

	VerifyMonitoredManagedProcess( self.ProgramName )
	
	SetProgress( 0.0 )
	
	denominator = self.EndFrame - self.StartFrame + 1.0
	for frame in range( self.StartFrame, self.EndFrame + 1, self.NthFrame ): ##DW## PUT IN A 'BY' VALUE
		self.RenderFrame( frame )
		
		if denominator != 0:
			progress = ( (frame - self.StartFrame + 1.0) / denominator ) * 100.0
			SetProgress( progress )
			#SetProgress( ( (frame - self.StartFrame + 1) / denominator ) * 100.0 )
		
		VerifyMonitoredManagedProcess( self.ProgramName )
		
	SetProgress( 100.0 )[/code]

If I set this NthFrame value to 10 now it works, rendering every 10th frame whilst in a range of 0-400… but this is a global setting of course and not linked to a job setting.

StartFrame = 0 EndFrame = 0 CurrentFrame = 0 NthFrame = 10 ##DW## Added Nth Frame value

I’m trying to work out where exactly I add into the 3dsmax.py the part where it reads an ‘NthFrame’ value from the job plugin, and how I add it into the submission process of 3dsmax so it gets added to the plugin file.

Any help appreciated! :slight_smile:

Got it working :slight_smile:

We need to add the NthFrame value to the SMTD Settings and put it into our job info file.

SubmitMaxToDeadline_Functions.ms

ChunkSize = 1, SequentialJob = false, MaxVersionToForce = "none", MaxVersionToForceSticky = false, NthFrameRendering = 1, --##DW CODE

[code]if( ((maxVersion())[1]/1000 as integer) >= 12 ) then
if( maxOps.productID == #3dsMaxDesign ) then
format “IsMaxDesign=1\n” to:JobInfoFile
else
format “IsMaxDesign=0\n” to:JobInfoFile
else
format “IsMaxDesign=0\n” to:JobInfoFile

			--##DW CODE
			format "NthFrame=%\n" SMTDSettings.NthFrameRendering to:JobInfoFile
			--##END DW CODE[/code]

So to get the value read we add in the SMTD process add this bit…

3dsmax.py

[code]if self.IsMaxDesign:
LogInfo( “Rendering with 3dsmax Design version: %d” % self.Version )
else:
LogInfo( “Rendering with 3dsmax version: %d” % self.Version )

	##DW CODE
	self.NthFrame = GetIntegerPluginInfoEntry( "NthFrame" )
	##END DW CODE
	
	# Read in the Build of 3dsmax to force.
	self.ForceBuild = GetPluginInfoEntryWithDefault( "MaxVersionToForce", "none" ).lower()
	LogInfo( "Build of 3dsmax to force: %s" % self.ForceBuild )[/code]

And finally the UI Tweak…

SubmitmaxToDeadline.ms

rollout SMTD_JobOptions "Job Options:" ( local VSpacing = 22 --##DW CODE label lbl_chunk "Render Task Chunk Size (Frames Per Task):" align:#left pos:[23,5] across:3 --offset:[-112,3] spinner spn_chunkSize "Frames: " range:[1,1000,1] type:#integer align:#right fieldwidth:50 offset:[20,0] \ tooltip:"Defines the number of Tasks (Frames) to be processed at once by a Slave." spinner spn_nthFrameRendering "Chunk Nth: " range:[1,1000,1] type:#integer align:#right fieldwidth:50 offset:[0,0] \ tooltip:"Used to allow one machine to render nth frames for one task assignment." --##END DW CODE

[code]on SMTD_JobOptions open do
(
SMTD_MainRollout.Ui_report “>Opening Job Options Rollout”

		--RESTORE UI VALUES FROM STRUCT
		spn_chunkSize.value = SMTDSettings.ChunkSize
		--##DW CODE
		spn_nthframerendering.value = SMTDSettings.NthFrameRendering
		--##END DW CODE[/code]

on spn_chunkSize changed value do ( setIniSetting SMTDPaths.InIFile "JobSettings" "ChunkSize" ( (SMTDSettings.ChunkSize = value) as string) SMTD_MainRollout.Ui_report ("+Job Options: Chunk Size set to [" + value as string + "]") ) --##DW CODE on spn_nthframerendering changed value do ( setIniSetting SMTDPaths.InIFile "JobSettings" "nthFrameRendering" ( (SMTDSettings.nthframerendering = value) as string) SMTD_MainRollout.Ui_report ("+Job Options: Nth Frame Chunk set to [" + value as string + "]") ) --##END DW CODE

I take no liability for breaking your deadline installation, always make a backup :wink:

Whilst I’ve since realised these hack could be considered unnecessary due to the way Deadline works, but it works quite nicely with some of our other tools and prevents a job being interrupted accidentally.

Trying to get it to work for Deadline 6 but it’s not working, and due to the changes from file system to database I’m not able to debug it again…

In…

def RenderTasks( self ):

frame = frame + (1 * self.NthFrame) ##DW## put in nth Frame value

This makes the nth Frame work, but this line is now not working…

self.NthFrame = GetIntegerPluginInfoEntry( “NthFrame” )

I have the nthFrameRendering value in the SMTDFunction struct set…
NthFrameRendering = 1,

and in
fn CreateJobInfoFile…

I have…
format “NthFrame=%\n” SMTDSettings.NthFrameRendering to:JobInfoFile

so I can only assume this value is being sent to the info file correctly…

Infact in the deadline6\temp folder in…

max_job_info.job

there is…

NthFrame=10

so my question is… why isn’t this bit working…

try:
self.NthFrame = GetIntegerPluginInfoEntry( “NthFrame” )
except:
self.NthFrame = 1

Is this new ‘custom’ value not being sent into the database? How can I query whether it is there or not?

Aha… of course, needed self.Plugin to work…

self.NthFrame = self.Plugin.GetIntegerPluginInfoEntry( “NthFrame” )