Overriding Undo
Hi! I am new to open brush, I am trying to find action maps of xr controls but i am unable to find that. Can you please tell me where can i find that?
10 Replies
@mikesky did most of the work on the new input system but it appears to be in Scripts\Input\UnityXRInput.inputactions and UnityXRInputAction.cs
I think the latter is generated from the former? (or the other way round. No idea why Unity needs it done this way!)
Thank you!!
found it!!!!
Glad you found it! Yep we've got some mask for specific controllers, part of how we deal with the valve index grips. we apply these masks in https://github.com/icosa-gallery/open-brush/blob/main/Assets/Scripts/Input/UnityXRControllerInfo.cs#L66
GitHub
open-brush/Assets/Scripts/Input/UnityXRControllerInfo.cs at main ยท ...
Open Brush is the open source, community led evolution of Tilt Brush! Forked from https://github.com/googlevr/tilt-brush - icosa-gallery/open-brush
That is amazing!
You guys are awesome!!
can you please tell me where can i find the undo action? I have found a static method named "Undo" in a partial class named "ApiMethods". is this the one that is responsible for undo action on controller?
I want to disable undo action so i can perform my own functionality on it!!
Ah OK. We don't use maps in that way currently (although that would be better - we are working with the code we inherited from Tilt Brush which was written before the new Unity Input System existed)
Open Brush has it's own layer of mapping between physical buttons etc and internal actions
In this specific case you probably want to look at SketchControlsScript and GlobalCommands.Undo
Many actions (but not all) are implemented as global commands and are handled in that big case/switch block
(earlier on you can see this:
that's where it interfaces with input actions - but you probably want to change the first location
(incidentally this is a great example of the XY Problem: https://en.wikipedia.org/wiki/XY_problem - your question was originally "where are the input action maps" but what you were really asking was "how do I override undo?" ๐ )
XY problem
The XY problem is a communication problem encountered in help desk, technical support, software engineering, or customer service situations where the question is about an end user's attempted solution (Y) rather than the root problem itself (X).The XY problem obscures the real issues and may even introduce secondary problems that lead to miscomm...
Sorry for the confusion!!
i will be careful next time!!
Thanks for helping me
No problem! Most people do similar ๐
The trick is to give some background when you're asking a question so we know what your ultimate goal is (easy for me to say - I am guilty of this as much as anyone!)
I'm just fascinated by how often the XY concept applies.
I did not know about this xy problem. Glad to know that!! Thanks!
Question!! what is the purpose of maps then?
in our case it's enforcing a specific input for controllers that don't function as 'standard', a few cases:
- index controller's 'grip' is extremely sensitive, therefore we need to use 'grip force'. 'grip' would override 'grip force' unless we used the map
- pico 3 controller doesn't have touch sensitive thumbsticks, which the current input system uses to ensure proper thumbstick movement. (I want to change this, but haven't gotten around to it). so instead, Pico 3 has an emulated 'joystick touch' that triggers based on the thumbstick being tilted slightly. again this is an override property and needs it's own mapping
I admit it's not ideal, but it was the easiest way to fit it in with the old-style Tilt Brush system. My aim was to upgrade to OpenXR, not rewrite the entire input stack ๐