Trying to create a script that is called when sending file to RebusFarm

Hello,

I'm trying to write a script that alerts user about certain things (regions, image size, denoising etc.) when sending my Corona (3ds max) render to RebusFarm.
I've got it mostly working but the problem is I don't know how to trigger the script when "Render with RebusFarm" is clicked.
Have you guys ever tried to do something similar? Callback would probably be the best choice but I've not found an event that triggers when starting the Farminizer.
Since RebusFarm doesn't really have a forum, I don't know where else to post this.

--Otso

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jahman's picture

.

You can add your own menu item that will check scene validity and then start farminizer

macroScript CustomRebusStart
category:"Jahman"
tooltip:"Check scene and start Rebus"
(
	fn checkSceneValidity = 
	(
		-- do some checks here
		messageBox "Scene is valid for rendering\nPress to start Farminizer..." 
		return true
	)
 
 
	local validScene = checkSceneValidity()
 
	if validScene do macros.run "Rebus" "RebusFarminizer"
 
 
)
 
-- below script is a part of rebus_main.ms that is located here: %appdata%\Local\Autodesk\3dsmax\*maxversion*\ENU\scripts\startup\rebus
-- if menuMan.registerMenuContext 0x76f128b0 then -- I commented this out because it will prevent you from adding anything to Rendering menu
(
	mnu_render = undefined
	mnu_arr = #("&Rendering", "&Rendern", "&Rendu", "\xe6\xb8\xb2\xe6\x9f\x93\x28\x26\x52\x29", "\xe3\x83\xac\xe3\x83\xb3\xe3\x83\x80\xe3\x83\xaa\xe3\x83\xb3\xe3\x82\xb0\x28\x26\x52\x29", "\xeb\xa0\x8c\xeb\x8d\x94\xeb\xa7\x81\x28\x26\x52\x29")
	for r in mnu_arr do
	(
		local mn = MenuMan.findMenu r
		if mn != undefined then
			mnu_render = mn
	)
 
	if mnu_render != undefined then
	(
		mnuItm_action = MenuMan.createActionItem "CustomRebusStart" "Jahman"
		if mnuItm_action != undefined then
		(
			mnuItm_action.setUseCustomTitle true
			mnuItm_action.setTitle "Check and Render with RebusFarm..."
			mnu_render.addItem mnuItm_action 2
			MenuMan.updateMenuBar()
		)
		else
			messagebox "Could not add RebusManager to your Rendermenu, please go to \"Customize User Interface\" and select it from the category \"Rebus\"" title:"Rebus Farminizer"	
	)
	else
		messagebox "Could not add RebusManager to your Rendermenu, please go to \"Customize User Interface\" and select it from the category \"Rebus\"" title:"Rebus Farminizer"	
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.