Page MenuHome

Camera XY shift hardcoded -10/10 range removed
ClosedPublic

Authored by fundorin (fundorin) on Aug 9 2022, 6:50 PM.

Details

Summary

Camera XY shift range expanded from -10/10 to -1000/1000

A camera’s Shift X and Y have a hard limit of 10 (positive or negative).
In my situation I need to go way beyond that.
More specifically, I need to render regions of a frame by converting the Ctrl+B region to the camera itself by using shift X and Y. This addon (https://gitlab.com/ChameleonScales/camera_regions) does all the calculations to convert the Ctrl+B region but it hits a wall if I make a small region towards the borders of the frame.

Steps to reproduce:

Install Camera Regions addon
From a new scene, enter the camera
Do Ctrl+B and draw a small rectangle roughly in the middle of the frame
To keep track of the region, add a mesh plane that fits exactly inside of it
In the Camera’s properties (the green camera icon), go to the Regions panel, click Add Region and hit Enter: the plane you created should fit exactly in the camera’s frame now.
Ctrl+Z to cancel adding the region and do it again, this time with a tiny region on a corner of the frame. Again keep track of it by adding a plane. If the region is small enough, then the plane you created doesn’t fit in the frame anymore. That’s because the Shift X and Y have clamped to 10 when it should’ve gone beyond.

I don’t know why this hard limit was set but I hope it can be lifted so users gain more control and people can use Camera Regions without running into this problem

More info with images available in this devtalk thread - https://devtalk.blender.org/t/please-lift-camera-shift-x-y-hard-limits/25338

Diff Detail

Repository
rB Blender

Event Timeline

fundorin (fundorin) requested review of this revision.Aug 9 2022, 6:50 PM
fundorin (fundorin) created this revision.
Brecht Van Lommel (brecht) requested changes to this revision.Aug 9 2022, 7:18 PM

You can just remove those two lines of code entirely and have no hard limit.

If you want to be credited as commit author in git you'll need to set a real name in your profile, if not we'll add "Contributed by fundorin" in the commit description instead.

This revision now requires changes to proceed.Aug 9 2022, 7:18 PM
fundorin (fundorin) requested review of this revision.Aug 9 2022, 7:26 PM

I didn't want to break anything, cause there's a possibility that some other addons are using those values for reference. 1000 is big enough to ever hit it. If not, I can change it to a bigger number, like 10000 or even a million.

P.S. For some reason, I can't properly operate the popup frames on this forum. It took me several tries to upload that diff, cause every time I chose a reviewer or a repository, the forum simply kicked me to the main page. I'm also not able to click the "profile" and "settings" options from my avatar above, no matter how fast I try to move my cursor. That frame just closes on me. So, "fundorin" is actually fine.

Removing the limit entirely is safe enough, it's not any more risky than setting it to some arbitrary high value and is consistent with what we do for other properties that have no natural limit.

I'm not sure what the problem is with the website, have not heard that before, maybe another browser works.

Removed hardcoded camera XY shift limits entirely.

fundorin (fundorin) retitled this revision from Camera XY shift range expanded from -10/10 to -1000/1000 to Camera XY shift hardcoded -10/10 range removed.Aug 9 2022, 8:09 PM

Thank you guys. btw do we know why this limit was set in the first place?

Harley Acheson (harley) resigned from this revision.Aug 10 2022, 6:20 AM
This revision is now accepted and ready to land.Aug 10 2022, 1:02 PM