# VFB #setRegion through maxscript

**URL:** <https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574>\
**Category:** Issues\
**Created:** [April 6, 2023, 5:31pm UTC](https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574 "2023-04-06T17:31:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugenio\_miolo](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@eugenio\_miolo](https://forums.chaos.com/u/eugenio_miolo)\
**Post date:** [April 6, 2023, 5:31pm UTC](https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574/1 "2023-04-06T17:31:26Z")

</div>

Hello,

From the [docs](https://docs.chaos.com/display/VMAX/Controlling+the+VFB+Programmatically) about getting/setting VFB render region info:

> _\* The returned values in the VFB are relative to the VFB window margins instead of to the actual rendered image._  
> So the way we set render regions through maxscript has changed in Vray 5. This seems such a weird change…

The issue however, is that now it seems impossible to set render regions accurately through maxscript because the values depend on the current space size where the image is displayed, and this data is not available. So resizing the VFB window messes up all the region placement coordinates.

Do you have any tips on how to do that?

Thanks,  
Eugenio  
​

---

<div class="post-metadata">

**Author:** ![dlparisi](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/dlparisi/32/14236_2.png) [@dlparisi](https://forums.chaos.com/u/dlparisi)\
**Post date:** [April 6, 2023, 6:21pm UTC](https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574/2 "2023-04-06T18:21:34Z")

</div>

I’m not sure what they are describing with the “relative to the VFB window margins…”, it works just as I’d expect it to with the coordinates based on the origin 0,0 at the upper left. The only thing I can think of is that it’s based on the size of the current image in the frame buffer, not what’s in the render setup dialog.

---

<div class="post-metadata">

**Author:** ![vladimir\_krastev](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/vladimir_krastev/32/42177_2.png) [@vladimir\_krastev](https://forums.chaos.com/u/vladimir_krastev)\
**Post date:** [April 7, 2023, 2:52pm UTC](https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574/3 "2023-04-07T14:52:56Z")

</div>

Hi, thanks for posting. What version of V-Ray are you using @eugenio_miolo ? The coordinates are based on rendered image and not VFB window in latest V-Ray 5, update 2.3 and V-Ray 6 versions. In V-Ray 5.10.01 the coordinates are affected by VFB window size, which is fixed in later builds so please update if you can.

---

<div class="post-metadata">

**Author:** ![dlparisi](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/dlparisi/32/14236_2.png) [@dlparisi](https://forums.chaos.com/u/dlparisi)\
**Post date:** [April 7, 2023, 3:00pm UTC](https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574/4 "2023-04-07T15:00:04Z")

</div>

> [@vladimir\_krastev](#):
>
> The coordinates are based on rendered image and not VFB window in latest V-Ray 5, update 2.3 and V-Ray 6 versions. In V-Ray 5.10.01 the coordinates are affected by VFB window size, which is fixed in later builds so please update if you can.

Good to know. This needs to be fixed in the [docs](https://docs.chaos.com/display/VMAX/Controlling+the+VFB+Programmatically) then since it still has that confusing language..

---

<div class="post-metadata">

**Author:** ![eugenio\_miolo](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@eugenio\_miolo](https://forums.chaos.com/u/eugenio_miolo)\
**Post date:** [April 8, 2023, 6:53pm UTC](https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574/5 "2023-04-08T18:53:59Z")

</div>

Thanks for the answers,

I’m currently on 3ds max 2021 - Vray 5.10.02. Good to know it’s fixed in later versions.

---

<div class="post-metadata">

**Author:** ![vladimir\_krastev](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/vladimir_krastev/32/42177_2.png) [@vladimir\_krastev](https://forums.chaos.com/u/vladimir_krastev)\
**Post date:** [April 18, 2023, 11:52am UTC](https://forums.chaos.com/t/vfb-setregion-through-maxscript/114574/6 "2023-04-18T11:52:11Z")

</div>

> This needs to be fixed in the [docs](https://docs.chaos.com/display/VMAX/Controlling+the+VFB+Programmatically) then since it still has that confusing language..​

I submitted an issue about that towards the docs team.
