Close Rendered Frame Window(VFB) after finish rendering

Close Rendered Frame Window(VFB) after finish rendering

Carlo3000
Contributor Contributor
1,820 Views
10 Replies
Message 1 of 11

Close Rendered Frame Window(VFB) after finish rendering

Carlo3000
Contributor
Contributor

Hi, I cannot find a solution for this simple issue:

I created pymxs script that renders the scene in the loop and I get two VFB's after finishing each rendering (main render and matID renderElement). After the whole loop, I get hundreds of VFB opened.

 

Can someone help me to find a solution to close the main VFB and renderElement VFB after each rendering?

 sadly vfb:off is not suitable for me, because I want to see the current rendering progress.

0 Likes
1,821 Views
10 Replies
Replies (10)
Message 2 of 11

Carlo3000
Contributor
Contributor

I found some workaround by directly accessing UI elements:

rt.closePopups(rt.UIAccessor.GetPopupDialogs())

 

but now it closes all popups including the render setup dialog.

How to filter only VFB?

I'm trying by filtering:

"if rt.uiacess.getWindowClassName(firstChild) == "BitmapWindow":"

but it's not working.

0 Likes
Message 3 of 11

Swordslayer
Advisor
Advisor

Filter the popup by the dll name, for example for the scanline one, getFilenameFile (UIAccessor.getWindowDllFileName hWnd) will give you bmm, for vray framebuffer you will get something like vray2022 etc.

0 Likes
Message 4 of 11

Carlo3000
Contributor
Contributor

Thank you! I will try

Edit:

I don't know what happened, but this code "rt.closePopups(rt.UIAccessor.GetPopupDialogs())" is not working anymore. I get error "AttributeError: 'pymxs.runtime' object has no attribute 'closePopups'"

I updated Python up to 3.10, reverted back to 3.7.6 but still nothing.

 

I still can't believe that 3ds max doesn't have a simple command to close VFB like "renderSceneDialog.close()" for RenderSetup.

 

Edit:

managed to wrap old maxscript code in pymxs to work:

"popDialogs = rt.UIAccessor.GetPopupDialogs()
for d in popDialogs:
rt.UIAccessor.CloseDialog(d)"

now trying to filter that I could leave MaxScript Listener open while running the code.

0 Likes
Message 5 of 11

Swordslayer
Advisor
Advisor

@Carlo3000 wrote:

I don't know what happened, but this code "rt.closePopups(rt.UIAccessor.GetPopupDialogs())" is not working anymore. I get error "AttributeError: 'pymxs.runtime' object has no attribute 'closePopups'"


If you were using it without knowing where it came from, it was probably some global function of another script you were using (the naming doesn't really make much sense anyway if you have to pass the window handles to it...).

 

As for filtering the window handles, that's the point of my previous reply, filter by the associated dll (for the listener it's MAXScrpt.dll so it's not like there could ever be any conflict with render windows...).

0 Likes
Message 6 of 11

Carlo3000
Contributor
Contributor

Thank you, will try

0 Likes
Message 7 of 11

domo.spaji
Advisor
Advisor

Why don't you use Vray frame buffer (and switch elements in same window)?

Max frame buffer would also be good enough for this elements, if only you would use UI Render Setings.

What's the point of rewriting existing tools, specially boring ones like render settings? Not a real question

0 Likes
Message 8 of 11

Carlo3000
Contributor
Contributor

Sadly I use Octane Renderer and it batch renders only through standard Rendered Frame Window

0 Likes
Message 9 of 11

tagopinath
Enthusiast
Enthusiast

In maxscript, what we tried is like below, which works.

 

vfb = render outputfile:"D:\\test.bmp" vfb:true

close vfb

 

Dont know whether this will work for your case.

 

Regards,

Gopi.

Message 10 of 11

Goldexer
Community Visitor
Community Visitor

Shaking your hand man! It works perfectly even for my Scanline render script, it DOES closing the rendered frame popup!

To close rendered frame window you can use « actionMan.executeAction 0 "348" » command (works toggling for both open/close) but it does nothing to render VFB.

0 Likes
Message 11 of 11

tagopinath
Enthusiast
Enthusiast

Thank you

0 Likes