Making a script stop a render/network render until the script is okayed by a user

Hi all, I started this script

http://www.scriptspot.com/3ds-max/scripts/hide-and-unhide-all-bones-and-...

and as you can tell it's very basic. Tassel came up with a more user friendly version and i'd like to enhance my script.

What I'd like to achieve is when this script is added to the pre-render scripts area, the script halts rendering until the relevant buttons are pressed. I'll add a "Render" button to it, but forst you pick "Hide Bones" to hide them and when you click the render button, max then renders the image.

The scripts i attached to my upload dont have any use inteface and just run "behind the scenes". This was intentional so that a user can add them and forget them.

But now i'd like to add some functionality, but still keep the script able to be used in the pre-render area if possible. Presently, with Tassel's version loaded in, the script opens the dialog, but the render happens anyway before you've told it to hide/unhide bones.

So, is there a fumction i can use to halt rendering while the script is active?

 

Comments

Comment viewing options

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

Hi Tassel, It's effectively

Hi Tassel,

It's effectively the script that your wrote with an extra button called Render.

Heres the script with some notes that i was thinking of.

--Destroy the dialog if it is already open
try(destroyDialog roll_SB_Tools)catch()

-- The first thing i want the script to do is when run is to stop rendering from happening if rendering has been clicked. If it hasn't then the script can run as normal and bones hidden/unhidden
-- at the moment if the script is added to pre-rendering it opens, but the rendering happens regardless so if the bones are on, the bones render. I would like this script to halt the rendering, you
--click hide bones and then when you click render the rendering begins again. I'm not sure if this would be suitable for network rendering though.

-- Create a rollout
rollout roll_SB_Tools "SB Tools V1.0"
(
-- UI STUFF
group "Hide / Unhide (Bones And Helpers)"
(
button btn_SBHide "..:: HIDE ::.." width:85 height:24 align:#left tooltip:"Hide bones and helpers" across:2
button btn_SBUnhide "..:: UNHIDE ::.." width:85 height:24 align:#right tooltip:"UN-Hide bones and helpers"
)
group "Render"
(
button btn_render "..::RENDER::.." width:85 height:24 align:#left tooltip:"Press to start rendering"
)

HyperLink hl_homepage "..:: MY SCRIPTS ::.." address:"http://www.scriptspot.com/users/script-butler/" color:(color 255 255 255) hovercolor:(color 111 111 111) visitedcolor:(color 255 255 255) height:22 align:#center
-------------------------------------------------------------------------------------------------------------------------------------------------------
-- GROUP "Hide / Unhide (bones and helpers)"
-------------------------------------------------------------------------------------------------------------------------------------------------------
on btn_SBHide pressed do
(
hideByCategory.bones = true
hideByCategory.helpers = true
)

on btn_SBUnhide pressed do
(
hideByCategory.bones = false
hideByCategory.helpers = false
)
-------------------------------------------------------------------------------------------------------------------------------------------------------
-- GROUP "Render"
-------------------------------------------------------------------------------------------------------------------------------------------------------
--on btn_render pressed do (I'M UNSURE ON SCRIPTING COMMANDS TO MAKE THE RENDER HAPPEN
--(
--START RENDERING COMMAND HERE
--)
-------------------------------------------------------------------------------------------------------------------------------------------------------

) -- End of script

--Create the dialog and stuff
createDialog roll_SB_Tools width:200 height:150

Cheers.

Script_Butler

tassel's picture

Hi, Can you make an mock-up

Hi,

Can you make an mock-up drawing of what you want, i don't thimk i fully understand it :o)

//Tassel

Raymond H.Ingebretsen - http://www.homme3d.com

Comment viewing options

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