Get current pass index via maxscript during batch rendering

dlparisi
Posts: 25
Joined: Tue Sep 05, 2017 1:52 am

Get current pass index via maxscript during batch rendering

Postby dlparisi » Fri Aug 26, 2022 2:20 pm

I'm trying to script automatic saving (and loading) the Vray6 VFB rendering for each pass in order to emulate the separate frame buffers for each pass from Vray Next. It's all going generally OK for one pass but gets messed up when I rendering during batch rendering (i.e., when multiple passes are selected). The saved image name uses the pass name as part of it (pulled from RPMData.GetPassSelection()and RPMdata.GetPassName index) but this only works when one pass is selected since RPMData.GetPassSelection() returns multiple numbers if more than one pass is selected. Is there any way via maxscript to get the current pass index (or name) it's currently rendering in this case? Am I messing something up?

BTW - as of 8/25/22 the rpmanager documentation website seems to be down at http://www.rpmanager.com/documentation/ ... ipt_access . All I get is a "Not Authorized to View This Page [CFN #0004]" error. I've been using the internet archive to pull up the archived version.

Thanks.

admin
Site Admin
Posts: 136
Joined: Mon Jun 19, 2017 4:08 pm

Re: Get current pass index via maxscript during batch rendering

Postby admin » Sun Aug 28, 2022 2:52 am

Hey

Thanks for the heads up on the wiki not working, must be some permissions change from the hosting servicel, I'll see if I can sort it out.

--

Try testing this during the render:

rpmdata.passthenumb

as each time it restores a pass it sets that value to the unique identifier. You can get the pass index from that with

rpmdata.getindexfromunique rpmdata.passthenumb

--

Just so I'm clear on what you are doing, for vray 5 I added the 'Store and restore Vray VFB Layers' option to the 'RPM::Extras' rollout of the Renderer Setup which sounds like it is meant to do what you are sorting out -or it is something else? I haven't tried that option with VRay 6 yet, but if the interface hasn't changed it may still work (I'll look into that too).

thanks,
grant

dlparisi
Posts: 25
Joined: Tue Sep 05, 2017 1:52 am

Re: Get current pass index via maxscript during batch rendering

Postby dlparisi » Sun Aug 28, 2022 2:32 pm

Thanks Grant. The "rpmdata.getindexfromunique rpmdata.passthenumb" worked great and did exactly what I needed. I am using the new "Store and restore Vray Layers" option to restore the layers but what I'm trying to enable is for the new VFB to behave in the same manner as Vray Next where each pass has it's own VFB that doesn't get destroyed when you render a different pass. I'm trying to script that If you switch to a different pass it will pull up the saved last rendered image from that pass that get's stored (and overwritten) on each render completion. I'm doing a vrimg save via a postrender callback and loading up the image via a "before" script in the RPManager rollout (see below). I've disabled "auto load layers" in the vray history settings and I'm still relying on the "Store and Restore Vray layers" to load all of the correct layers for each pass. This is because the vrimg is only stored after the render is complete and if you change the layers after the render is complete and you switch to a new pass all of these changes would be lost. I'm sure my scripting is way messier than it should be but it seems to be working for me although I need to do a bit more testing before I start using for production scenes. One unforeseen benefit of this too is that if I close a scene and open it again the passes all load up as if nothing was ever closed. Of course this also means I'm saving out additional files but they're pretty small and not too impactful overall.

Somewhat off topic - were you able to look into being able to access the saved VFB exposure, WB, etc info from old Vray Next VFB scenes while opening them in Vray 5/6? For example, I have scenes with 20+ passes made in Vray Next, each with different exposure, highlight burn, WB, etc in the VFB. When I open this in vray 6 none of the old VFB settings get transferred into the new layer system, they are essentially lost. It does seem though that the information is still contained in each pass, I just don't know how to access it.

Last question, for the Before/After scripts rollout what does "before" mean and what does "after" mean? Why would I place a script in one versus the other? Is it "before" the pass is restored, before it's rendered via the Selected or Checked buttons, something else. Same for "after", does it run when you switch to to new pass, after a render is complete, etc? I cant find clarification on this in the docs.

Thanks,
David

admin
Site Admin
Posts: 136
Joined: Mon Jun 19, 2017 4:08 pm

Re: Get current pass index via maxscript during batch rendering

Postby admin » Sun Aug 28, 2022 4:23 pm

Hi

I haven't had a chance too look at migrating the vfb setup from earlier vrays.

Regarding the Before/After - it might be clearer to think of it as 'entering' and 'leaving'. A before script can setup whatever you want prior to render, as part of restoring the pass. The After is for cleanup/revert of whatever you have set, and may not be needed - for example if every pass sets a particular variable, there is no need for an 'after' to revert it. But if a single pass changes something that will affect every other pass, you would either have to make sure that is set for all the other passes - or simply use the After to undo/revert what the Before did.

cheers,
grant

dlparisi
Posts: 25
Joined: Tue Sep 05, 2017 1:52 am

Re: Get current pass index via maxscript during batch rendering

Postby dlparisi » Sun Aug 28, 2022 6:06 pm

Got it. Thanks for the update.


Return to “Questions”

Who is online

Users browsing this forum: No registered users and 1 guest