Transform snapping moved to AdvancedSettings #46614
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Transform snapping is made totally customizable, but is removed from project settings. It can now only be set from script etc using a new GDCLASS, AdvancedSettings.
This PR is one of two options, the other is #46615.
About
As 3.2.4 release is approaching rapidly, I have to admit there are several aspects I'm not happy with concerning the
transform_snapping
(originally proposed by m6502).stretch_mode
).transform_snapping
will work and fix their games.So at this stage we have 3 choices as I see it:
So far I've been working along the lines of (1), but feedback so far indicates that the majority of people interested in trying the technique are not aware of how it works, when it should be used, and what the pitfalls are. This all suggests that if we make the functionality readily accessible we will be deluged by support requests for issues that are bogus.
There is, as yet, no facility for advanced project settings in 3.2. Even a UI accessible advanced option can be problematic because users are likely to change these while experimenting, and file bogus issue reports for the inevitable side effects.
So instead I'm quite a fan of adding some hidden settings to the engine, that are pretty much 'don't mess with these unless you know what you are doing'. This would seem to be a good place to put snapping functionality, at least for the time being.
I see having the functions available from script as being a compromise between removing the snapping from 3.2.4 entirely, and exposing something which is clearly problematic for beginners.
Typical use
The AdvancedSettings class is currently derived from Reference rather than Node, I don't think it needs to be a Node. The settings can be set as a one off at startup of the project. This also has the advantage it is harder to accidentally leave one of them set incorrectly, and they are only active at runtime.
Camera
As an aside, the camera delay fixes are very easy to use and definitely beneficial so I'll be splitting these into a separate PR later this morning (I really shouldn't have combined them in the same PR initially).