This PR aims to provide more options for customizing the editor gestures at runtime (see the Playground app for a simple example).
Separated selection gestures for ItemContainer and GroupingNode from the NodifyEditor
Added new gesture types: AnyGesture, AllGestures, and InputGestureRef
Fixed a bug where the item container would incorrectly transition to the dragging state on mouse over
The EditorGestures class is now a singleton and can be accessed through EditorGestures.Mappings which allows customizing the editor gestures in a couple of ways:
override specific gestures exposed by the EditorGestures.Mappings
// single gesture
EditorGestures.Mappings.ItemContainer.Drag.Value = MultiGesture.None;
- define templates that you can apply to the EditorGestures.Mappings
```csharp
public class Blender3DInputMappings : EditorGestures
{
public Blender3DInputMappings()
{
Editor.Pan.Value = new AnyGesture(new MouseGesture(MouseAction.LeftClick), new MouseGesture(MouseAction.MiddleClick));
Editor.Selection.Apply(new SelectionGestures(MouseAction.RightClick));
ItemContainer.Selection.Apply(Editor.Selection);
}
}
// apply custom gesture mappings
EditorGestures.Mappings.Apply(new Blender3DInputMappings());
// note that you can reset the gestures as follows
EditorGestures.Mappings.Apply(new EditorGestures());
You can also inherit from SelectionGestures, ItemContainerGestures, NodifyEditorGestures, ConnectorGestures, ConnectionGestures, and GroupingNodeGestures or simply create an instance and customize it. These can be applied in the same way:
📝 Description of the Change
This PR aims to provide more options for customizing the editor gestures at runtime (see the Playground app for a simple example).
The EditorGestures class is now a singleton and can be accessed through
EditorGestures.Mappings
which allows customizing the editor gestures in a couple of ways:// multiple gestures EditorGestures.Mappings.Editor.Selection.Apply(new SelectionGestures(MouseAction.RightClick)); EditorGestures.Mappings.ItemContainer.Apply(new ItemContainerGestures());
You can also inherit from
SelectionGestures
,ItemContainerGestures
,NodifyEditorGestures
,ConnectorGestures
,ConnectionGestures
, andGroupingNodeGestures
or simply create an instance and customize it. These can be applied in the same way: