How to Render through Maxscript to vray VFB

So if I set my renderer to vray, and run this maxscript command:

render vfb:off

It does a vray render (vfb off is to turn off the standard max vfb)

But after rendering to the vray vfb, the vfb disappears. If I run this command:

renderers.current.showLastVFB()

It shows me the vray vfb, but it doesn’t contain the image I rendered using the maxscript render command, it contains the last image I rendered using the max ui.

How can I render to the vray vfb through maxscript such that the vfb remains up, or how can I view the vfb that contains my last rendered image using the maxscript render command? Thanks.

- Neil

Please to see you’re making the switch, I can’t help you though with this problem unfortunately.

I’ve been using VFB+ plugin which doesn’t disappear when using texmappreview.

The VFB is created and maintained by the renderer object. When you use the render() command, internally it creates a new renderer, copies the settings from the production one, and then destroys it. The VFB into which this temporary renderer writes the image is destroyed along with it.

How can I render to the vray vfb through maxscript such that the vfb remains up, or how can I view the vfb that contains my last rendered image using the maxscript render command? Thanks.You can do that by using the 3ds Max “render last” or “render” command, rather than the render() call.

Best regards,
Vlado

So for example the render last command is max render last; the command to render the current view is max quick render.

Best regards,
Vlado

Slowly but surely :slight_smile:

- Neil

That’s only true of vray though, correct? Because if I use the render() command with scanline, mentalray or brazil, the vfb remains up.

So the disadvantage of that technique is that I am not trying to do an exact copy of the production renderer. I want to change a bunch of parameters. Which is why using the render() command has advantages, since it can take arguments that are different from the current settings.

So I suppose if I can only use render last, I need to store the current values of all the parameters I want to change, change the parameters, do render last, then change all the parameters back?

Thanks for the suggestions so far.

- Neil

If you don’t use the V-Ray VFB, then V-Ray will render to the standard 3ds Max frame buffer and will work identically to all the other renderers. But the V-Ray VFB on the other is tied to the renderer, yes.

So the disadvantage of that technique is that I am not trying to do an exact copy of the production renderer. I want to change a bunch of parameters. Which is why using the render() command has advantages, since it can take arguments that are different from the current settings. You could consider the V-Ray VFB to be a part of the renderer settings :slight_smile:

So I suppose if I can only use render last, I need to store the current values of all the parameters I want to change, change the parameters, do render last, then change all the parameters back?If you want to use the V-Ray VFB, yes. If the 3ds Max VFB is ok, then you can use the render() command.

We could think about making the V-Ray VFB global for all renderer instances, but I it is a bit of work and must be tested carefully.

Best regards,
Vlado

I think that would be a good idea. In the meanwhile, I’ll use the parameter swap technique in my script and use render last. I’ll let you know how it goes. Thanks for all the information!

- Neil

So lets say I use “max quick render” to render to the vfb, how do I then save the resulting image through maxscript?

- Neil

See here: http://help.chaosgroup.com/vray/help/200R1/render\_maxscript.htm#vfb

Specifically the vrayVFBGetChannelBitmap() function.

Best regards,
Vlado

Thanks Vlado. So the reason I didn’t find that was because the url

http://help.chaosgroup.com/vray/help/

redirects to the 1.5 help file. So I was looking at the wrong helpfile. Now that I know where the vray 2 helpfile is, I’m set. But you may want to have the website guys redirect to the latest and greatest. Thanks again!

- Neil