ENH: 3D Camera Manipulation -- Configurable pan/rotate mouse buttons, new rotation modes, free camera, reverse zoom, & other QoL..#10234
Conversation
c336665 to
59e6317
Compare
|
approve |
|
@mpaperno Thanks for your contribution first.
Thanks for your contribution again. |
|
Hi @JohnSmithCYM , thank you for the feedback. Regarding all the new options, I agree they definitely add up. I do think the larger issue is that all the settings are now on one page. I'm not sure why they were combined like that initially for the Studio fork, but breaking them up again would go a long way to simplifying the settings UI (at least in terms of it feeling overwhelming, as you say). I think that would be a big help for users in general, and something I'd be willing to work on if there is interest from your side. Specifically in terms of button/modifier assignments, I'm not opposed to some presets, though besides "default" I don't know what they'd be. To be honest I think the names are somewhat meaningless. There has to be some explanation of what "CAD Style," etc, means. This seems more confusing than anything. I also don't know what "works well" for other people (apparently someone long ago thought the current scheme works well... ;-) ). Seems like the simplest option for a user would be to just leave the settings at defaults. At any rate, if presets are desirable, I'd want to keep a "custom" choice which reveals the full settings UI as I've proposed it (or similar). This is the most flexible and doesn't depend on remembering what some scheme name means. Perhaps a new "Camera Control Scheme" option selector with "Default" and "Custom" choices, with the latter revealing the other options (mouse button assignments and rotation modes). This would somewhat alleviate the immediate issue of new users being overwhelmed with options, though add another field overall. -- Regarding mouse buttons, unfortunately it's notoriously difficult to properly detect how many buttons a user's mouse/mice may actually have, especially cross-platform. That's a reason I left the "aux" buttons available for everyone, even though many mince won't have them. I'm going with the assumption that a user knows how many buttons their mouse has. I'm not sure why Mac or any other users with 2-button mice would have any issue here... the left button will of course still need to be shared with either rotate or pan actions, but at least there's now that option. But certainly if I'm missing something with that, or there could be an improvement, please let me know. Thanks again, and please let me know your thoughts. |
|
"Camera Control Scheme" is a better idea, some default profiles is better for most of users but others can costumize their need. You can change your work by that. And, I must address this add a lot of options for preference page, it makes a long page to be more loong :( It seems these options is more 'elegant' if we can re-modified preferene page like a camera tab setting. Why i mention the crossplatform is due to I want to know if you tested it with different os to make sure the main operation works well, no offense here. Thanks for your great work again dude. |
|
Ah yes, sorry, I should have mentioned in the OP that this was tested for basic functionality on all 3 major OSs. But my Linux and, especially, MacOS testing ability and time is much more limited, and my primary dev/usage OS is Windows (both 10 and 11). Definitely would be great to get more testing involved. (I tried to solicit some help or feedback on the forums but no one replied.) So, next steps:
Optional / To Consider:
Let's confirm the next steps before I make changes. Separately I will look at modifying the preferences dialog (unless someone else is already working on that). I think something with a sidebar to select the section, with the settings editor pages on the right. More flexible for future use than tabs across the top, and better use of 16:9 ratio screen space. Thanks! |
|
@JohnSmithCYM Hi, did you get a chance to review my last message? I'm holding off on further changes until this is clarified. Thanks! |
59e6317 to
7b14695
Compare
|
@JohnSmithCYM Not sure if you're still interested in working on this, but I did finally deliver the Preferences dialog changes I "promised," in #11459. There's a screenshot at the end of the post showing the new Camera page with all the new settings from this PR moved into there. |
|
I would like to express a desire to see mouse controls configuration implemented as all other software I'm using has rotate on right-mouse button, and having to use left-mouse is driving me away from Bambu Studio at this point in time. I hope this can be prioritized now that the Prefereneces UI is being updated as mentioned in the comments in #11459. If creating some presets, please ensure touchpad compatibility (either taking advantage of precision touchpad gestures for pan or ensuring only left-and-right-button are used. |
…und selection (if any) or cursor position. * Refactor rotation handling code in `GLCanvas3D::on_mouse()` to allow for new mode; * Add tracking of last used keyboard modifiers in `Mouse::Drag` struct; * Add `Size::center()` convenience method returning a `Point` type.
[GLCanvas3D] * Fixes/introduces minimum movement hysteresis check before starting view rotate/pan actions (not clear if existing code using `m_mouse.rotating`/`panning` flags was simply broken or originally used for a different purpose, but it had no practical effect); * Prevent undesired mouse button up/down action effects once rotation/pan movement has been started (eg. inadvertent item selection, context menu, or view movement interruption); * Allow simultaneous rotation and panning when holding both mouse buttons (surprisingly useful); * Refactor view rotation handling code to consolidate and streamline (functionality unchanged); * Remove ineffective code behind macro checks for `SUPPORT_FEEE_CAMERA`/`SUPPORT_FREE_CAMERA` (note misspelling in key part of the code); * Cosmetics.
…between 3D and regular mouse, & related fixes/improvements: * [AppConfig] Restore the "use_free_camera" option default; * [MainFrame] Add "Free Camera Rotation" option to the View menu; * [MainFrame][KBShortcutsDialog] Add `CTRL + U` shortcut to toggle free camera option; * [GLCanvas3D] Implement a simple static cache of user preferences used to manipulate camera views and avoid expensive lookups during active user interactions; * [GLCanvas3D] Camera "recovery" from an invalid free rotation aspect is only checked/performed when user switches from unconstrained to constrained camera, instead of on every mouse rotation movement; * [Camera] Fix condition check in `recover_from_free_camera()`, and improved for a smoother transition; * [Camera] Implement automatic switch to free camera option when using a 3D mouse exceeds rotation aspect of constrained view (this smooths any later transition to mouse navigation w/out a jarring "correction" reset); * [Camera] Consolidate identical `Camera` rotation methods (DRY), minor optimizations with `const` & pass-by-reference, and cosmetics. * [Plater] Add `update_camera_from_settings()` public method for a more selective camera refresh than full UI update; * [Plater] Update `apply_free_camera_correction()` to remove macro check; * [Plater] Add `update_camera_manipulation_settings()` method as proxy for `GLCanvas3D` equivalent.
…tation types with and w/out modifier keys, rotation speed, and reversible mouse zoom: * [AppConfig] Add options to support new features; consolidate all camera options; remove & erase long-unused camera control legacy options; * [GLCanvas3D] Refactor camera rotation and pan code to respect user preferences for mouse button assignment and rotation type modifiers; * [GLCanvas3D] Add new config options to cached view controls, and related support code; * [GLCanvas3D] Bind handlers for mouse Aux 1 & 2 button up events (down events are not specifically tracked); * [GLCanvas3D] Restore handling for reversed mouse zoom, w/out macro check; * [GLCanvas3D] Support configurable rotation speed factor (replaces TRACKBALL constant) and increasing precision while holding Shift key; * [GLCanvas3D] Add display of rotation target indicator to camera debug output rendering; * [PreferencesDialog] Create new section for all Camera controls and move existing "Zoom to mouse" option to there; * [PreferencesDialog] Add all new camera control options; * [PreferencesDialog] Add optional callback argument to `create_item_checkbox()`; * [PreferencesDialog] Refactor `create_item_title()` to create secondary- and sub- titles; * [wxExtensions] Add `wx_mouse_button_is_down()` and `mouse_button_name_to_wx_enum()` utility functions.
…s outside of window bounds: [GLCanvas3D] * Capture mouse if user is actively rotating or panning upon mouse leave event (release was already handled in `mouse_up_cleanup()`); * Add `wxEVT_MOUSE_CAPTURE_LOST` handler to run cleanup after any unexpected capture loss.
7b14695 to
8154b5b
Compare
|
Hello, I've updated the PR to rebase onto latest I have not created any presets (or preset system) as discussed above. I don't think it is necessary with the preferences pages being broken up now, nor did I get any feedback about what the presets would be. Could we move on this PR, one way or another? Thanks! |
|
Instructions for testers: I've downloaded, cleaned up, and am posting here the versions of Studio with the camera features enabled. It is currently the same as v2.8.1 public beta, plus the proposed camera changes. These versions are built by the GitHub workflows here (the "checks"). Configurations: These test versions will, by default, use the same user configuration location as the release version ("BambuStudio", not the beta config location "BambuStudioBeta", even though it is based on a beta release). It may be preferable to use a different config location so as not to overwrite anything from an installed release version. Luckily the latest beta already includes a new feature to be able to specify a config folder location (thanks, me! :). See this wiki article for more details: https://github.com/mpaperno/BambuStudio/wiki/Program-Configuration-Data-Location The files are too large to upload here, so I'm hosting them on my own server. Another option is to go find these in the test build "artifacts" list: https://github.com/bambulab/BambuStudio/actions/runs/29618924452#artifacts though I'm not sure how long they'll be available, and some more digging through archives may be required. Windows: Linux (any Debian-based distribution of a corresponding version): MacOS v26 https://max.paperno.us/3dp/bstudio/pr10234/BambuStudio_MacOS-26_universal_PR-10234.zip If the above version refuses to run at all ("application cannot be started," not a signing issue), then try this version instead: If it does start on a basic level, you will likely get an error about the app being unsigned. Follow the usual procedures to unblock an app on MacOS and it should work. If you don't have administrator privileges, it is still possible to unblock an app from the command line. If you need further assistance, let me know. Network Plugin If the network plugin doesn't install automatically for this version (and you still want it), follow the instructions linked in the Studio plugin download error message to manually download and install the corresponding plugin version. If using a custom user configuration location, the plugin files need to be placed in there. To contact me directly send a DM on the BL forums (see post link above). Your feedback is greatly appreciated! Thank you! |
This PR combines multiple enhancements to camera interactions in the various 3D canvas views.
High level overview of changes (details in commit notes):
SHIFTwhile rotating will reduce the speed (increase the resolution) by half of this configured value.CTRL + Ushortcut.No current default behaviors were changed. Transition should be seamless for users.
Updated Preferences dialog

Broke out all camera settings into their own section ("Zoom to mouse" moves down there), showing defaults on Windows (on Mac the modifier keys are labeled appropriately):
Rotate button choices:

The pan button choices add "Right or Middle" to account for the "legacy" default behavior:

Rotation mode choices (there is a tooltip explaining the modes):

I will try to make a video demonstrating the new behaviors. Hard to find an overlay utility that shows which mouse button was pressed, but I'm working on it. For now suffice to say this improves my interactions with Studio tremendously. Having the rotate button separate from selection is such a relief.
I kept commits separated for easier review or possible rollback. The first commit in the series is atomic but essentially superseded by later ones. At this point could be tricky to squash, but I'm flexible.
Absolutely any and all feedback is very welcome. I tried to keep the options flexible and practical, but I'm just one user. And although I can do basic testing on Linux and Mac, I primarily use Windows, so I (and my testing) may be biased.
Thank you for your consideration,
-Max
Related/fixes:
https://forum.bambulab.com/t/move-pan-and-tilt-to-right-mouse-button-left-button-selecting/33857
#8515
#6520
#5639
#3273
#3044
#1416
#795
#429
...?