"on Click" with label, block Max and script execution

Hello, i am looking for some help.

In the code bellow, when you clik on the label, it start a quick render.

The problem is that 3dsmax is totally blocked until the render is finished.
And its totaly impossible to stop the current render. do you know a solution ?

i seen that it's not the case with a button and "on btn pressed" .
But i have to put some img in this label, and use Mousehover function etc.... so it's why i use a label instead of a button)

Thanks you

try(destroydialog ::test)catch()
rollout test "test" width:400 height:44
(
	dotnetcontrol btn14 "Label" pos:[1,1] width:40 height:40
 
	on btn14 click do ( 
		max quick render 
		print "test"
	)
 
	)
createDialog test

Comments

Comment viewing options

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

...

I also use labels controls all the time instead of buttons but not for same reason.
Instead of using "max quick render" use simple "render()" function which allows escape key. Also you can use many options that this function provide (see max script help). In your case

try(destroydialog ::test)catch()
rollout test "test" width:400 height:44
(
	dotnetcontrol btn14 "Label" pos:[1,1] width:40 height:40
 	on btn14 click do ( render() ; print "test")
)
createDialog test

Just press Escape key to quit the rendering process

barigazy

Romeh's picture

Thanks barigazy,actually i

Thanks barigazy,

actually i use the VrayFrameBuffer, so it seem to be the problem... escape key dont work when i use VrayFB, but work when i use max frame buffer.

but also i have seen that if i minimize/maximize max, i can now use the escape key even with VrayFB. but it's boring and not effective...

but unfortunately i need to use the VrayFB, i'm now looking an alternative to minimize/maximize.

i going to have a look to render() options

i will be back :)

Comment viewing options

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