baffler / OBS-OpenVR-Input-Plugin

This OBS plugin provides an input plugin to 64bit OBS that allows capturing directly from OpenVR/SteamVR mirror surface in full resolution.
GNU General Public License v2.0
374 stars 35 forks source link

Allow setting crop in pixels instead of ratios #34

Closed e00E closed 3 years ago

e00E commented 3 years ago

Currently the crop menu works internally as a float and in the obs UI can be incremented only up to 1% steps. This makes exact cropping impossible or annoying because you first have to do math to see which float value corresponds to the pixel value you want and then put this exact float value into the ini file.

A better solution is to allow using both ratios or pixels in the ui. Depending on hard it is to support both at the same time, it would still be better to replace the current approach with pixels as that feels like the more natural unit.

I might be able to create a PR for this myself, but I'd like to know whether you would accept it first.

baffler commented 3 years ago

I do agree the cropping is a pain, I think using pixels would probably work out better. I had planned on using the Overlay View (current version is using the Mirror View). Using the overlay view would allow the cropping to be done by the SDK instead of having to set values yourself. As of right now it's working but pretty buggy. Anyways, I would accept the PR if it's going to easier to crop using pixels which I think it should be.

e00E commented 3 years ago

I implemented this but here are some problems:

I also found a workaround that doesn't require code changes: It is possible to crop the source pixel accurately from within obs by right clicking it in the preview and editing the transform. This way I can do rough initial cropping with the ratio based ui and then do fine adjustments through the transform. This is a little more work than if this plugin supported it directly but it does work.

What do you think about the idea to hide the sliders until openvr is initialized so that we can set the max values correctly?

baffler commented 3 years ago

I think that should be fine since like you said, you would want to see a preview of what you're editing anyways which would require openvr to be initialized.