Notifications
Clear all

[Closed] How to create a movable dialog while rendering?

as the title says… how can i create such dialog?.. i want to create a dialog which has some “timer ui animations” in it, and i want to move the dialog inside max window – while rendering… the problem is while rendering the “timer ui animation” stops and i cant move the dialog inside max window …

33 Replies

as the title asks…

3 Replies
(@oncire)
Joined: 11 months ago

Posts: 0

sometimes its block by the vfb window…i just want the option to move it around…anywhere in max window… also i have some information that is showing via a ui timer animation every half a sec… but my problem is the animation also stops – while rendering

(@denist)
Joined: 11 months ago

Posts: 0

sure it stops… because they are in the same thread. could you not move it before rendering starts? there are several render notification callbacks… some of them might help you. see the mxs help -> General Event Callback Mechanism -> Rendering Notifications

(@oncire)
Joined: 11 months ago

Posts: 0

thanks denis for the reply… ill look into it … actually the dialog will popup when the rendering starts…i just need that option to be able to move it… and i want to put the information inside the dialog via some sort of small animation while rendering… so i can see the information always as im rendering… – its like the “vray message window”

what dialog is it?

1 Reply
(@oncire)
Joined: 11 months ago

Posts: 0

my own scripted dialog…the thing i want to be a movable dialog

here is my sample script dennis … you can look into it

(
	global test
	local timerstate = 1
	try(destroydialog test) catch()
	rollout test "test dialog"
	(
		label lab1 ""
		timer timer1 interval:500
		
		on timer1 TICK do
		(
			case timerstate of
			(
				0: 
				(
					lab1.text = "sample information" 
					timerstate = 1
				)
				1:
				(
					lab1.text = "" 
					timerstate = 0
				)
			)
		)
	)
	createdialog test width:250 height:60 pos:[35,120] style: #(#style_toolwindow)

	while not (keyboard.escpressed) do --as long as esc is not press, render
	(
		max quick render
		exit with (escispressed = keyboard.escpressed)
	)

	if escispressed == false then --
	( 
		--my code here
		"Render Done!"
	) 

	else --if esc is pressed do the ff:
	(
		--my code here
		try(destroydialog test) catch()
		"interrupted"
	)
)
 lo1

You have to do it using the

GetCOREInterface8()->RegisterModelessRenderWindow(Hwnd window);
GetCOREInterface8()->UnregisterModelessRenderWindow(Hwnd window);

command in the C++ SDK.

Unfortunately, it doesn’t look like they ported this command to the .NET SDK, so it’s not callable from maxscript

2 Replies
(@denist)
Joined: 11 months ago

Posts: 0

very interesting. never played with it but i will. thanks for the pointing.

(@haavard)
Joined: 11 months ago

Posts: 0

Adding this to the script seems to work for me, no?

g = (dotnetclass "Autodesk.Max.GlobalInterface").Instance
g.Coreinterface8.RegisterModelessRenderWindow (dotnetobject "System.IntPtr" test.hwnd)
 lo1

If I remember correctly, you must call it recursively for every single control in your dialog as well.

 lo1

Looks like I’m going blind then

thanks guys for the replys…but i cant process all the “code” you just described here… :banghead: …as im a not realy expert in maxscript… still dont know how to do it… can someone light me how to do it…

Put the it under the createDialog line:

createdialog test width:250 height:60 pos:[35,120] style: #(#style_toolwindow)

g = (dotnetclass "Autodesk.Max.GlobalInterface").Instance
g.Coreinterface8.RegisterModelessRenderWindow (dotnetobject "System.IntPtr" test.hwnd)
1 Reply
(@oncire)
Joined: 11 months ago

Posts: 0

tried but gives an error :
–Unknown property: “Coreinterface8” in undefined

because:
g = (dotnetclass “Autodesk.Max.GlobalInterface”).Instance – results in undefined

I’m guessing your max version is too old. This is just a shot in the dark, but the Autodesk.Max.dll was called Interfaces.dll in older versions of max (versions < 2011 ?), and I’m not sure if it was loaded on startup like Autodesk.Max.dll is now. Try locating it in your root folder and load it using dotnet.loadAssembly “path”. The .net namespace should still be the same though.

1 Reply
(@oncire)
Joined: 11 months ago

Posts: 0

im using 3dsmax design 2014… ill try locating… i dont know if i can make it to work. as i dont have experience in dotnet :(…

is the code:

g = (dotnetclass "Autodesk.Max.GlobalInterface").Instance
g.Coreinterface8.RegisterModelessRenderWindow (dotnetobject "System.IntPtr" test.hwnd)

working in your system? what version of 3dsMax?

Page 1 / 2