diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-12 20:55:18 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-12 20:55:18 -0800 |
| commit | bd4d3aa6537cb3121cd1eca4a8ea4eb65eb28522 (patch) | |
| tree | 021f4296a91ba890a45b7d9cd920bf473c7bb216 /Scripts/Fold/Editor/VertexDeformationExamples.cs | |
| parent | 6d86c9663bab3ec1ef95ba455dfa7281415b7f44 (diff) | |
Fold: update UI, add plane -> hemioctahedron
Diffstat (limited to 'Scripts/Fold/Editor/VertexDeformationExamples.cs')
| -rw-r--r-- | Scripts/Fold/Editor/VertexDeformationExamples.cs | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/Scripts/Fold/Editor/VertexDeformationExamples.cs b/Scripts/Fold/Editor/VertexDeformationExamples.cs deleted file mode 100644 index 705cea9..0000000 --- a/Scripts/Fold/Editor/VertexDeformationExamples.cs +++ /dev/null @@ -1,114 +0,0 @@ -using UnityEditor; -using UnityEngine; - -public static class VertexDeformationExamples -{ - [MenuItem("Tools/Vertex Deformation/Example: Tube to Plane")] - static void Example_TubeToPlane() - { - var mat = Selection.activeObject as Material; - if (mat == null) - { - EditorUtility.DisplayDialog("Error", "Select a material in the Project window", "OK"); - return; - } - - VertexDeformationBuilder.Create() - .For(mat) - .TubeToPlane( - p: Vector3.zero, - r: Vector3.right, - s: Vector3.forward, - t: 1f) - .Apply(); - } - - [MenuItem("Tools/Vertex Deformation/Example: Complex Pipeline")] - static void Example_ComplexPipeline() - { - var mat = Selection.activeObject as Material; - if (mat == null) - { - EditorUtility.DisplayDialog("Error", "Select a material in the Project window", "OK"); - return; - } - - VertexDeformationBuilder.Create() - .For(mat) - .TubeToPlane(Vector3.zero, Vector3.right, Vector3.forward, 1f) - .NormConversion(inputK: 2f, outputK: 1f, t: 1f) - .PointAlign( - po: new Vector3(0, 0, 0), - pp: new Vector3(0, 1, 0), - r: Vector3.right, - t: 0.5f) - .Apply(); - - Debug.Log("Applied 3-step deformation pipeline to " + mat.name); - } - - [MenuItem("Tools/Vertex Deformation/Example: Add Custom Preset")] - static void Example_ShowHowToAddPreset() - { - EditorUtility.DisplayDialog("How to Add Presets", - "1. Open VertexDeformationPresets class\n\n" + - "2. Add a new static method:\n\n" + - "public static void MyCustomPreset(Material mat) =>\n" + - " VertexDeformationBuilder.Create()\n" + - " .For(mat)\n" + - " .TubeToPlane(...)\n" + - " .NormConversion(...)\n" + - " .Apply();\n\n" + - "3. Add a button in VertexDeformationEditorWindow:\n\n" + - "if (GUILayout.Button(\"My Custom Preset\"))\n" + - " VertexDeformationPresets.MyCustomPreset(targetMaterial);", - "OK"); - } - - [MenuItem("Tools/Vertex Deformation/Example: All Opcodes")] - static void Example_AllOpcodes() - { - EditorUtility.DisplayDialog("All Available Operations", - "TubeToPlane(p, r, s, t)\n" + - "PlaneToTube(p, r, s, t)\n" + - "PointAlign(po, pp, r, t)\n" + - "AxisAlign(po, pp, r, t)\n" + - "NormConversion(inputK, outputK, t)\n" + - "Seal(A, k, st, t)\n" + - "SineWaves()\n" + - "FBM()\n\n" + - "Custom(opcode, f0, f1, f2, f3, v0, v1, v2, v3)\n\n" + - "Chain them with method calls:\n" + - ".TubeToPlane(...).NormConversion(...).Apply()", - "OK"); - } - - public static class CustomPresetIdeas - { - public static void CylinderToPlane(Material mat) => - VertexDeformationBuilder.Create() - .For(mat) - .TubeToPlane(Vector3.zero, Vector3.up, Vector3.right, 1f) - .Apply(); - - public static void SphereToBox(Material mat) => - VertexDeformationBuilder.Create() - .For(mat) - .NormConversion(inputK: 2f, outputK: float.PositiveInfinity, t: 1f) - .Apply(); - - public static void BoxToSphere(Material mat) => - VertexDeformationBuilder.Create() - .For(mat) - .NormConversion(inputK: float.PositiveInfinity, outputK: 2f, t: 1f) - .Apply(); - - public static void TubeUnfoldAndFlatten(Material mat) => - VertexDeformationBuilder.Create() - .For(mat) - .TubeToPlane(Vector3.zero, Vector3.right, Vector3.forward, 1f) - .NormConversion(inputK: 2f, outputK: 1f, t: 0.5f) - .Seal(A: 0.1f, k: 2f, st: 0.8f, t: 1f) - .Apply(); - } -} |
