Skip to content

Commit

Permalink
Feature/multi mirrors (#345)
Browse files Browse the repository at this point in the history
* Add unity-symmetry

* Summon mirror button should be active for all mirror types

* Initial functional WIP

[CI BUILD]

* Icons and labels

[CI BUILD]

* Small bugfix, icon size and UI layout tweaks

[CI BUILD]

* WIP

[CI BUILD]

* Bump unity-symmetry version

[CI BUILD]

* Wallpaper symmetry icons

* Wallpaper scale, GUI fixes and icons for wallpaper groups

[CI BUILD]

* Bump UPM versions

[CI BUILD]

* Custom symmetry widget material

* Icon for custom symmetry jitter toggle off

* Make Symmetry widget into a prefab

* Add buttons for remaining point symmetry modes. Assign new jitter toggle icon

* Code for jitter toggle. Caching of matrices

* Draw custom symmetry guides (WIP)

* Bump Unity version

[CI BUILD]

* Fix caching of matrices. Slow spinning. Bump UPM version

[CI BUILD]

* Update packages-lock.json

[CI BUILD]

* Fix wallpaper scaling. Show symmetry domains instead of normal symmetry guide

[CI BUILD]

* Scaling fixes. Jitter icon fix

[CI BUILD]

* Jitter button label

[CI BUILD]

* overload for Clone() that accepts explicit TRS

* Symmetry widget should behave like other widgets (i.e. don't force it to be vertical, respect snapping and remove driftiness)

* Widget cloning (currently tested on models and image widgets)

[CI BUILD]

* X/Y Slider widget. Decided against using it right now but it's going to be useful.

* Prefab for XY widget

* More parameters for wallpaper (scale x/y and skew x/y).

* I missed out the prefab changes from the previous commit

* Bump package versions

[CI BUILD]

* Add a couple of missing selection commands

* Duplicate Selection respects mirror

* Don't log errors for commented out commands

* API commands for mirror settings

* Port over the basic API stuff from editable models

[CI BUILD]

* Split off mirror duping into a separate command.

[CI BUILD]

* Allow symmetry pivot to be the controller instead of the mirror widget. WIP transform fix

* Rename the enum label

* Remove double mirror button from experimental panel

[CI BUILD]

* Duplicated widgets weren't moved to selection canvas

[CI BUILD]

* Fix undo behaviour

[CI BUILD]

* Rename global command to MultiMirror. Fix some API help text

* Add canvas targets for mirror dup and rename the command to be a bit clearer.

* Color waveform generators for mirrored strokes

[CI BUILD]

* Remove debug statement. Avoid errors if pointers!=colors

[CI BUILD]

* Fix waveform equations. Square wave.

[CI BUILD]

* Make the waveform equations a bit more consistent with each other.

[CI BUILD]

* Fix disabled symmetry default

[CI BUILD]

* UI state reflects app state

[CI BUILD]

* Revert change to colour swatch positioning

[CI BUILD]

* My god. I've fixed it. Commit while it still works!

[CI BUILD]

* Make variable naming consistent between the two places I'm doing the transform

* Mirror transform fix applied to Duplicate command

* Set initial symmetry mode button state

[CI BUILD]

* Consistent overrides for all grab widget subclasses

[CI BUILD]

* Implement snap ghosts for grab widgets.

[CI BUILD]

* Use the new better logic for snap angles. Move snapping methods to SelectionManager

* Assign snap ghost prefab for selection widget

* Revert "Implement snap ghosts for grab widgets."

This reverts commit 2a1595f.

* Get XY widgets mostly working

* Remove FormerlySerializedAs

* [CI BUILD]

* Move multimirror to experimental panel and restore standard mirror

* Fixes for original mirror functionality and post-merge cleanups.

[CI BUILD]

* Fix multi-mirror icon

[CI BUILD]

* Fix material naming

* Hidden experimental mirror controls

* Make the default mirror widget location a bit lower so it's initially easier to spot

* Change default symmetry settings to be more interesting.

* Comment out the mirror duplicate for now until I have time to properly fix it.

[CI BUILD]

* Fix init of sliders to correct values

[CI BUILD]

* Fix saturation variance

[CI BUILD]

* Unused import was giving errors during build

* MirrorDuplicate kinda working

* Fix stroke selection behavior on duplicate

[CI BUILD]

* Duplicated strokes weren't being registered to selection correctly.

* dotnet-format

[CI-BUILD]

* API updates

Allow defining endpoint examples in attribute. Add examples for symmetry endpoints ScriptTemplateSubstitution for custom symmetry enums.

* Duplicate command memory limits now take custom symmetry into account.

* Rider plugin update

* [CI BUILD]

* Fix variable name case for m_PreviousCanvas. Cosmetic code tweaks for widgets

* Fix more instances of m_PreviousCanvas case

* Updates to match runtime scripting. Bump symmetry version to fix Td and Th

[CI BUILD]

* dotnet format

* Experimental panel wasn't appearing in monoscopic mode.

* Skip duping reflected strokes as it's not currently working. Add variable suffixes to clarify coordinate spaces.

[CI BUILD]

* Fix access level conflict

* Fix the symmetry widget to use a prefab based on i18n version

* Post-merge fixes for max_pointers in main scene and symmetry widget

* Remove hidden text line and reference

* Post-merge fix
  • Loading branch information
andybak authored Jul 28, 2023
1 parent 3b866a4 commit 3b03f6f
Show file tree
Hide file tree
Showing 105 changed files with 21,941 additions and 1,669 deletions.
2 changes: 1 addition & 1 deletion Assets/Editor/DummyCommandRefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static void Prefabs_Panels_ExperimentalPanel()
Use(GlobalCommands.Null);
Use(GlobalCommands.SaveModel);
Use(GlobalCommands.StraightEdge);
Use(GlobalCommands.SymmetryFour);
Use(GlobalCommands.MultiMirror);
}

public static void Prefabs_Panels_ExtraPanel()
Expand Down
32 changes: 32 additions & 0 deletions Assets/Materials/CustomMirrorGuide.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CustomMirrorGuide
m_Shader: {fileID: 4800000, guid: b25bb00353dee3045b6afef5a48cc184, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 5
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _OutlineWidth: -0.01
m_Colors:
- _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_BuildTextureStacks: []
8 changes: 8 additions & 0 deletions Assets/Materials/CustomMirrorGuide.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions Assets/Materials/TextActionButtonHighlight.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TextActionButtonHighlight
m_Shader: {fileID: 4800000, guid: f73cb58105789394bb27651598fb38e8, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Illum:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _EmissionLM: 0
m_Colors:
- _Color: {r: 0.9433962, g: 0.34413192, b: 0.34413192, a: 1}
m_BuildTextureStacks: []
8 changes: 8 additions & 0 deletions Assets/Materials/TextActionButtonHighlight.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Assets/Prefabs/Panels/AdvancedToolsPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ MonoBehaviour:
- m_PopUpPrefab: {fileID: 1758786797962018, guid: e2dd9f64d28858a468b61151cbf090d6,
type: 3}
m_Command: 14
- m_PopUpPrefab: {fileID: 1887799951535888, guid: cea55265052f18b4ca24670a074de41d,
- m_PopUpPrefab: {fileID: 1758786797962018, guid: 04751ea8307825e4bb7657eb20f9bfc5,
type: 3}
m_Command: 67
- m_PopUpPrefab: {fileID: 1386358278955912, guid: be80cc928a63c8c4aa97d1e0d06e965d,
Expand All @@ -826,7 +826,7 @@ MonoBehaviour:
m_LocalVariables: []
m_PanelDescriptionPrefab: {fileID: 160918, guid: 3491f4f01ba6cac47b1633f36d7c6c84,
type: 3}
m_PanelDescriptionOffset: {x: 1.25, y: 1, z: 0}
m_PanelDescriptionOffset: {x: 1.25, y: 0.8, z: 0}
m_PanelDescriptionColor: {r: 1, g: 1, b: 1, a: 1}
m_PanelFlairPrefab: {fileID: 0}
m_PanelFlairOffset: {x: 0, y: 0, z: 0}
Expand All @@ -852,7 +852,7 @@ MonoBehaviour:
m_InitialSpawnPos: {x: 4.61, y: 12, z: 5.34}
m_InitialSpawnRotEulers: {x: 37.18, y: 63.12, z: 0}
m_WandAttachAngle: 240
m_WandAttachYOffset: 1.2
m_WandAttachYOffset: 0.75
m_WandAttachHalfHeight: 1.2
m_BeginFixed: 1
m_CanBeFixedToWand: 1
Expand Down
79 changes: 41 additions & 38 deletions Assets/Prefabs/Panels/ExperimentalPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 496394}
m_RootOrder: 6
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3372234
MeshFilter:
Expand Down Expand Up @@ -170,13 +170,13 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 441618}
- {fileID: 461058}
- {fileID: 416416}
- {fileID: 4000011131613426}
- {fileID: 6427502074316152088}
- {fileID: 1072534996228004389}
- {fileID: 4181066228636318}
- {fileID: 4000011211690986}
- {fileID: 416416}
- {fileID: 441618}
- {fileID: 461058}
m_Father: {fileID: 449684}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -210,7 +210,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 496394}
m_RootOrder: 5
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &6574194
BoxCollider:
Expand Down Expand Up @@ -255,7 +255,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 496394}
m_RootOrder: 4
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3365058
MeshFilter:
Expand Down Expand Up @@ -323,6 +323,9 @@ MonoBehaviour:
m_PanelPopUpMap:
- m_PopUpPrefab: {fileID: 197348, guid: 41a9315e35469455cbb17380475173b6, type: 3}
m_Command: 5
- m_PopUpPrefab: {fileID: 1758786797962018, guid: 04751ea8307825e4bb7657eb20f9bfc5,
type: 3}
m_Command: 15
m_PanelDescription: Experimental
m_PanelDescriptionPrefab: {fileID: 160918, guid: 3491f4f01ba6cac47b1633f36d7c6c84,
type: 3}
Expand Down Expand Up @@ -373,7 +376,6 @@ MonoBehaviour:
m_ShowDuration: 0.25
m_GrabDistance: 1.4
m_CollisionRadius: 1.2
m_previousCanvas: {fileID: 0}
m_AllowTwoHandGrab: 0
m_DestroyOnHide: 0
m_AllowHideWithToss: 0
Expand Down Expand Up @@ -441,7 +443,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 496394}
m_RootOrder: 3
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33000010328447642
MeshFilter:
Expand Down Expand Up @@ -578,7 +580,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 496394}
m_RootOrder: 0
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33000010932372280
MeshFilter:
Expand Down Expand Up @@ -799,7 +801,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 496394}
m_RootOrder: 2
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33358476084434244
MeshFilter:
Expand Down Expand Up @@ -903,56 +905,56 @@ MonoBehaviour:
m_ToggleOnTexture: {fileID: 0}
m_AllowUnavailable: 1
m_LinkedUIObject: {fileID: 0}
--- !u!1 &5591636336640369085
--- !u!1 &1074454570839015039
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6427502074316152088}
- component: {fileID: 788299889629676088}
- component: {fileID: 8084318317654613038}
- component: {fileID: 7518405988336528345}
- component: {fileID: 8762249120066186711}
- component: {fileID: 1072534996228004389}
- component: {fileID: 1051929612284383709}
- component: {fileID: 1060829713135619689}
- component: {fileID: 1010165861696638809}
- component: {fileID: 1114926021503042807}
m_Layer: 16
m_Name: PanelButton_Mirror
m_Name: PanelButton_MultiMirror
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6427502074316152088
--- !u!4 &1072534996228004389
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5591636336640369085}
m_GameObject: {fileID: 1074454570839015039}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.208, z: 0.05}
m_LocalPosition: {x: 0, y: 0.20799994, z: 0.049999952}
m_LocalScale: {x: 0.35, y: 0.35, z: 0.35}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 496394}
m_RootOrder: 1
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &788299889629676088
--- !u!33 &1051929612284383709
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5591636336640369085}
m_GameObject: {fileID: 1074454570839015039}
m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3}
--- !u!23 &8084318317654613038
--- !u!23 &1060829713135619689
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5591636336640369085}
m_GameObject: {fileID: 1074454570839015039}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
Expand Down Expand Up @@ -988,42 +990,42 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &7518405988336528345
--- !u!65 &1010165861696638809
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5591636336640369085}
m_GameObject: {fileID: 1074454570839015039}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 0.1}
m_Center: {x: -0.000000074505806, y: 0.000000022351742, z: 0}
--- !u!114 &8762249120066186711
m_Size: {x: 1, y: 1, z: 0.01}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1114926021503042807
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5591636336640369085}
m_GameObject: {fileID: 1074454570839015039}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6c6859eec74651247968d56b594ac313, type: 3}
m_Script: {fileID: 11500000, guid: 67f633b3c98a3cd4da3a381ebd07cca9, type: 3}
m_Name:
m_EditorClassIdentifier:
m_DescriptionType: 0
m_DescriptionYOffset: 0
m_DescriptionText: Double Mirror
m_DescriptionText: Multi-Mirror
m_DescriptionTextExtra:
m_DescriptionActivateSpeed: 12
m_DescriptionZScale: 1
m_ButtonTexture: {fileID: 2800000, guid: ae726261e9135b949960e30cad75ad98, type: 3}
m_AtlasTexture: 1
m_ButtonTexture: {fileID: 2800000, guid: 8643f7dbd4cd20b48bb3b2b4c7ac1fe0, type: 3}
m_AtlasTexture: 0
m_ToggleButton: 1
m_LongPressReleaseButton: 0
m_ButtonHasPressedAudio: 1
m_ButtonHasPressedAudio: 0
m_ZAdjustHover: -0.02
m_ZAdjustClick: 0.05
m_HoverScale: 1.1
Expand All @@ -1034,12 +1036,13 @@ MonoBehaviour:
m_CommandParam2: -1
m_RequiresPopup: 0
m_CenterPopupOnButton: 0
m_PopupOffset: {x: 0, y: 0, z: 0}
m_PopupOffset: {x: 0, y: 0.5, z: 0}
m_PopupText:
m_ToggleOnDescription:
m_ToggleOnTexture: {fileID: 0}
m_AllowUnavailable: 0
m_LinkedUIObject: {fileID: 0}
m_LongPressDuration: 0.3
--- !u!114 &114000014220451482
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Loading

0 comments on commit 3b03f6f

Please sign in to comment.