From 955a0524af9d0657cc5fbbb74268c467bef30106 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Thu, 4 Dec 2025 17:41:41 +0100 Subject: [PATCH] Auto-sync from SVN revision 68845 --- .../Lighting/ProbeVolume/ProbePlacement.cs | 2 + .../Editor/MaterialUpgrader.cs | 26 + .../Runtime/Debugging/DebugUI.Fields.cs | 4 +- .../Runtime/GPUDriven/InstanceCuller.cs | 24 +- .../InstanceData/InstanceDataSystem.cs | 60 +- .../GPUDriven/OcclusionCullingCommon.cs | 10 +- .../GPUDriven/RenderersBatchersContext.cs | 2 + .../Runtime/Utilities/CoreUtils.cs | 5 +- .../Runtime/Volume/VolumeComponent.cs | 10 +- .../package.json | 2 +- .../Canvas/ShaderGraph/HDCanvasSubTarget.cs | 7 +- .../ShaderGraph/HDSubShaderUtilities.cs | 5 + .../ShaderGraph/SurfaceOptionPropertyBlock.cs | 2 + .../ShaderGraph/TargetData/SystemData.cs | 9 + .../Material/UIBlocks/SurfaceOptionUIBlock.cs | 8 + .../Runtime/Material/Lit/BaseLitAPI.cs | 14 +- .../Runtime/Material/Lit/LitAPI.cs | 3 +- .../Runtime/Material/ShaderGraphAPI.cs | 3 +- .../Runtime/Material/Unlit/UnlitAPI.cs | 3 +- .../Shaders/AlphaUpscale.compute | 39 +- .../Shaders/DLSSBiasColorMask.shader | 4 +- .../HDRenderPipeline.PostProcess.cs | 2 +- .../RenderPipeline/HDStringConstants.cs | 2 + .../Common/AccelStructAdapter.cs | 4 + .../UnifiedRayTracing/Common/TerrainToMesh.cs | 90 +- .../Nodes/UV/ParallaxOcclusionMappingNode.cs | 4 +- Packages/com.unity.shadergraph/package.json | 2 +- Packages/com.unity.splines/.attestation.p7m | Bin 0 -> 10891 bytes Packages/com.unity.splines/.signature | 1 + Packages/com.unity.splines/CHANGELOG.md | 553 +++++ Packages/com.unity.splines/CHANGELOG.md.meta | 7 + Packages/com.unity.splines/Editor.meta | 8 + .../com.unity.splines/Editor/AssemblyInfo.cs | 5 + .../Editor/AssemblyInfo.cs.meta | 11 + .../com.unity.splines/Editor/Components.meta | 8 + .../Editor/Components/SplineAnimateEditor.cs | 355 +++ .../Components/SplineAnimateEditor.cs.meta | 11 + .../Components/SplineComponentEditor.cs | 42 + .../Components/SplineComponentEditor.cs.meta | 11 + .../Components/SplineContainerEditor.cs | 104 + .../Components/SplineContainerEditor.cs.meta | 11 + .../Editor/Components/SplineExtrudeEditor.cs | 305 +++ .../Components/SplineExtrudeEditor.cs.meta | 3 + .../Components/SplineInstantiateEditor.cs | 665 +++++ .../SplineInstantiateEditor.cs.meta | 11 + .../com.unity.splines/Editor/Controls.meta | 8 + .../Editor/Controls/CurveHandles.cs | 295 +++ .../Editor/Controls/CurveHandles.cs.meta | 11 + .../Editor/Controls/DirectManipulation.cs | 201 ++ .../Controls/DirectManipulation.cs.meta | 11 + .../Editor/Controls/KnotHandles.cs | 322 +++ .../Editor/Controls/KnotHandles.cs.meta | 11 + .../Controls/SplineElementRectSelector.cs | 228 ++ .../SplineElementRectSelector.cs.meta | 11 + .../Editor/Controls/SplineHandleSettings.cs | 68 + .../Controls/SplineHandleSettings.cs.meta | 11 + .../Editor/Controls/SplineHandles.cs | 464 ++++ .../Editor/Controls/SplineHandles.cs.meta | 11 + .../Editor/Controls/SplineMeshHandle.cs | 188 ++ .../Editor/Controls/SplineMeshHandle.cs.meta | 3 + .../Editor/Controls/TangentHandles.cs | 238 ++ .../Editor/Controls/TangentHandles.cs.meta | 11 + Packages/com.unity.splines/Editor/Core.meta | 8 + .../Editor/Core/CopyPaste.cs | 302 +++ .../Editor/Core/CopyPaste.cs.meta | 3 + .../Editor/Core/PathSettings.cs | 41 + .../Editor/Core/PathSettings.cs.meta | 11 + .../Editor/Core/SelectionContext.cs | 45 + .../Editor/Core/SelectionContext.cs.meta | 11 + .../Editor/Core/SplineElement.cs | 385 +++ .../Editor/Core/SplineElement.cs.meta | 11 + .../Editor/Core/SplineSelection.cs | 610 +++++ .../Editor/Core/SplineSelection.cs.meta | 11 + .../Editor/Editor Resources.meta | 8 + .../Editor/Editor Resources/Icons.meta | 8 + .../Icons/AutoSmoothKnot On.png | Bin 0 -> 347 bytes .../Icons/AutoSmoothKnot On.png.meta | 146 ++ .../Icons/AutoSmoothKnot On@2x.png | Bin 0 -> 598 bytes .../Icons/AutoSmoothKnot On@2x.png.meta | 146 ++ .../Editor Resources/Icons/AutoSmoothKnot.png | Bin 0 -> 374 bytes .../Icons/AutoSmoothKnot.png.meta | 146 ++ .../Icons/AutoSmoothKnot@2x.png | Bin 0 -> 707 bytes .../Icons/AutoSmoothKnot@2x.png.meta | 146 ++ .../Icons/KnotPlacementTool.png | Bin 0 -> 324 bytes .../Icons/KnotPlacementTool.png.meta | 146 ++ .../Icons/KnotPlacementTool@2x.png | Bin 0 -> 540 bytes .../Icons/KnotPlacementTool@2x.png.meta | 146 ++ .../Icons/SplineComponent.png | Bin 0 -> 424 bytes .../Icons/SplineComponent.png.meta | 146 ++ .../Icons/SplineComponent@2x.png | Bin 0 -> 861 bytes .../Icons/SplineComponent@2x.png.meta | 146 ++ .../Editor Resources/Icons/SplineContext.png | Bin 0 -> 404 bytes .../Icons/SplineContext.png.meta | 146 ++ .../Icons/SplineContext@2x.png | Bin 0 -> 738 bytes .../Icons/SplineContext@2x.png.meta | 146 ++ .../Icons/SplineEditMode-Info.png | Bin 0 -> 738 bytes .../Icons/SplineEditMode-Info.png.meta | 146 ++ .../Icons/SplineEditMode-Info@2x.png | Bin 0 -> 1494 bytes .../Icons/SplineEditMode-Info@2x.png.meta | 146 ++ .../Icons/Tangent_Continuous On.png | Bin 0 -> 331 bytes .../Icons/Tangent_Continuous On.png.meta | 146 ++ .../Icons/Tangent_Continuous On@2x.png | Bin 0 -> 622 bytes .../Icons/Tangent_Continuous On@2x.png.meta | 146 ++ .../Icons/Tangent_Continuous.png | Bin 0 -> 380 bytes .../Icons/Tangent_Continuous.png.meta | 146 ++ .../Icons/Tangent_Continuous@2x.png | Bin 0 -> 732 bytes .../Icons/Tangent_Continuous@2x.png.meta | 146 ++ .../Icons/Tangent_Linear On.png | Bin 0 -> 269 bytes .../Icons/Tangent_Linear On.png.meta | 146 ++ .../Icons/Tangent_Linear On@2x.png | Bin 0 -> 476 bytes .../Icons/Tangent_Linear On@2x.png.meta | 146 ++ .../Editor Resources/Icons/Tangent_Linear.png | Bin 0 -> 313 bytes .../Icons/Tangent_Linear.png.meta | 146 ++ .../Icons/Tangent_Linear@2x.png | Bin 0 -> 569 bytes .../Icons/Tangent_Linear@2x.png.meta | 146 ++ .../Icons/ToolHandleElement.png | Bin 0 -> 419 bytes .../Icons/ToolHandleElement.png.meta | 146 ++ .../Icons/ToolHandleElement@2x.png | Bin 0 -> 717 bytes .../Icons/ToolHandleElement@2x.png.meta | 146 ++ .../Icons/ToolHandleParent.png | Bin 0 -> 429 bytes .../Icons/ToolHandleParent.png.meta | 146 ++ .../Icons/ToolHandleParent@2x.png | Bin 0 -> 708 bytes .../Icons/ToolHandleParent@2x.png.meta | 146 ++ .../Icons/d_AutoSmoothKnot On.png | Bin 0 -> 347 bytes .../Icons/d_AutoSmoothKnot On.png.meta | 146 ++ .../Icons/d_AutoSmoothKnot On@2x.png | Bin 0 -> 598 bytes .../Icons/d_AutoSmoothKnot On@2x.png.meta | 146 ++ .../Icons/d_AutoSmoothKnot.png | Bin 0 -> 370 bytes .../Icons/d_AutoSmoothKnot.png.meta | 146 ++ .../Icons/d_AutoSmoothKnot@2x.png | Bin 0 -> 671 bytes .../Icons/d_AutoSmoothKnot@2x.png.meta | 146 ++ .../Icons/d_KnotPlacementTool.png | Bin 0 -> 332 bytes .../Icons/d_KnotPlacementTool.png.meta | 146 ++ .../Icons/d_KnotPlacementTool@2x.png | Bin 0 -> 565 bytes .../Icons/d_KnotPlacementTool@2x.png.meta | 146 ++ .../Icons/d_SplineComponent.png | Bin 0 -> 424 bytes .../Icons/d_SplineComponent.png.meta | 146 ++ .../Icons/d_SplineComponent@2x.png | Bin 0 -> 807 bytes .../Icons/d_SplineComponent@2x.png.meta | 146 ++ .../Icons/d_SplineContext.png | Bin 0 -> 400 bytes .../Icons/d_SplineContext.png.meta | 218 ++ .../Icons/d_SplineContext@2x.png | Bin 0 -> 734 bytes .../Icons/d_SplineContext@2x.png.meta | 146 ++ .../Icons/d_SplineEditMode-Info.png | Bin 0 -> 2010 bytes .../Icons/d_SplineEditMode-Info.png.meta | 146 ++ .../Icons/d_SplineEditMode-Info@2x.png | Bin 0 -> 2211 bytes .../Icons/d_SplineEditMode-Info@2x.png.meta | 146 ++ .../Icons/d_Tangent_Continuous On.png | Bin 0 -> 331 bytes .../Icons/d_Tangent_Continuous On.png.meta | 146 ++ .../Icons/d_Tangent_Continuous On@2x.png | Bin 0 -> 622 bytes .../Icons/d_Tangent_Continuous On@2x.png.meta | 146 ++ .../Icons/d_Tangent_Continuous.png | Bin 0 -> 385 bytes .../Icons/d_Tangent_Continuous.png.meta | 146 ++ .../Icons/d_Tangent_Continuous@2x.png | Bin 0 -> 711 bytes .../Icons/d_Tangent_Continuous@2x.png.meta | 146 ++ .../Icons/d_Tangent_Linear On.png | Bin 0 -> 269 bytes .../Icons/d_Tangent_Linear On.png.meta | 146 ++ .../Icons/d_Tangent_Linear On@2x.png | Bin 0 -> 476 bytes .../Icons/d_Tangent_Linear On@2x.png.meta | 146 ++ .../Icons/d_Tangent_Linear.png | Bin 0 -> 311 bytes .../Icons/d_Tangent_Linear.png.meta | 146 ++ .../Icons/d_Tangent_Linear@2x.png | Bin 0 -> 554 bytes .../Icons/d_Tangent_Linear@2x.png.meta | 146 ++ .../Icons/d_ToolHandleElement.png | Bin 0 -> 434 bytes .../Icons/d_ToolHandleElement.png.meta | 146 ++ .../Icons/d_ToolHandleElement@2x.png | Bin 0 -> 731 bytes .../Icons/d_ToolHandleElement@2x.png.meta | 146 ++ .../Icons/d_ToolHandleParent.png | Bin 0 -> 454 bytes .../Icons/d_ToolHandleParent.png.meta | 146 ++ .../Icons/d_ToolHandleParent@2x.png | Bin 0 -> 726 bytes .../Icons/d_ToolHandleParent@2x.png.meta | 146 ++ .../Editor/Editor Resources/Textures.meta | 9 + .../Textures/TangentLineAATex.png | Bin 0 -> 481 bytes .../Textures/TangentLineAATex.png.meta | 111 + .../Editor/Editor Resources/UI.meta | 8 + .../Editor/Editor Resources/UI/UXML.meta | 8 + .../UI/UXML/splineanimate-inspector.uxml | 27 + .../UI/UXML/splineanimate-inspector.uxml.meta | 10 + Packages/com.unity.splines/Editor/GUI.meta | 3 + .../Editor/GUI/EditorSplineGizmos.cs | 27 + .../Editor/GUI/EditorSplineGizmos.cs.meta | 3 + .../com.unity.splines/Editor/GUI/Editors.meta | 8 + .../GUI/Editors/BezierTangentPropertyField.cs | 107 + .../BezierTangentPropertyField.cs.meta | 3 + .../Editor/GUI/Editors/CommonElementDrawer.cs | 40 + .../GUI/Editors/CommonElementDrawer.cs.meta | 11 + .../Editor/GUI/Editors/ElementDrawer.cs | 37 + .../Editor/GUI/Editors/ElementDrawer.cs.meta | 11 + .../Editor/GUI/Editors/ElementInspector.cs | 119 + .../GUI/Editors/ElementInspector.cs.meta | 11 + .../EmbeddedSplineDataPropertyDrawer.cs | 130 + .../EmbeddedSplineDataPropertyDrawer.cs.meta | 3 + .../Editor/GUI/Editors/KnotPropertyDrawer.cs | 206 ++ .../GUI/Editors/KnotPropertyDrawer.cs.meta | 11 + .../Editor/GUI/Editors/KnotReorderableList.cs | 304 +++ .../GUI/Editors/KnotReorderableList.cs.meta | 3 + .../Editor/GUI/Editors/ReadOnlyField.cs | 24 + .../Editor/GUI/Editors/ReadOnlyField.cs.meta | 11 + .../Editor/GUI/Editors/SplineActionZone.cs | 137 ++ .../GUI/Editors/SplineActionZone.cs.meta | 11 + .../SplineDataDictionaryPropertyDrawer.cs | 19 + ...SplineDataDictionaryPropertyDrawer.cs.meta | 3 + .../GUI/Editors/SplineDataPropertyDrawer.cs | 110 + .../Editors/SplineDataPropertyDrawer.cs.meta | 11 + .../SplineDataReorderableListUtility.cs | 145 ++ .../SplineDataReorderableListUtility.cs.meta | 11 + .../GUI/Editors/SplineInfoPropertyDrawer.cs | 47 + .../Editors/SplineInfoPropertyDrawer.cs.meta | 3 + .../GUI/Editors/SplinePropertyDrawer.cs | 70 + .../GUI/Editors/SplinePropertyDrawer.cs.meta | 11 + .../GUI/Editors/SplineReorderableList.cs | 155 ++ .../GUI/Editors/SplineReorderableList.cs.meta | 3 + .../GUI/Editors/TangentModePropertyField.cs | 143 ++ .../Editors/TangentModePropertyField.cs.meta | 3 + .../GUI/Editors/TangentPropertyField.cs | 127 + .../GUI/Editors/TangentPropertyField.cs.meta | 11 + .../Editor/GUI/SplineDataConversionWindow.cs | 159 ++ .../GUI/SplineDataConversionWindow.cs.meta | 3 + .../Editor/GUI/SplineDataHandles.cs | 321 +++ .../Editor/GUI/SplineDataHandles.cs.meta | 11 + .../com.unity.splines/Editor/GUI/SplineGUI.cs | 207 ++ .../Editor/GUI/SplineGUI.cs.meta | 11 + .../Editor/GUI/SplineGUIUtility.cs | 82 + .../Editor/GUI/SplineGUIUtility.cs.meta | 11 + .../Editor/GUI/SplineIndexPropertyDrawer.cs | 53 + .../GUI/SplineIndexPropertyDrawer.cs.meta | 3 + .../Editor/GUI/SplineMenu.cs | 83 + .../Editor/GUI/SplineMenu.cs.meta | 11 + .../Editor/GUI/ToolbarsOverlays.meta | 3 + .../GUI/ToolbarsOverlays/BezierKnotDrawer.cs | 113 + .../ToolbarsOverlays/BezierKnotDrawer.cs.meta | 11 + .../DefaultKnotTypeDropdown.cs | 64 + .../DefaultKnotTypeDropdown.cs.meta | 3 + .../ToolbarsOverlays/Float3PropertyField.cs | 118 + .../Float3PropertyField.cs.meta | 11 + .../HandleRotationDropdown.cs | 94 + .../HandleRotationDropdown.cs.meta | 11 + .../Editor/GUI/ToolbarsOverlays/Separator.cs | 12 + .../GUI/ToolbarsOverlays/Separator.cs.meta | 11 + .../SplineHandleSettingsDropdown.cs | 35 + .../SplineHandleSettingsDropdown.cs.meta | 11 + .../SplineHandleSettingsWindow.cs | 88 + .../SplineHandleSettingsWindow.cs.meta | 11 + .../SplineInspectorOverlay.cs | 87 + .../SplineInspectorOverlay.cs.meta | 11 + .../GUI/ToolbarsOverlays/TangentDrawer.cs | 135 + .../ToolbarsOverlays/TangentDrawer.cs.meta | 11 + .../com.unity.splines/Editor/Stylesheets.meta | 8 + .../SplineAnimateInspectorCommon.uss | 13 + .../SplineAnimateInspectorCommon.uss.meta | 11 + .../SplineAnimateInspectorDark.uss | 3 + .../SplineAnimateInspectorDark.uss.meta | 11 + .../SplineAnimateInspectorLight.uss | 3 + .../SplineAnimateInspectorLight.uss.meta | 11 + .../Stylesheets/SplineInspectorCommon.uss | 229 ++ .../SplineInspectorCommon.uss.meta | 11 + .../Stylesheets/SplineInspectorDark.uss | 16 + .../Stylesheets/SplineInspectorDark.uss.meta | 11 + .../Stylesheets/SplineInspectorLight.uss | 16 + .../Stylesheets/SplineInspectorLight.uss.meta | 11 + Packages/com.unity.splines/Editor/Tools.meta | 8 + .../Editor/Tools/CreateSplineTool.cs | 99 + .../Editor/Tools/CreateSplineTool.cs.meta | 2 + .../Editor/Tools/CreateToolbarBase.cs | 78 + .../Editor/Tools/CreateToolbarBase.cs.meta | 3 + .../Editor/Tools/KnotPlacementData.cs | 64 + .../Editor/Tools/KnotPlacementData.cs.meta | 11 + .../Editor/Tools/KnotPlacementTool.cs | 822 +++++++ .../Editor/Tools/KnotPlacementTool.cs.meta | 11 + .../Editor/Tools/SplineMoveTool.cs | 74 + .../Editor/Tools/SplineMoveTool.cs.meta | 11 + .../Editor/Tools/SplineRotateTool.cs | 68 + .../Editor/Tools/SplineRotateTool.cs.meta | 11 + .../Editor/Tools/SplineScaleTool.cs | 65 + .../Editor/Tools/SplineScaleTool.cs.meta | 11 + .../Editor/Tools/SplineTool.cs | 279 +++ .../Editor/Tools/SplineTool.cs.meta | 11 + .../Editor/Tools/SplineToolContext.cs | 467 ++++ .../Editor/Tools/SplineToolContext.cs.meta | 3 + .../Editor/Tools/TransformOperation.cs | 551 +++++ .../Editor/Tools/TransformOperation.cs.meta | 11 + .../Editor/Unity.Splines.Editor.asmdef | 20 + .../Editor/Unity.Splines.Editor.asmdef.meta | 7 + .../com.unity.splines/Editor/Utilities.meta | 8 + .../Editor/Utilities/EditorSplineUtility.cs | 999 ++++++++ .../Utilities/EditorSplineUtility.cs.meta | 11 + .../Editor/Utilities/PathIcons.cs | 30 + .../Editor/Utilities/PathIcons.cs.meta | 11 + .../Utilities/SerializedPropertyUtility.cs | 255 ++ .../SerializedPropertyUtility.cs.meta | 11 + .../Editor/Utilities/SplineCacheUtility.cs | 330 +++ .../Utilities/SplineCacheUtility.cs.meta | 11 + .../Editor/Utilities/SplineDataHandle.cs | 87 + .../Editor/Utilities/SplineDataHandle.cs.meta | 3 + .../Editor/Utilities/SplineExtrudeUtility.cs | 103 + .../Utilities/SplineExtrudeUtility.cs.meta | 2 + .../Editor/Utilities/SplineGizmoUtility.cs | 83 + .../Utilities/SplineGizmoUtility.cs.meta | 11 + .../Editor/Utilities/SplineHandleUtility.cs | 372 +++ .../Utilities/SplineHandleUtility.cs.meta | 11 + .../Utilities/SplineSelectionUtility.cs | 237 ++ .../Utilities/SplineSelectionUtility.cs.meta | 11 + Packages/com.unity.splines/LICENSE.md | 5 + Packages/com.unity.splines/LICENSE.md.meta | 7 + Packages/com.unity.splines/Runtime.meta | 8 + .../com.unity.splines/Runtime/ArrayUtility.cs | 62 + .../Runtime/ArrayUtility.cs.meta | 11 + .../com.unity.splines/Runtime/AssemblyInfo.cs | 7 + .../Runtime/AssemblyInfo.cs.meta | 11 + .../com.unity.splines/Runtime/BezierCurve.cs | 211 ++ .../Runtime/BezierCurve.cs.meta | 3 + .../com.unity.splines/Runtime/BezierKnot.cs | 194 ++ .../Runtime/BezierKnot.cs.meta | 3 + .../com.unity.splines/Runtime/BezierMode.cs | 35 + .../Runtime/BezierMode.cs.meta | 11 + .../Runtime/BezierTangent.cs | 21 + .../Runtime/BezierTangent.cs.meta | 3 + .../com.unity.splines/Runtime/CurveUtility.cs | 489 ++++ .../Runtime/CurveUtility.cs.meta | 3 + .../com.unity.splines/Runtime/DataPoint.cs | 93 + .../Runtime/DataPoint.cs.meta | 3 + .../Runtime/EmbeddedSplineData.cs | 192 ++ .../Runtime/EmbeddedSplineData.cs.meta | 3 + .../Runtime/EmbeddedSplineDataType.cs | 32 + .../Runtime/EmbeddedSplineDataType.cs.meta | 3 + .../Runtime/IExtrudeShape.cs | 337 +++ .../Runtime/IExtrudeShape.cs.meta | 3 + Packages/com.unity.splines/Runtime/ISpline.cs | 99 + .../com.unity.splines/Runtime/ISpline.cs.meta | 3 + .../Runtime/ISplineContainer.cs | 20 + .../Runtime/ISplineContainer.cs.meta | 11 + .../Runtime/ISplineProvider.cs | 17 + .../Runtime/ISplineProvider.cs.meta | 11 + .../Runtime/Interpolators.cs | 253 ++ .../Runtime/Interpolators.cs.meta | 11 + .../Runtime/InterpolatorsUtility.cs | 94 + .../Runtime/InterpolatorsUtility.cs.meta | 11 + .../Runtime/KnotLinkCollection.cs | 279 +++ .../Runtime/KnotLinkCollection.cs.meta | 11 + .../com.unity.splines/Runtime/MathUtility.cs | 30 + .../Runtime/MathUtility.cs.meta | 11 + .../com.unity.splines/Runtime/NativeSpline.cs | 378 +++ .../Runtime/NativeSpline.cs.meta | 3 + .../Runtime/PropertyAttributes.cs | 67 + .../Runtime/PropertyAttributes.cs.meta | 11 + .../Runtime/RamerDouglasPeucker.cs | 101 + .../Runtime/RamerDouglasPeucker.cs.meta | 3 + Packages/com.unity.splines/Runtime/Spline.cs | 1249 ++++++++++ .../com.unity.splines/Runtime/Spline.cs.meta | 11 + .../Runtime/SplineAnimate.cs | 797 ++++++ .../Runtime/SplineAnimate.cs.meta | 11 + .../Runtime/SplineComponent.cs | 47 + .../Runtime/SplineComponent.cs.meta | 3 + .../Runtime/SplineContainer.cs | 591 +++++ .../Runtime/SplineContainer.cs.meta | 11 + .../com.unity.splines/Runtime/SplineData.cs | 659 +++++ .../Runtime/SplineData.cs.meta | 3 + .../Runtime/SplineDataDictionary.cs | 95 + .../Runtime/SplineDataDictionary.cs.meta | 3 + .../Runtime/SplineDataHandleAttribute.cs | 13 + .../Runtime/SplineDataHandleAttribute.cs.meta | 3 + .../Runtime/SplineExtrude.cs | 542 +++++ .../Runtime/SplineExtrude.cs.meta | 11 + .../Runtime/SplineFactory.cs | 314 +++ .../Runtime/SplineFactory.cs.meta | 3 + .../com.unity.splines/Runtime/SplineInfo.cs | 139 ++ .../Runtime/SplineInfo.cs.meta | 11 + .../Runtime/SplineInstantiate.cs | 1150 +++++++++ .../Runtime/SplineInstantiate.cs.meta | 11 + .../com.unity.splines/Runtime/SplineJobs.cs | 194 ++ .../Runtime/SplineJobs.cs.meta | 3 + .../Runtime/SplineKnotIndex.cs | 108 + .../Runtime/SplineKnotIndex.cs.meta | 11 + .../com.unity.splines/Runtime/SplineMath.cs | 121 + .../Runtime/SplineMath.cs.meta | 3 + .../com.unity.splines/Runtime/SplineMesh.cs | 856 +++++++ .../Runtime/SplineMesh.cs.meta | 3 + .../Runtime/SplineModificationData.cs | 58 + .../Runtime/SplineModificationData.cs.meta | 3 + .../com.unity.splines/Runtime/SplinePath.cs | 342 +++ .../Runtime/SplinePath.cs.meta | 3 + .../com.unity.splines/Runtime/SplineRange.cs | 186 ++ .../Runtime/SplineRange.cs.meta | 3 + .../Runtime/SplineShaderUtility.cs | 132 + .../Runtime/SplineShaderUtility.cs.meta | 3 + .../com.unity.splines/Runtime/SplineSlice.cs | 234 ++ .../Runtime/SplineSlice.cs.meta | 3 + .../com.unity.splines/Runtime/SplineType.cs | 48 + .../Runtime/SplineType.cs.meta | 11 + .../Runtime/SplineUtility.cs | 2163 +++++++++++++++++ .../Runtime/SplineUtility.cs.meta | 11 + .../Runtime/Unity.Splines.asmdef | 28 + .../Runtime/Unity.Splines.asmdef.meta | 7 + Packages/com.unity.splines/Shader.meta | 8 + .../com.unity.splines/Shader/Spline.cginc | 87 + .../Shader/Spline.cginc.meta | 7 + Packages/com.unity.splines/package.json | 41 + Packages/com.unity.splines/package.json.meta | 7 + .../Editor/TMP/TMP_BaseEditorPanel.cs | 99 +- .../Runtime/UGUI/UI/Core/Slider.cs | 18 + Packages/com.unity.ugui/package.json | 2 +- .../Editor/Controls/VFXEnumValuePopup.cs | 20 +- .../GraphView/Views/Properties/PropertyRM.cs | 2 +- .../com.unity.visualeffectgraph/package.json | 2 +- 404 files changed, 36285 insertions(+), 163 deletions(-) create mode 100644 Packages/com.unity.splines/.attestation.p7m create mode 100644 Packages/com.unity.splines/.signature create mode 100644 Packages/com.unity.splines/CHANGELOG.md create mode 100644 Packages/com.unity.splines/CHANGELOG.md.meta create mode 100644 Packages/com.unity.splines/Editor.meta create mode 100644 Packages/com.unity.splines/Editor/AssemblyInfo.cs create mode 100644 Packages/com.unity.splines/Editor/AssemblyInfo.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Components.meta create mode 100644 Packages/com.unity.splines/Editor/Components/SplineAnimateEditor.cs create mode 100644 Packages/com.unity.splines/Editor/Components/SplineAnimateEditor.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Components/SplineComponentEditor.cs create mode 100644 Packages/com.unity.splines/Editor/Components/SplineComponentEditor.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Components/SplineContainerEditor.cs create mode 100644 Packages/com.unity.splines/Editor/Components/SplineContainerEditor.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Components/SplineExtrudeEditor.cs create mode 100644 Packages/com.unity.splines/Editor/Components/SplineExtrudeEditor.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Components/SplineInstantiateEditor.cs create mode 100644 Packages/com.unity.splines/Editor/Components/SplineInstantiateEditor.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/CurveHandles.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/CurveHandles.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/DirectManipulation.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/DirectManipulation.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/KnotHandles.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/KnotHandles.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineElementRectSelector.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineElementRectSelector.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineHandleSettings.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineHandleSettings.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineHandles.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineHandles.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineMeshHandle.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/SplineMeshHandle.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Controls/TangentHandles.cs create mode 100644 Packages/com.unity.splines/Editor/Controls/TangentHandles.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Core.meta create mode 100644 Packages/com.unity.splines/Editor/Core/CopyPaste.cs create mode 100644 Packages/com.unity.splines/Editor/Core/CopyPaste.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Core/PathSettings.cs create mode 100644 Packages/com.unity.splines/Editor/Core/PathSettings.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Core/SelectionContext.cs create mode 100644 Packages/com.unity.splines/Editor/Core/SelectionContext.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Core/SplineElement.cs create mode 100644 Packages/com.unity.splines/Editor/Core/SplineElement.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Core/SplineSelection.cs create mode 100644 Packages/com.unity.splines/Editor/Core/SplineSelection.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot On.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot On.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot On@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot On@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/AutoSmoothKnot@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/KnotPlacementTool.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/KnotPlacementTool.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/KnotPlacementTool@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/KnotPlacementTool@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineComponent.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineComponent.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineComponent@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineComponent@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineContext.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineContext.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineContext@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineContext@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineEditMode-Info.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineEditMode-Info.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineEditMode-Info@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/SplineEditMode-Info@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous On.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous On.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous On@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous On@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Continuous@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear On.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear On.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear On@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear On@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/Tangent_Linear@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleElement.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleElement.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleElement@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleElement@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleParent.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleParent.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleParent@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/ToolHandleParent@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot On.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot On.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot On@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot On@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_AutoSmoothKnot@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_KnotPlacementTool.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_KnotPlacementTool.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_KnotPlacementTool@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_KnotPlacementTool@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineComponent.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineComponent.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineComponent@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineComponent@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineContext.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineContext.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineContext@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineContext@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineEditMode-Info.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineEditMode-Info.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineEditMode-Info@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_SplineEditMode-Info@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous On.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous On.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous On@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous On@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Continuous@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear On.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear On.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear On@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear On@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_Tangent_Linear@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleElement.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleElement.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleElement@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleElement@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleParent.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleParent.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleParent@2x.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Icons/d_ToolHandleParent@2x.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Textures.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Textures/TangentLineAATex.png create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/Textures/TangentLineAATex.png.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/UI.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/UI/UXML.meta create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/UI/UXML/splineanimate-inspector.uxml create mode 100644 Packages/com.unity.splines/Editor/Editor Resources/UI/UXML/splineanimate-inspector.uxml.meta create mode 100644 Packages/com.unity.splines/Editor/GUI.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/EditorSplineGizmos.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/EditorSplineGizmos.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/BezierTangentPropertyField.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/BezierTangentPropertyField.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/CommonElementDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/CommonElementDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/ElementDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/ElementDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/ElementInspector.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/ElementInspector.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/EmbeddedSplineDataPropertyDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/EmbeddedSplineDataPropertyDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/KnotPropertyDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/KnotPropertyDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/KnotReorderableList.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/KnotReorderableList.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/ReadOnlyField.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/ReadOnlyField.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineActionZone.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineActionZone.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineDataDictionaryPropertyDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineDataDictionaryPropertyDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineDataPropertyDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineDataPropertyDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineDataReorderableListUtility.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineDataReorderableListUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineInfoPropertyDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineInfoPropertyDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplinePropertyDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplinePropertyDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineReorderableList.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/SplineReorderableList.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/TangentModePropertyField.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/TangentModePropertyField.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/TangentPropertyField.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/Editors/TangentPropertyField.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineDataConversionWindow.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineDataConversionWindow.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineDataHandles.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineDataHandles.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineGUI.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineGUI.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineGUIUtility.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineGUIUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineIndexPropertyDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineIndexPropertyDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineMenu.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/SplineMenu.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/BezierKnotDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/BezierKnotDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/DefaultKnotTypeDropdown.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/DefaultKnotTypeDropdown.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/Float3PropertyField.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/Float3PropertyField.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/HandleRotationDropdown.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/HandleRotationDropdown.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/Separator.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/Separator.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/SplineHandleSettingsDropdown.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/SplineHandleSettingsDropdown.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/SplineHandleSettingsWindow.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/SplineHandleSettingsWindow.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/SplineInspectorOverlay.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/SplineInspectorOverlay.cs.meta create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/TangentDrawer.cs create mode 100644 Packages/com.unity.splines/Editor/GUI/ToolbarsOverlays/TangentDrawer.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Stylesheets.meta create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineAnimateInspectorCommon.uss create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineAnimateInspectorCommon.uss.meta create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineAnimateInspectorDark.uss create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineAnimateInspectorDark.uss.meta create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineAnimateInspectorLight.uss create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineAnimateInspectorLight.uss.meta create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineInspectorCommon.uss create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineInspectorCommon.uss.meta create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineInspectorDark.uss create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineInspectorDark.uss.meta create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineInspectorLight.uss create mode 100644 Packages/com.unity.splines/Editor/Stylesheets/SplineInspectorLight.uss.meta create mode 100644 Packages/com.unity.splines/Editor/Tools.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/CreateSplineTool.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/CreateSplineTool.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/CreateToolbarBase.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/CreateToolbarBase.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/KnotPlacementData.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/KnotPlacementData.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/KnotPlacementTool.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/KnotPlacementTool.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineMoveTool.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineMoveTool.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineRotateTool.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineRotateTool.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineScaleTool.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineScaleTool.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineTool.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineTool.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineToolContext.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/SplineToolContext.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Tools/TransformOperation.cs create mode 100644 Packages/com.unity.splines/Editor/Tools/TransformOperation.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Unity.Splines.Editor.asmdef create mode 100644 Packages/com.unity.splines/Editor/Unity.Splines.Editor.asmdef.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/EditorSplineUtility.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/EditorSplineUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/PathIcons.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/PathIcons.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/SerializedPropertyUtility.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/SerializedPropertyUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineCacheUtility.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineCacheUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineDataHandle.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineDataHandle.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineExtrudeUtility.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineExtrudeUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineGizmoUtility.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineGizmoUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineHandleUtility.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineHandleUtility.cs.meta create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineSelectionUtility.cs create mode 100644 Packages/com.unity.splines/Editor/Utilities/SplineSelectionUtility.cs.meta create mode 100644 Packages/com.unity.splines/LICENSE.md create mode 100644 Packages/com.unity.splines/LICENSE.md.meta create mode 100644 Packages/com.unity.splines/Runtime.meta create mode 100644 Packages/com.unity.splines/Runtime/ArrayUtility.cs create mode 100644 Packages/com.unity.splines/Runtime/ArrayUtility.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/AssemblyInfo.cs create mode 100644 Packages/com.unity.splines/Runtime/AssemblyInfo.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/BezierCurve.cs create mode 100644 Packages/com.unity.splines/Runtime/BezierCurve.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/BezierKnot.cs create mode 100644 Packages/com.unity.splines/Runtime/BezierKnot.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/BezierMode.cs create mode 100644 Packages/com.unity.splines/Runtime/BezierMode.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/BezierTangent.cs create mode 100644 Packages/com.unity.splines/Runtime/BezierTangent.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/CurveUtility.cs create mode 100644 Packages/com.unity.splines/Runtime/CurveUtility.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/DataPoint.cs create mode 100644 Packages/com.unity.splines/Runtime/DataPoint.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/EmbeddedSplineData.cs create mode 100644 Packages/com.unity.splines/Runtime/EmbeddedSplineData.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/EmbeddedSplineDataType.cs create mode 100644 Packages/com.unity.splines/Runtime/EmbeddedSplineDataType.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/IExtrudeShape.cs create mode 100644 Packages/com.unity.splines/Runtime/IExtrudeShape.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/ISpline.cs create mode 100644 Packages/com.unity.splines/Runtime/ISpline.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/ISplineContainer.cs create mode 100644 Packages/com.unity.splines/Runtime/ISplineContainer.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/ISplineProvider.cs create mode 100644 Packages/com.unity.splines/Runtime/ISplineProvider.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/Interpolators.cs create mode 100644 Packages/com.unity.splines/Runtime/Interpolators.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/InterpolatorsUtility.cs create mode 100644 Packages/com.unity.splines/Runtime/InterpolatorsUtility.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/KnotLinkCollection.cs create mode 100644 Packages/com.unity.splines/Runtime/KnotLinkCollection.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/MathUtility.cs create mode 100644 Packages/com.unity.splines/Runtime/MathUtility.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/NativeSpline.cs create mode 100644 Packages/com.unity.splines/Runtime/NativeSpline.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/PropertyAttributes.cs create mode 100644 Packages/com.unity.splines/Runtime/PropertyAttributes.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/RamerDouglasPeucker.cs create mode 100644 Packages/com.unity.splines/Runtime/RamerDouglasPeucker.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/Spline.cs create mode 100644 Packages/com.unity.splines/Runtime/Spline.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineAnimate.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineAnimate.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineComponent.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineComponent.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineContainer.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineContainer.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineData.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineData.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineDataDictionary.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineDataDictionary.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineDataHandleAttribute.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineDataHandleAttribute.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineExtrude.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineExtrude.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineFactory.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineFactory.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineInfo.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineInfo.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineInstantiate.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineInstantiate.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineJobs.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineJobs.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineKnotIndex.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineKnotIndex.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineMath.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineMath.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineMesh.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineMesh.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineModificationData.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineModificationData.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplinePath.cs create mode 100644 Packages/com.unity.splines/Runtime/SplinePath.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineRange.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineRange.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineShaderUtility.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineShaderUtility.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineSlice.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineSlice.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineType.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineType.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/SplineUtility.cs create mode 100644 Packages/com.unity.splines/Runtime/SplineUtility.cs.meta create mode 100644 Packages/com.unity.splines/Runtime/Unity.Splines.asmdef create mode 100644 Packages/com.unity.splines/Runtime/Unity.Splines.asmdef.meta create mode 100644 Packages/com.unity.splines/Shader.meta create mode 100644 Packages/com.unity.splines/Shader/Spline.cginc create mode 100644 Packages/com.unity.splines/Shader/Spline.cginc.meta create mode 100644 Packages/com.unity.splines/package.json create mode 100644 Packages/com.unity.splines/package.json.meta diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbePlacement.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbePlacement.cs index f5064dfa..1e1ee6dd 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbePlacement.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbePlacement.cs @@ -506,6 +506,8 @@ namespace UnityEngine.Rendering props.SetInt(_AxisSwizzle, 2); cmd.DrawProcedural(transform, voxelizeMaterial, shaderPass: 0, MeshTopology.Quads, 4 * terrainTileCount, 1, props); + //WW1MOD - add if-case, comon unity + if (terrain.drawTreesAndFoliage) foreach (var prototype in kp.treePrototypes) { if (prototype.component == null || prototype.instances.Count == 0) diff --git a/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs b/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs index ec52b772..518a9a46 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs @@ -74,6 +74,7 @@ namespace UnityEditor.Rendering public float setVal, unsetVal; } List m_KeywordFloatRename = new List(); + Dictionary)> m_ConditionalFloatRename; /// /// Type of property to rename. @@ -222,6 +223,20 @@ namespace UnityEditor.Rendering dstMaterial.SetFloat(t.property, srcMaterial.IsKeywordEnabled(t.keyword) ? t.setVal : t.unsetVal); } + + // Handle conditional float renaming + if (m_ConditionalFloatRename != null) + { + foreach (var (oldName, (newName, condition)) in m_ConditionalFloatRename) + { + if (srcMaterial.HasProperty(oldName) && + condition(srcMaterial.GetFloat(oldName)) && + dstMaterial.HasProperty(newName)) + { + dstMaterial.SetFloat(newName, 1.0f); + } + } + } } /// @@ -318,6 +333,17 @@ namespace UnityEditor.Rendering m_KeywordFloatRename.Add(new KeywordFloatRename { keyword = oldName, property = newName, setVal = setVal, unsetVal = unsetVal }); } + /// + /// Rename a float property conditionally based on its value + /// + /// Old property name + /// New property name + /// Condition function that takes the float value and returns true if renaming should occur + protected void RenameFloat(string oldName, string newName, System.Func condition) + { + (m_ConditionalFloatRename ??= new Dictionary)>())[oldName] = (newName, condition); + } + static MaterialUpgrader GetUpgrader(List upgraders, Material material) { if (material == null || material.shader == null) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs index 9d5e3346..2f732228 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs @@ -85,7 +85,9 @@ namespace UnityEngine.Rendering /// Input value. public virtual void SetValue(T value) { - Assert.IsNotNull(setter); + if (setter == null) + return; + var v = ValidateValue(value); if (v == null || !v.Equals(getter())) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs index 390c7b24..aecc6719 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs @@ -2312,6 +2312,7 @@ namespace UnityEngine.Rendering public InstanceOcclusionTestSubviewSettings subviewSettings; public OccluderHandles occluderHandles; public IndirectBufferContextHandles bufferHandles; + public OcclusionCullingCommonShaderVariables commonShaderVariables; } public void InstanceOcclusionTest(RenderGraph renderGraph, in OcclusionCullingSettings settings, ReadOnlySpan subviewOcclusionTests, RenderersBatchersContext batchersContext) @@ -2335,6 +2336,25 @@ namespace UnityEngine.Rendering passData.bufferHandles.UseForOcclusionTest(builder); passData.occluderHandles.UseForOcclusionTest(builder); + // Resolve the correct occlusion culling common data now as the depth buffer dimensions may be different when we execute, + // especially as we are dealing with the previous frame's occluders. + // (e.g. dynamic resolution) + int indirectContextIndex = m_IndirectStorage.TryGetContextIndex(settings.viewInstanceID); + if (indirectContextIndex >= 0) + { + var debugStats = GPUResidentDrawer.GetDebugStats(); + + passData.commonShaderVariables = new OcclusionCullingCommonShaderVariables( + in occluderCtx, + passData.subviewSettings, + debugStats?.occlusionOverlayCountVisible ?? false, + debugStats?.overrideOcclusionTestToAlwaysPass ?? false); + } + else + { + passData.commonShaderVariables = default; + } + builder.SetRenderFunc((InstanceOcclusionTestPassData data, ComputeGraphContext context) => { var batcher = GPUResidentDrawer.instance.batcher; @@ -2344,6 +2364,7 @@ namespace UnityEngine.Rendering data.subviewSettings, data.bufferHandles, data.occluderHandles, + data.commonShaderVariables, batcher.batchersContext); }); } @@ -2403,6 +2424,7 @@ namespace UnityEngine.Rendering in InstanceOcclusionTestSubviewSettings subviewSettings, in IndirectBufferContextHandles bufferHandles, in OccluderHandles occluderHandles, + in OcclusionCullingCommonShaderVariables commonShaderVariables, RenderersBatchersContext batchersContext) { var occlusionCullingCommon = batchersContext.occlusionCullingCommon; @@ -2534,7 +2556,7 @@ namespace UnityEngine.Rendering cmd.SetBufferData(m_ConstantBuffer, m_ShaderVariables); cmd.SetComputeConstantBufferParam(cs, ShaderIDs.InstanceOcclusionCullerShaderVariables, m_ConstantBuffer, 0, m_ConstantBuffer.stride); - occlusionCullingCommon.PrepareCulling(cmd, in occluderCtx, settings, subviewSettings, m_OcclusionTestShader, occlusionDebug); + occlusionCullingCommon.PrepareCulling(cmd, in commonShaderVariables, settings, m_OcclusionTestShader, occlusionDebug); if (doCopyInstances) { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs index 7db7f119..2b9bb979 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs @@ -332,14 +332,18 @@ namespace UnityEngine.Rendering var transformUpdateDataQueue = new NativeArray(initialize ? instances.Length * 2 : instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); var boundingSpheresUpdateDataQueue = new NativeArray(m_EnableBoundingSpheres ? instances.Length : 0, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); - var probeInstanceQueue = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); - var compactTetrahedronCache = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); - var probeQueryPosition = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); - var probeUpdateDataQueue = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); - var probeOcclusionUpdateDataQueue = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); + //WW1MOD THIS FUNCTION's COMMENTED OUT LINES + // Quite ugly, sorry, need to remove everything related to ProbesUpdateJob as we dont use lightprobes and this is wasted performance + // Figure this is easier to merge then to remove all offending lines? + + //var probeInstanceQueue = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); + //var compactTetrahedronCache = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); + //var probeQueryPosition = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); + //var probeUpdateDataQueue = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); + //var probeOcclusionUpdateDataQueue = new NativeArray(instances.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); var transformQueueCount = 0; - int probesQueueCount = 0; + //int probesQueueCount = 0; var transformJob = new TransformUpdateJob() { @@ -356,28 +360,28 @@ namespace UnityEngine.Rendering boundingSpheresDataQueue = boundingSpheresUpdateDataQueue, }; - var probesJob = new ProbesUpdateJob() - { - instances = instances, - instanceData = m_InstanceData, - sharedInstanceData = m_SharedInstanceData, - atomicProbesQueueCount = new UnsafeAtomicCounter32(&probesQueueCount), - probeInstanceQueue = probeInstanceQueue, - compactTetrahedronCache = compactTetrahedronCache, - probeQueryPosition = probeQueryPosition - }; + //var probesJob = new ProbesUpdateJob() + //{ + // instances = instances, + // instanceData = m_InstanceData, + // sharedInstanceData = m_SharedInstanceData, + // atomicProbesQueueCount = new UnsafeAtomicCounter32(&probesQueueCount), + // probeInstanceQueue = probeInstanceQueue, + // compactTetrahedronCache = compactTetrahedronCache, + // probeQueryPosition = probeQueryPosition + //}; JobHandle jobHandle = transformJob.ScheduleBatch(instances.Length, TransformUpdateJob.k_BatchSize); - jobHandle = probesJob.ScheduleBatch(instances.Length, ProbesUpdateJob.k_BatchSize, jobHandle); + //jobHandle = probesJob.ScheduleBatch(instances.Length, ProbesUpdateJob.k_BatchSize, jobHandle); jobHandle.Complete(); - if (probesQueueCount > 0) - { - ScheduleInterpolateProbesAndUpdateTetrahedronCache(probesQueueCount, probeInstanceQueue, compactTetrahedronCache, probeQueryPosition, - probeUpdateDataQueue, probeOcclusionUpdateDataQueue).Complete(); + //if (probesQueueCount > 0) + //{ + // ScheduleInterpolateProbesAndUpdateTetrahedronCache(probesQueueCount, probeInstanceQueue, compactTetrahedronCache, probeQueryPosition, + // probeUpdateDataQueue, probeOcclusionUpdateDataQueue).Complete(); - DispatchProbeUpdateCommand(probesQueueCount, probeInstanceQueue, probeUpdateDataQueue, probeOcclusionUpdateDataQueue, renderersParameters, outputBuffer); - } + // DispatchProbeUpdateCommand(probesQueueCount, probeInstanceQueue, probeUpdateDataQueue, probeOcclusionUpdateDataQueue, renderersParameters, outputBuffer); + //} if (transformQueueCount > 0) { @@ -389,11 +393,11 @@ namespace UnityEngine.Rendering transformUpdateDataQueue.Dispose(); boundingSpheresUpdateDataQueue.Dispose(); - probeInstanceQueue.Dispose(); - compactTetrahedronCache.Dispose(); - probeQueryPosition.Dispose(); - probeUpdateDataQueue.Dispose(); - probeOcclusionUpdateDataQueue.Dispose(); + //probeInstanceQueue.Dispose(); + //compactTetrahedronCache.Dispose(); + //probeQueryPosition.Dispose(); + //probeUpdateDataQueue.Dispose(); + //probeOcclusionUpdateDataQueue.Dispose(); } private unsafe void UpdateInstanceProbesData(NativeArray instances, in RenderersParameters renderersParameters, GPUInstanceDataBuffer outputBuffer) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs index 97a6a836..e9b9da6c 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs @@ -223,17 +223,11 @@ namespace UnityEngine.Rendering return occluderCtx.occlusionDebugOverlaySize != 0; } - internal void PrepareCulling(ComputeCommandBuffer cmd, in OccluderContext occluderCtx, in OcclusionCullingSettings settings, in InstanceOcclusionTestSubviewSettings subviewSettings, in OcclusionTestComputeShader shader, bool useOcclusionDebug) + internal void PrepareCulling(ComputeCommandBuffer cmd, in OcclusionCullingCommonShaderVariables commonShaderVariables, in OcclusionCullingSettings settings, in OcclusionTestComputeShader shader, bool useOcclusionDebug) { OccluderContext.SetKeyword(cmd, shader.cs, shader.occlusionDebugKeyword, useOcclusionDebug); - var debugStats = GPUResidentDrawer.GetDebugStats(); - - m_CommonShaderVariables[0] = new OcclusionCullingCommonShaderVariables( - in occluderCtx, - subviewSettings, - debugStats?.occlusionOverlayCountVisible ?? false, - debugStats?.overrideOcclusionTestToAlwaysPass ?? false); + m_CommonShaderVariables[0] = commonShaderVariables; cmd.SetBufferData(m_CommonConstantBuffer, m_CommonShaderVariables); cmd.SetComputeConstantBufferParam(shader.cs, ShaderIDs.OcclusionCullingCommonShaderVariables, m_CommonConstantBuffer, 0, m_CommonConstantBuffer.stride); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/RenderersBatchersContext.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/RenderersBatchersContext.cs index d223ce42..a398a992 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/RenderersBatchersContext.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/RenderersBatchersContext.cs @@ -311,6 +311,8 @@ namespace UnityEngine.Rendering public void UpdateAmbientProbeAndGpuBuffer(bool forceUpdate) { + return; //WW1MOD JUST NO! We dont use lightprobes, why are you calculating this, its SUPER EXPENSIVE + if (forceUpdate || m_CachedAmbientProbe != RenderSettings.ambientProbe) { m_CachedAmbientProbe = RenderSettings.ambientProbe; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs index eb87426b..c7b03896 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs @@ -610,7 +610,6 @@ namespace UnityEngine.Rendering SetRenderTarget(cmd, colorBuffer, colorLoadAction, colorStoreAction, depthBuffer, depthLoadAction, depthStoreAction, clearFlag, Color.clear); } - // WW1MOD make standalone builds run the same code as the editor, as partially clearing the render target can cause uninitialized garbage pixels to remain on dynamically scaled RTs. private static void SetViewportAndClear(CommandBuffer cmd, RTHandle buffer, ClearFlag clearFlag, Color clearColor) { // Clearing a partial viewport currently does not go through the hardware clear. @@ -619,11 +618,11 @@ namespace UnityEngine.Rendering // That's why in the editor we don't set the viewport before clearing (it's set to full screen by the previous SetRenderTarget) but AFTER so that we benefit from un-bugged hardware clear. // We consider that the small loss in performance is acceptable in the editor. // A refactor of wireframe is needed before we can fix this properly (with not doing anything!) -#if false //!UNITY_EDITOR +#if !UNITY_EDITOR SetViewport(cmd, buffer); #endif CoreUtils.ClearRenderTarget(cmd, clearFlag, clearColor); -#if true //UNITY_EDITOR +#if UNITY_EDITOR SetViewport(cmd, buffer); #endif } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs b/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs index 4fa42010..c53c48b5 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs @@ -126,7 +126,7 @@ namespace UnityEngine.Rendering /// /// In the example above, the custom component `ExampleComponent` extends `VolumeComponent` and defines a parameter /// (`intensity`) that can be manipulated within the volume framework. The `ClampedFloatParameter` is a type of - /// that ensures the value remains within a specified range. + /// that ensures the value remains within a specified range. /// /// [Serializable] @@ -163,7 +163,7 @@ namespace UnityEngine.Rendering /// The backing storage of . Use this for performance-critical work. /// internal VolumeParameter[] parameterList; - + ReadOnlyCollection m_ParameterReadOnlyCollection; /// /// A read-only collection of all the s defined in this class. @@ -232,6 +232,10 @@ namespace UnityEngine.Rendering /// protected virtual void OnDisable() { + // WW1MOD: prevent nullrefs when loading prefab contents in Editor automation scripts + if (parameterList == null) + return; + foreach (var parameter in parameterList) { if (parameter != null) @@ -353,7 +357,7 @@ namespace UnityEngine.Rendering { for (int i = 0; i < parameterList.Length; ++i) { - if (parameterList[i].overrideState) + if (parameterList[i].overrideState) return true; } return false; diff --git a/Packages/com.unity.render-pipelines.core/package.json b/Packages/com.unity.render-pipelines.core/package.json index d32e4d31..8385b992 100644 --- a/Packages/com.unity.render-pipelines.core/package.json +++ b/Packages/com.unity.render-pipelines.core/package.json @@ -14,5 +14,5 @@ "com.unity.modules.jsonserialize": "1.0.0", "com.unity.rendering.light-transport": "1.0.1" }, - "_fingerprint": "317e801bb3aaa64596e4ec903cb788a0dfb07788" + "_fingerprint": "67f868dbad82414b67a47161bdeffad5498e1cc0" } diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Canvas/ShaderGraph/HDCanvasSubTarget.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Canvas/ShaderGraph/HDCanvasSubTarget.cs index 8b7ee534..3ed86cf2 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Canvas/ShaderGraph/HDCanvasSubTarget.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Canvas/ShaderGraph/HDCanvasSubTarget.cs @@ -121,7 +121,12 @@ namespace UnityEditor.Rendering.HighDefinition.ShaderGraph pass.renderStates = new RenderStateCollection { {RenderState.Cull(Cull.Off)}, - {RenderState.ZWrite(ZWrite.On)}, + // WW1MOD - Unity recommended workaround for Canvas ShaderGraphs not working correctly in SceneView. + // Note: Won't be fixed officially as it causes MotionVector issues with Text in WorldSpace UI. Not an issue for us. + // https://support.unity.com/hc/en-us/requests/2392321?page=1 + //{RenderState.ZWrite(ZWrite.On)}, + {RenderState.ZWrite(ZWrite.Off)}, + // WW1MOD - END {RenderState.ZTest(CanvasUniforms.ZTest)}, {RenderState.Blend(Blend.One, Blend.OneMinusSrcAlpha)}, {RenderState.ColorMask(CanvasUniforms.ColorMask)}, diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs index 13dc23de..a6681a85 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs @@ -123,6 +123,10 @@ namespace UnityEditor.Rendering.HighDefinition bool excludeFromTUAndAA = systemData?.excludeFromTUAndAA ?? false; collector.AddToggleProperty(kExcludeFromTUAndAA, excludeFromTUAndAA); + // WW1MOD: added composition mask on stencil user bit 0 + bool compositionMask = systemData?.compositionMask ?? false; + collector.AddToggleProperty(kCompositionMask, compositionMask); + // Configure render state BaseLitAPI.ComputeStencilProperties( receivesLighting, @@ -131,6 +135,7 @@ namespace UnityEditor.Rendering.HighDefinition splitLighting, false, excludeFromTUAndAA, + compositionMask, // WW1MOD out int stencilRef, out int stencilWriteMask, out int stencilRefDepth, diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs index e1ab873c..e6f5dd07 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs @@ -126,6 +126,8 @@ namespace UnityEditor.Rendering.HighDefinition.ShaderGraph AddProperty(customVelocityText, () => systemData.customVelocity, (newValue) => systemData.customVelocity = newValue); AddProperty(excludeFromTUAndAAText, () => systemData.excludeFromTUAndAA, (newValue) => systemData.excludeFromTUAndAA = newValue); + // WW1MOD: added composition mask on stencil user bit 0 + AddProperty(compositionMaskText, () => systemData.compositionMask, (newValue) => systemData.compositionMask = newValue); AddProperty(tessellationEnableText, () => systemData.tessellation, (newValue) => systemData.tessellation = newValue); if (systemData.tessellation) diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs index c0707bf9..61332103 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs @@ -98,6 +98,15 @@ namespace UnityEditor.Rendering.HighDefinition.ShaderGraph set => m_ExcludeFromTUAndAA = value; } + // WW1MOD: added composition mask on stencil user bit 0 + [SerializeField] + bool m_CompositionMask = false; + public bool compositionMask + { + get => m_CompositionMask; + set => m_CompositionMask = value; + } + [SerializeField, Obsolete("Keep for migration")] internal bool m_TransparentDepthPrepass; diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs index 0068fdaf..a902987c 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs @@ -141,6 +141,8 @@ namespace UnityEditor.Rendering.HighDefinition public static GUIContent specularAAThresholdText = new GUIContent("Threshold", "Controls the effect of Specular AA reduction. A values of 0 does not apply reduction, higher values allow higher reduction."); public static GUIContent excludeFromTUAndAAText = new GUIContent("Exclude From Temporal Upscalers and Anti Aliasing", "When enabled, the current material wont be temporaly sampled during TAA and will have reduced ghosting on upscalers."); + // WW1MOD: added composition mask on stencil user bit 0 + public static GUIContent compositionMaskText = new GUIContent("Composition Mask", "When enabled, the current material will be composited directly into the final image without temporal reconstruction."); // SSR public static GUIContent receivesSSRText = new GUIContent("Receive SSR", "When enabled, this Material can receive screen space reflections."); @@ -193,6 +195,7 @@ namespace UnityEditor.Rendering.HighDefinition MaterialProperty transmissionEnable = null; MaterialProperty clearCoatEnabled = null; MaterialProperty excludeFromTUAndAA = null; + MaterialProperty compositionMask = null; // WW1MOD: added composition mask on stencil user bit 0 // Per pixel displacement params MaterialProperty ppdMinSamples = null; @@ -327,6 +330,7 @@ namespace UnityEditor.Rendering.HighDefinition clearCoatEnabled = FindProperty(kClearCoatEnabled); excludeFromTUAndAA = FindProperty(kExcludeFromTUAndAA); + compositionMask = FindProperty(kCompositionMask); // WW1MOD: added composition mask on stencil user bit 0 if ((m_Features & Features.DoubleSidedNormalMode) != 0) { @@ -816,6 +820,10 @@ namespace UnityEditor.Rendering.HighDefinition if (excludeFromTUAndAA != null && BaseLitAPI.CompatibleWithExcludeFromTUAndAA(surfaceTypeValue, renderQueue)) materialEditor.ShaderProperty(excludeFromTUAndAA, Styles.excludeFromTUAndAAText); + // WW1MOD: added composition mask on stencil user bit 0 + if (compositionMask != null && BaseLitAPI.CompatibleWithExcludeFromTUAndAA(surfaceTypeValue, renderQueue)) + materialEditor.ShaderProperty(compositionMask, Styles.compositionMaskText); + if (enableGeometricSpecularAA != null) { materialEditor.ShaderProperty(enableGeometricSpecularAA, Styles.enableGeometricSpecularAAText); diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/BaseLitAPI.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/BaseLitAPI.cs index 219fa9be..51488556 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/BaseLitAPI.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/BaseLitAPI.cs @@ -119,7 +119,8 @@ namespace UnityEngine.Rendering.HighDefinition return CompatibleWithExcludeFromTUAndAA(material.GetSurfaceType(), material.renderQueue) && material.HasProperty(kExcludeFromTUAndAA); } - static public void SetupStencil(Material material, bool receivesLighting, bool receivesSSR, bool useSplitLighting, bool excludeFromTUAndAA = false) + // WW1MOD: added composition mask on stencil user bit 0 + static public void SetupStencil(Material material, bool receivesLighting, bool receivesSSR, bool useSplitLighting, bool excludeFromTUAndAA = false, bool compositionMask = false) { // To determine if the shader is forward only, we can't rely on the presence of GBuffer pass because that depends on the active subshader, which // depends on the active render pipeline, giving an inconsistent result. The properties of a shader are always the same so it's ok to check them @@ -133,6 +134,7 @@ namespace UnityEngine.Rendering.HighDefinition useSplitLighting, hasRefraction, excludeFromTUAndAA, + compositionMask, // WW1MOD out int stencilRef, out int stencilWriteMask, out int stencilRefDepth, @@ -177,6 +179,7 @@ namespace UnityEngine.Rendering.HighDefinition bool useSplitLighting, bool hasRefraction, bool excludeFromTUAndAA, + bool compositionMask, // WW1MOD out int stencilRef, out int stencilWriteMask, out int stencilRefDepth, @@ -252,6 +255,15 @@ namespace UnityEngine.Rendering.HighDefinition stencilWriteMaskDepth |= (int)StencilUsage.ExcludeFromTUAndAA; } + // WW1MOD: added composition mask on stencil user bit 0 + if (compositionMask) + { + stencilRefDepth |= (int)StencilUsage.UserBit0; + stencilRef |= (int)StencilUsage.UserBit0; + stencilWriteMask |= (int)StencilUsage.UserBit0; + stencilWriteMaskDepth |= (int)StencilUsage.UserBit0; + } + stencilWriteMaskDepth |= (int)StencilUsage.IsUnlit; stencilWriteMaskGBuffer |= (int)StencilUsage.IsUnlit; stencilWriteMaskMV |= (int)StencilUsage.IsUnlit; diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitAPI.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitAPI.cs index c5a76210..f0a8077f 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitAPI.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitAPI.cs @@ -14,7 +14,8 @@ namespace UnityEngine.Rendering.HighDefinition bool receiveSSR = material.GetSurfaceType() == SurfaceType.Opaque ? (material.HasProperty(kReceivesSSR) ? material.GetInt(kReceivesSSR) != 0 : false) : (material.HasProperty(kReceivesSSRTransparent) ? material.GetInt(kReceivesSSRTransparent) != 0 : false); bool excludeFromTUAndAA = BaseLitAPI.CompatibleWithExcludeFromTUAndAA(material) && material.GetInt(kExcludeFromTUAndAA) != 0; - BaseLitAPI.SetupStencil(material, receivesLighting: true, receiveSSR, material.GetMaterialType() == MaterialId.LitSSS, excludeFromTUAndAA: excludeFromTUAndAA); + bool compositionMask = BaseLitAPI.CompatibleWithExcludeFromTUAndAA(material) && material.GetInt(kCompositionMask) != 0; // WW1MOD: added composition mask on stencil user bit 0 + BaseLitAPI.SetupStencil(material, receivesLighting: true, receiveSSR, material.GetMaterialType() == MaterialId.LitSSS, excludeFromTUAndAA: excludeFromTUAndAA, compositionMask: compositionMask); BaseLitAPI.SetupDisplacement(material); if (material.HasProperty(kNormalMapSpace)) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/ShaderGraphAPI.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/ShaderGraphAPI.cs index a703d8e2..ee97ead9 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/ShaderGraphAPI.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/ShaderGraphAPI.cs @@ -81,7 +81,8 @@ namespace UnityEngine.Rendering.HighDefinition CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_CLEAR_COAT", material.GetFloat(kClearCoatEnabled) > 0.0); bool excludeFromTUAndAA = BaseLitAPI.CompatibleWithExcludeFromTUAndAA(material) && material.GetInt(kExcludeFromTUAndAA) != 0; - BaseLitAPI.SetupStencil(material, receivesLighting: true, receiveSSR, useSplitLighting, excludeFromTUAndAA); + bool compositionMask = BaseLitAPI.CompatibleWithExcludeFromTUAndAA(material) && material.GetInt(kCompositionMask) != 0; // WW1MOD: added composition mask on stencil user bit 0 + BaseLitAPI.SetupStencil(material, receivesLighting: true, receiveSSR, useSplitLighting, excludeFromTUAndAA, compositionMask); } public static void ValidateDecalMaterial(Material material) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitAPI.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitAPI.cs index a3d64452..30737300 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitAPI.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitAPI.cs @@ -20,7 +20,8 @@ namespace UnityEngine.Rendering.HighDefinition // All the bits exclusively related to lit are ignored inside the BaseLitGUI function. bool receivesLighting = (material.HasProperty(kShadowMatteFilter) && material.GetFloat(kShadowMatteFilter) != 0); bool excludeFromTUAndAA = BaseLitAPI.CompatibleWithExcludeFromTUAndAA(material) && material.GetInt(kExcludeFromTUAndAA) != 0; - BaseLitAPI.SetupStencil(material, receivesLighting: receivesLighting, receivesSSR: false, useSplitLighting: false, excludeFromTUAndAA: excludeFromTUAndAA); + bool compositionMask = BaseLitAPI.CompatibleWithExcludeFromTUAndAA(material) && material.GetInt(kCompositionMask) != 0; // WW1MOD: added composition mask on stencil user bit 0 + BaseLitAPI.SetupStencil(material, receivesLighting: receivesLighting, receivesSSR: false, useSplitLighting: false, excludeFromTUAndAA: excludeFromTUAndAA, compositionMask: compositionMask); } } } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/AlphaUpscale.compute b/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/AlphaUpscale.compute index f304cbb5..faa62ad9 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/AlphaUpscale.compute +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/AlphaUpscale.compute @@ -4,6 +4,7 @@ #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" TEXTURE2D_X(_InputTexture); // Input alpha source at (lower) render resolution @@ -106,6 +107,23 @@ void KMain(uint3 dispatchThreadId : SV_DispatchThreadID) _OutputTexture[COORD_TEXTURE2D_X(InputPos)] = float4(fColor, fAlphaAccumulate); } +static const float3 fKeyColor = float3(0, 1, 0); // Green screen chroma key, this needs to match the camera's background color +static const float fToleranceA = 0.4f; +static const float fToleranceB = 0.49f; + +// Derived from http://gc-films.com/chromakey.html, using the faster YCoCg color space instead of YCbCr +float ChromaKey(float3 fColor) +{ + const float3 fColorYCoCg = RGBToYCoCg(fColor); + const float3 fKeyYCoCg = RGBToYCoCg(fKeyColor); + + const float3 fDelta = fKeyYCoCg - fColorYCoCg; + const float fDist = sqrt(fDelta.y * fDelta.y + fDelta.z * fDelta.z); + const float fMask = fDist < fToleranceA ? 0.0f : fDist < fToleranceB ? (fDist - fToleranceA) / (fToleranceB - fToleranceA) : 1.0f; + + return fMask; +} + [numthreads(8, 8, 1)] void KUpscaleFromDepth(uint3 dispatchThreadId : SV_DispatchThreadID) { @@ -122,24 +140,25 @@ void KUpscaleFromDepth(uint3 dispatchThreadId : SV_DispatchThreadID) const float2 fLrUvJittered = fHrUv - _TaaJitterStrength.zw; // Compensate for jitter in the original render const float2 fHrUvhistory = ((InputPos + 0.5f) * _PostProcessScreenSize.zw)/* * _DynamicResolutionFullscreenScale.xy*/; //history is the size of the output - + // Scale and clamp the UV for its size in the input color texture const float2 fSampleLocation = fHrUv * RenderSize; const float2 fClampedLocation = max(0.5f, min(fSampleLocation, RenderSize - 0.5f)); const float2 fLrUv_HwSampler = fClampedLocation * InvInputResourceSize; - // De-jittered and bilinear upscaled alpha from depth - const float fAlpha = Linear01Depth(SAMPLE_TEXTURE2D_X_LOD(_CameraDepthTexture, s_linear_clamp_sampler, fLrUv_HwSampler, 0).r, _ZBufferParams) < 1 ? 1.0 : 0.0; - + float3 fColor = _InputTexture[COORD_TEXTURE2D_X(InputPos)].rgb; + + // Derive alpha value from green screen chroma keying + const float fAlpha = ChromaKey(fColor); + // Temporally reproject alpha from the previous frame and blend it with the current frame's upscaled alpha const DepthExtents depthExtents = FindDepthExtents(fHrUvhistory, RenderSize); // Dilate depth so we don't end up grabbing motion vectors from the background - const float2 fMotionVector = LOAD_TEXTURE2D_X(_CameraMotionVectorsTexture, depthExtents.fNearestCoord).xy; - const float fReprojectedAlphaHistory = SAMPLE_TEXTURE2D_X_LOD(_InputHistoryTexture, s_linear_clamp_sampler, fHrUvhistory - fMotionVector, 0).r; // Sample reprojected history //TODO WRONG UV - const float fVelocityFactor = saturate(length(fMotionVector * DisplaySize) / 2.0f); // Adjust the amount of temporal blending based on the amount of motion + const float2 fDilatedMotionVector = LOAD_TEXTURE2D_X(_CameraMotionVectorsTexture, depthExtents.fNearestCoord).xy; + const float fReprojectedAlphaHistory = SAMPLE_TEXTURE2D_X_LOD(_InputHistoryTexture, s_linear_clamp_sampler, fHrUvhistory - fDilatedMotionVector, 0).r; // Sample reprojected history //TODO WRONG UV + const float fVelocityFactor = saturate(length(fDilatedMotionVector * DisplaySize) / 2.0f); // Adjust the amount of temporal blending based on the amount of motion const float fBlend = depthExtents.fNearest > FLT_EPS && _TaaFrameInfo.z > 0 ? fVelocityFactor * 0.5f + 0.2f : 1.0f; // Depth clip to eliminate after-images const float fAlphaAccumulate = lerp(fReprojectedAlphaHistory, fAlpha, fBlend); - _OutputHistoryTexture[COORD_TEXTURE2D_X(InputPos)] = fAlphaAccumulate; - const float3 fColor = _InputTexture[COORD_TEXTURE2D_X(InputPos)].rgb; - _OutputTexture2D[(InputPos)] = float4(fColor, fReprojectedAlphaHistory); + _OutputHistoryTexture[COORD_TEXTURE2D_X(InputPos)] = fAlphaAccumulate; + _OutputTexture2D[(InputPos)] = float4(fColor - (1.0f - fAlpha) * fKeyColor, fAlphaAccumulate); // Remove green spill from the edges } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DLSSBiasColorMask.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DLSSBiasColorMask.shader index a6dec20c..4f2a03d9 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DLSSBiasColorMask.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DLSSBiasColorMask.shader @@ -55,13 +55,13 @@ Shader "Hidden/HDRP/DLSSBiasColorMask" } // Half/half reactive pixels, e.g. transparency effects like particles - if (stencilVal & STENCILUSAGE_USER_BIT0) + if (stencilVal & STENCILUSAGE_EXCLUDE_FROM_TUAND_AA) { reactiveValue = max(reactiveValue, 0.5f); } // Fully reactive pixels, e.g. composition effects like scopes - if (stencilVal & STENCILUSAGE_EXCLUDE_FROM_TUAND_AA) + if (stencilVal & STENCILUSAGE_USER_BIT0) { reactiveValue = max(reactiveValue, 0.95f); } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index b1acd45b..6e9d9ae6 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -853,7 +853,7 @@ namespace UnityEngine.Rendering.HighDefinition clearColor = Color.black, name = "Upscaler Color Mask" }), 0); - builder.UseDepthBuffer(inputDepth, DepthAccess.Read); + builder.ReadTexture(stencilBuffer); passData.colorMaskMaterial = m_UpscalerBiasColorMaskMaterial; diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 79dd00a9..f211620a 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -1319,6 +1319,8 @@ namespace UnityEngine.Rendering.HighDefinition public const string kAffectEmission = "_AffectEmission"; /// Exclude from temporal upsamplers and anti aliasing. public const string kExcludeFromTUAndAA = "_ExcludeFromTUAndAA"; + /// WW1MOD: Composite pixels directly into the final image, without temporal reconstruction. + public const string kCompositionMask = "_CompositionMask"; /// Enable Receive Shadows Off (six-way only.) public const string kReceiveShadows = "_ReceiveShadows"; diff --git a/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs b/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs index 9c3890d1..262861f2 100644 --- a/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs +++ b/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs @@ -129,6 +129,10 @@ namespace UnityEngine.Rendering.UnifiedRayTracing void AddTrees(TerrainDesc terrainDesc, ref List instanceHandles) { + //WW1MOD why doesnt unity handle this case? + if (!terrainDesc.terrain.drawTreesAndFoliage) + return; + TerrainData terrainData = terrainDesc.terrain.terrainData; float4x4 terrainLocalToWorld = terrainDesc.localToWorldMatrix; float3 positionScale = new float3((float)terrainData.heightmapResolution, 1.0f, (float)terrainData.heightmapResolution) * terrainData.heightmapScale; diff --git a/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/TerrainToMesh.cs b/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/TerrainToMesh.cs index ea69502c..c4c80e50 100644 --- a/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/TerrainToMesh.cs +++ b/Packages/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/TerrainToMesh.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Unity.Burst; using Unity.Collections; @@ -8,6 +9,8 @@ namespace UnityEngine.Rendering.UnifiedRayTracing { internal static class TerrainToMesh { + static Dictionary cache = new(); //WW1MOD Ok we will keep these, i dont care, its still faster and less crappy then re-doing this all the time for multiple bakes in a row + static private AsyncTerrainToMeshRequest MakeAsyncTerrainToMeshRequest(int width, int height, Vector3 heightmapScale, float[,] heightmap, bool[,] holes) { int vertexCount = width * height; @@ -70,6 +73,8 @@ namespace UnityEngine.Rendering.UnifiedRayTracing JobHandle jobHandle = job.Schedule(vertexCount, math.max(width, 128)); + GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); //WW1MOD force GC as ive seen in log ends up with like 12GBs of it at this point... + return new AsyncTerrainToMeshRequest(job, jobHandle); } @@ -83,42 +88,57 @@ namespace UnityEngine.Rendering.UnifiedRayTracing return MakeAsyncTerrainToMeshRequest(width, height, terrainData.heightmapScale, heightmap, holes); } - static public AsyncTerrainToMeshRequest ConvertAsync(int heightmapWidth, int heightmapHeight, short[] heightmapData, Vector3 heightmapScale, int holeWidth, int holeHeight, byte[] holedata) - { - float[,] heightmap = new float[heightmapWidth,heightmapHeight]; - for (int y = 0; y < heightmapHeight; ++y) - for (int x = 0; x < heightmapWidth; ++x) - heightmap[y, x] = (float)heightmapData[y * heightmapWidth + x] / (float)32766; + static public AsyncTerrainToMeshRequest ConvertAsync(int heightmapWidth, int heightmapHeight, short[] heightmapData, Vector3 heightmapScale, int holeWidth, int holeHeight, byte[] holedata) + { + float[,] heightmap = new float[heightmapWidth, heightmapHeight]; + for (int y = 0; y < heightmapHeight; ++y) + for (int x = 0; x < heightmapWidth; ++x) + heightmap[y, x] = (float)heightmapData[y * heightmapWidth + x] / (float)32766; - bool[,] holes = new bool[heightmapWidth - 1, heightmapHeight - 1]; - if (holedata != null) - { - for (int y = 0; y < heightmapHeight - 1; ++y) - for (int x = 0; x < heightmapWidth - 1; ++x) - holes[y, x] = holedata[y * holeWidth + x] != 0; - } - else - { - for (int y = 0; y < heightmapHeight - 1; ++y) - for (int x = 0; x < heightmapWidth - 1; ++x) - holes[x, y] = true; - } - return MakeAsyncTerrainToMeshRequest(heightmapWidth, heightmapHeight, heightmapScale, heightmap, holes); - } - static public Mesh Convert(Terrain terrain) - { - var request = ConvertAsync(terrain); - request.WaitForCompletion(); - return request.GetMesh(); - } - - static public Mesh Convert(int heightmapWidth, int heightmapHeight, short[] heightmapData, Vector3 heightmapScale, int holeWidth, int holeHeight, byte[] holedata) - { - var request = ConvertAsync(heightmapWidth, heightmapHeight, heightmapData, heightmapScale, holeWidth, holeHeight, holedata); - request.WaitForCompletion(); - return request.GetMesh(); - } - } + bool[,] holes = new bool[heightmapWidth - 1, heightmapHeight - 1]; + if (holedata != null) + { + for (int y = 0; y < heightmapHeight - 1; ++y) + for (int x = 0; x < heightmapWidth - 1; ++x) + holes[y, x] = holedata[y * holeWidth + x] != 0; + } + else + { + for (int y = 0; y < heightmapHeight - 1; ++y) + for (int x = 0; x < heightmapWidth - 1; ++x) + holes[x, y] = true; + } + return MakeAsyncTerrainToMeshRequest(heightmapWidth, heightmapHeight, heightmapScale, heightmap, holes); + } + + //WW1MOD this function, Add cache and mesh-name to output + static public Mesh Convert(Terrain terrain) + { + if (cache.TryGetValue(terrain, out Mesh mesh) && mesh != null && mesh.vertexCount > 0) + return mesh; + + var request = ConvertAsync(terrain); + request.WaitForCompletion(); + + mesh = request.GetMesh(); + mesh.name = terrain.name + "_lightbake"; + cache[terrain] = mesh; + + return mesh; + + //Original + //var request = ConvertAsync(terrain); + //request.WaitForCompletion(); + //return request.GetMesh(); + } + + static public Mesh Convert(int heightmapWidth, int heightmapHeight, short[] heightmapData, Vector3 heightmapScale, int holeWidth, int holeHeight, byte[] holedata) + { + var request = ConvertAsync(heightmapWidth, heightmapHeight, heightmapData, heightmapScale, holeWidth, holeHeight, holedata); + request.WaitForCompletion(); + return request.GetMesh(); + } + } internal struct AsyncTerrainToMeshRequest { diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs index 4c5385e6..d9a49c56 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs @@ -10,7 +10,7 @@ namespace UnityEditor.ShaderGraph [Title("UV", "Parallax Occlusion Mapping")] [FormerName("UnityEditor.Experimental.Rendering.HDPipeline.ParallaxOcclusionMappingNode")] [FormerName("UnityEditor.Rendering.HighDefinition.ParallaxOcclusionMappingNode")] - class ParallaxOcclusionMappingNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction, IMayRequireViewDirection, IMayRequireMeshUV + class ParallaxOcclusionMappingNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction, IMayRequireViewDirection, IMayRequireMeshUV, IMayRequireTransform { public ParallaxOcclusionMappingNode() { @@ -220,6 +220,8 @@ $precision {GetVariableNameForSlot(kPixelDepthOffsetOutputSlotId)} = ({tmpMaxHei "); } + public NeededTransform[] RequiresTransform(ShaderStageCapability stageCapability = ShaderStageCapability.All) => new[] { NeededTransform.WorldToObject }; + public NeededCoordinateSpace RequiresViewDirection(ShaderStageCapability stageCapability = ShaderStageCapability.All) { return NeededCoordinateSpace.Tangent; diff --git a/Packages/com.unity.shadergraph/package.json b/Packages/com.unity.shadergraph/package.json index 34db61b3..b06da7dc 100644 --- a/Packages/com.unity.shadergraph/package.json +++ b/Packages/com.unity.shadergraph/package.json @@ -48,5 +48,5 @@ "path": "Samples~/CustomMaterialPropertyDrawers" } ], - "_fingerprint": "5516e0d9751810ec70d19bca7a5251cbecd2b5ca" + "_fingerprint": "41211273cdd1ec56cc330555ecc5be38b9ea2055" } diff --git a/Packages/com.unity.splines/.attestation.p7m b/Packages/com.unity.splines/.attestation.p7m new file mode 100644 index 0000000000000000000000000000000000000000..e80f742dd54f2d97dc7d53e3b5170930befcc62e GIT binary patch literal 10891 zcmdUVc{o*V+qXTK=gix*ks;&S=6P18GRr)~#x~C+i5(I$tE6O>At6I#$e4L1LlG(p zks&kR)}3xW@BO{^{l3TZJ;(9+XCLdj)^)CHE$cjg!?^%7_bnWJ?r_!cEn*NZI33OH z51_fd!5|QV7$C&Kw+dGUAt6vO2nd<|^E^;`$ne>a0cc3?HCA7wrx(i2l~oeK%WCK5 z>0<58D#>c?Y2$$MMY8g;qFlX^_MRy3tC&$Q2WvqQQ9e->J8gpigtCIMsI|Za4KE%? zFh9IRbkk z3&LmQQyCmTT(~~c#=+Ii+07n>^n&Z1KbeP6{PjG52D6@iG9YX$2pUX^g&8LR zqro7o?7PHaJ0EetOvH>4s#a0nRZN!8ydCPhOQSuU7rTSRnT~uozP`5M9$Ds9%-UY> z7c{R)@xbTSnCpEoiCQ!Dvk7;1eifr^?elCu|MkeLm>Xi22hOlL{cdve_ymaFN2kW8 zszTq;k{mVc8%k`sNcn5A3$NtEjQ9<9@2^eAsIUm`R>h8eQBFNK0F(KKV-(G%mr|Ku zQ$3g{}DFw3sB(c$|bP}z%Ai|5yM^@~<7HH+@cMC%Oq*PHsUR9W0qVT>JCK7%m3 z=(|hum_yAZb7o-S1zVX@9ql9L5xe}A%y_pm;bhw873lVWi)EDHM-!$oa=|qXFplS$ zN@3;1eyYspYp02!)hl{ZtgF{@Dest)${Ow~vwKCgd>iRpQb%ofz_Bzccat29`z$4) zd$*kM&?U0v;swj^@7WFsu*Eqe&)k~4=n*zB8z(~;&-TdX&f8hdL>i&ogyCwMa#w~$lmYbnbZU#pmh)NRDd-YDT zgCQU+P!<{t0nnf$fEn|yF|t8v0qS5%2eJ2yl~UW5lC~Z|a=e}t1UiC3Az<8Kfa3U=9ZCccoJ4>? zfRKvgQD$h!Qy`=O&`Z}z*9yP*GpdcJv(WEhPqO-FQeO~0PU)W+{WGEe$mip9#$+=; zCd7XYD*SH<8j^H!6Ce;Y@S;s{v-e&H{&PpWLYR@q_dF z?L>k9#l3p}D3Xj6P%waXx=>(BD5g+=utMya6>Eta9Rh=)DKUB*KFGG4a(yVg`^v## z+Lv6}8rZ|%2vy#7R(u6?U@@}k!qwS&#q1(p&?|L{vM5#3yd}gNu#Ba@3ZKNDxngyZ zRZ^pfpnstW#cu)G?xrS1QD$xz^hkcq(tIo3xGzA}Wz*nQTq4Jlt9~D=G%lC2K)RXN#a%T|AwJr!)VB3g}m z&_ClNcJDr88O__Jsj=n$w9g#Upb_wvx`FQmZ8>mrlhQ(P(^z~zov5DgY}(njC0TLO zJA!IgKD@~mK`e`Fi3DAg-qhdu+ zTL}TTBTShkTF%u2Y*GGU`&$xea{ScZGgUo<8Og}>ah}4WyN_8uS>8$xvNhtECa8=` zX!+EZ2lMoo*)`c{Z3=Duju&ZA_{}FMp@w7MY`UQDEUQ2D<+V3iTE?2V(FUgQ!%WGz zLkQUP#f`|eY>Pv={kr$eOF2TyoYyCsc8c|I~yX?zY5od(c2B>)Y+ynXtC zHhrv-?ZSoU8KkaRg)aATZqipd+Vc(8DZ>)TLSjp#@ZY>n6*Or&a#0Qe z(r^{AUjO!mPd>n%B_Pq4GS^hY+}rx1+?jaasRpAiPqK3gt0S#09KH_Z3KT{U-g5AO zHf~=up7ievQJ0m!VA&C(?G;AG#$s$0X{+DZ%>r8xrwg=W=Tpa9UQUL+*ezA*Fv>#J| zeqfd)o3hLuJm0UewUQ}AhVQ|!oNZO%b>7NP-ga9_o~2lw&zu2HiZf|(%8xY;(y{_M zM#O3*%~f5JN95EtIA2nSsAwNNtg8%r?;9lM(Z#xDQV`d-ndmsT2p<^Hz8di$GP1F< zE<=?z=`W*X>Nw*&5#bokNHSS0jB07wqUL52$JgKhc4|d`cgNH)~An(uu9j^F^H@ zE$1LTj~T~%er;4Y?%-LND$CAgsq%-A<#3gaa%+Ml1u@|ARvCFGT5SrJjxk!2sG{Dit4sz|5W~d=Mb;>i{2$V1>eyCpUF^ zIeSPm@8WNyT|1lHo-}%H*8D7`Zfbc)mL^Fu5Yml9_;Wcv8CU=jQVWDs10j__$n)PE z0x0}JS7o*Q0>#7f_gwBZEhvr~{b9qojwz4dl)!Eb=5N^mAt8WEHl{NCj^6(dHS=FT zs-JfQB7~yBSm9GRJ2Ga*T{!0>7<(Cz2sSCYcY5AFPy?$ap-AVESE+i@JivF4@KWb* z2W^(yA!B!PT=>JdC*GQM?;3sD#h=BkA!c}EJX*AgyY+5AZ3ny@cn44y{wVa8;s zC*?Kxj7N{~_N_|j&GQc!7N58TF+5#X7qaoeWxvwt_vLnRs92fvw|$7%V>%L{`XaFi zkCKl<`0H{^snx9y0f2*$S=3j)Zk@$V?E3Tk^yVk3(7^bW{h>4ol>W@c7@73NbHTDx z4HK6~NizrT(L+X(Md)}sqIDeK%C>5B2PtFION=z3`incNX;G$*_wyn zWs^ufY$UhmugdBS)ykUCMPKs{Gg?|Fp7y99D^f5k#h)}M9yWN*k34u#^@Nt;db<^n z%BQq-_pZ8=1;Hd;YYP6fLcoP?hix ze4Tv}pw-QFFezI1z7RY#^6Xt9RaV*Z{5DhrcCI1AenCodK|G-8Et$kl(tQp;SFZy5 zfB}4(iILfj``Ke3<>zT7?uwQ81y!OBmr^>Zqen|{A+J-oUd7xt!IrM!8CRsL9blJR z_(Zccy_$ih2?NkHA*Ww*5(JvY9W&_sD_4%KF&cBskTDnpL69Ev(O=dWhL47Xo>~rq zru#s>01r%E_~Web17}N&8gkySzD3eOa4aw4@mMC;~_zLasL?;g~KFy~k0HG5;ZSxPSf)pTe%<3T&g1@LcMp++U>cluZ-j3JtcHp{5FLyUrTcqb7 z+d%xSPt||Ei0@2WTK|_~E5qkJmuuW~j>6puK+~OK-E@k8jo_1%Y06QLJ;GOu1Ff1g z?#_WA)%mF0^?CcYi@Uqh-WMCP_j+G%+I$mZ(K;JE&P2wYth7AYW5-ltY8w#GQ>UDI zV+PNvnuj+p;7Q8Y?q^h<*CBN!-2t}PS(KtA-Qu;X3tBoTjWkAK0^`73$zgYPKOPU^ zJ{g(hVYx$hV!|AGl=dSC>SB+|Rbz(uQci7Z_Ujj)Z!rlI69!Il=68H%pXK9O zojLdX+eNAHjG)!CZyc0A7&veE7#KHKbKWvYF`IoIEcNx##H-51^?sS5ol%%bH!P@C zkuD)A4AM2~8^*;@k(ZAY^M;pEx;SNUzh@G@b@v&f^U8cQ#~@#tOx#ZP8gE&YkP?gk z(LriP2YfMn{v1U>b#^{Y zeP}9qlw7zYf#%u*D+IfIAY;8qjD@8qRS|~jk0elG8mnGCn_H`S+Z|uYpy`48qLDVo&A`npEjQGfRN-9Mtp4GL;xXS|By+WpRB_$X`K@W z{ErNr(+T{iTZPG~*i%I0NwG3&5cm z+5U@ogHI^NA2sw83qNs=klatdF>pewi>(xv2Jn>AY~(#zwm*Dl)tVHE$|0z53nPaG zQezL$k&b~1-}E?)hs9>FtbgZF7W<}EQl8kTPn~7GJINAKPlB;?Z#LBiXusGELl^kS z0S!p1?cDVvPYyfXYu14v(qZq6OO>)?2#Ese6}#RJcm!X+RT$|w-)qHhZNu7McaYqs zw@g^G7tD0z*hyQkXql0oqk5XNnp5%9Tx3u$O6>HjE)#vu7SSqE!c$CK&PtrEH}8GZ z);YKADjL{tAQqLzm&c@Xq*(ao;ppKN`PM`#obr~5i1O=A()w-78Dt!&LUs{9MS9De zg7s~xn*N38GuT(@96?>71~LrXZHL{7%4IX4rLRYxi$e;9oI?H7?xDyf?>~5q=V|afVOJ2q^l@B<3uG|RSVABUgGpH zptWV7zIuKaoxx zKp=!qknZ2Ze@~~>FX;P;gug)d@0_D@f5Z^MeFe{Y>GQ7`ihL%s&O3OQ>(D&9`1B5O zQbo$$o4oqVN{-~QA~b@|iUm9LC6Zn<8Hf3`7W^=2wkKoLXEs?E2{TjgPUJ1KqfLk= zMYiMj>_0H7=0pz_JPcDh1XZa8w}7S?Z`v!t?xoP?)z4YAYMXOh*jwf+mJQBYvfhWj zEQPwt*X=3zHizQ#=_iu834$2W3Rj3mStX?XCC9?tTe9<|R3>Qp`vUvbH7ZSd+5?3x z-14d(*jpuw!5nLxhwz4D+T0RAw#BS<6^gf0_oVxco_L%SF+h(eNn=;dQ&CcpbC5ho zsE#}BPvUo|tosh=>rTNmf1gZ_rpIN*? z*OntPt398<-{gr#_vIC*#))j&X)~!Ov2WRuAU=3>YJB;Evv#+&zf4{M$D?d&qyeir z8b5(bgyZ=V)xO~<&Xbqd1?^*=&cv!rD!dL17e6X|9nfinz)y;dvRE^GbVp#GQ!9I+ z>r2nBm$XpXJb!wj)D^9%u!bX3=IXf42n78wR63yV^0U1fXW@CPvz@H3z6{gbnX8A= z>p6BOB+M%1ww*sW?i@qHzoGzy*o~;LZyHa@_J*MHLQS?i)P?LO(q&5r^!?8Z=Nt8L zeJsBDt;RAnIO<&Y5`Co;+(z#N?=aLB;~xF@&e30j+P}j&!UO*Qc8>m6xJA>uM;**? zh$}jBi&6Sh|f=icb)zttK618!(Fr<&n-tuA~G)3iZlm?zH>4Qe~JZ}bZ}hMwK3 zT9l?&js2w2GZEC`XDxonf~QUKV)#&HE|y0PeRU&zcjOD~F5SCDUTnTEYo6crAhN<; zEiY(pOzb?eA!}+N>S%Bx*F}d0KF$+M`=qcz)A$NX%QJAnF|zWSYc$iQ(RZwykTs*S z;?HywaJj~T%1UO>;V7&DP@s>Y9iZL*{RAvXD)m( z@;iUsa@Ryeq-fq#Wk1KjmL}76JFc?pLUVl8t>@d9t`Hwc8U%WBD`gfRJ{hukVm3uj zBUoOqr&+d*ECBiD&PY=GA<2ewDOS|zqA$^wH;}rC3wxQSBOaz8ryIRJXU~6~0a;7B zAUI}x$>T^8@1YYYOKs=;icl8{U@UQgXQFvm+3kztyCY;u1nzL8J~}*C}iuF&9X4(Gzw43{j?%I?v)?^@MWW|(gb?qG1s=O=EF zq|(Oh^z+THOlr^K$-J=zqy31urijPs|4hYRd2* zO%El7A59NI0E1S4LKgyo03=SJ>puaXe}`EOpW?h6re1z9SC`q=SdL;#>yqj+x1~|# z1l2#zzf5gx;Q7oU(Y>jx#wW$mOE77GOqq;-8oiDi`pH|$#bcI_i2f^lqyx@qbB?cf z$>LIb;x>zQs_-Iqo5hkTtah=Zuct^@-m)~n?yFzB>Jz)mmmljJ#SrmSY2^XqhF?3c zna@4#(6aa_GLPt*NVIqx6B|5H8Gm0s?rO9D>&nuW3P)OT2-%&nVXKO3?Sn`o2zsodCtK;g4s=}x-7r^NsYB8mgRTwQMcA}I1J1zDz z8P$}JQ&CCbM_)tb55*-5U^*M=n9fGH@JXcqtK#~vVVr+_2ZYg81OTQVgagG$tlwJj zKiU}}5SDv-gOZuSytrk0mN&gjCH0%FhRe8h4~jBw@h*i~Hz|LRpKifN5R$G8Cz?fQ)g>+A?=s?xuqF@Ns&=HiM&ngeb&Y@ z<4psnKF&gC-(EL1zKtLcM>Z$cqcbn``8b2dB*#}PZ{0mG9WX1RZNB)}s|u9=_;P^- z*KBnX0u2cS&=CKBr=9;#I69c@uS~jA?qYh#008^tL}L7W;@`|hOylar-p9vAkpB2c z>`#Lb;5l_NmJUM~TX?VkYEOu;mecgp>ZRXT$6n#SU;RIG2ihixFQYD(D*O?CI>d%6_RUBu(F>3*Kw zWL2e!c3cBQU5eq?$7Or&318u>jVApbNG%cel=Y!*#g&6~Ig+@Q-4~`YJ8XmlFD*Gpaj~S-9ZS%;+ROu1t`>u%C^ArPP-qUc60CD(V~1*A zCz(}AoFXHxArjRMe&EDP%qbm>-Xu~=Br9})WvgoVAi+0yLXF#D`& admJDT86rCO;iVJrK^>9*f!Vbpy#E8`ah)Up literal 0 HcmV?d00001 diff --git a/Packages/com.unity.splines/.signature b/Packages/com.unity.splines/.signature new file mode 100644 index 00000000..c4b38abe --- /dev/null +++ b/Packages/com.unity.splines/.signature @@ -0,0 +1 @@ +{"timestamp":1757970422,"signature":"nMNeEND7In9XeSIqssS7g/agD+T9TkMOKwTl2kwp/0UhLtE6bBuuiqG8RStLM3qz4m5wRZLrGWs36ZTR1J2WFuUjC2as6ZSE7ItDsusnX5zhAQADU/ol5thot5fpwQm1G2nJUVUZOfHPCOc1uLIlruZ7bFwX9PwTZlDVk9GCNIe7N7cZ0CS5FdCyqQeuQjl99YC1PoHLifo+C1lPbqy0V1dEy6M9SacrAWSPWTmNaqLzfo46ircTPWS9zpx9dk3BQakBCHiF4cHFGIPpG5VTGpJqkR+SjsCbwjdPyI03BDOsZeCsUyIgvr2gSquBjDzARCqrzxKHNgLnb5WH/bnlrEIqslfMA0Ij/JdD1AYtycGlAjPd+Zb7EeF4utKbsYsv+E6jgkXVrwlCDH0JEgx2KhY1Iqy0E0k2rqPn8NJw41GV7G8KV63aVwK6pN8WcGZ+zi5oha+6UdySjnshSVAnBgBH/P4bxZVFpTMj5PqGuJLvDT7KQ8WeLm8ultfM5bIJ","publicKey":"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OERKWFgvblpmU1JWKytwbk9ySTRibG4KS0twelJlNW14OTc1SjhxZ1FvRktKT0NNRlpHdkJMR2MxSzZZaEIzOHJFODZCZzgzbUovWjBEYkVmQjBxZm13cgo2ZDVFUXFsd0E5Y3JZT1YyV1VpWXprSnBLNmJZNzRZNmM1TmpBcEFKeGNiaTFOaDlRVEhUcU44N0ZtMDF0R1ZwCjVNd1pXSWZuYVRUemEvTGZLelR5U0pka0tldEZMVGdkYXpMYlpzUEE2aHBSK0FJRTJhc0tLTi84UUk1N3UzU2cKL2xyMnZKS1IvU2l5eEN1Q20vQWJkYnJMbXk0WjlSdm1jMGdpclA4T0lLQWxBRWZ2TzV5Z2hSKy8vd1RpTFlzUQp1SllDM0V2UE16ZGdKUzdGR2FscnFLZzlPTCsxVzROY05yNWdveVdSUUJ0cktKaWlTZEJVWmVxb0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"} \ No newline at end of file diff --git a/Packages/com.unity.splines/CHANGELOG.md b/Packages/com.unity.splines/CHANGELOG.md new file mode 100644 index 00000000..9f8bdd28 --- /dev/null +++ b/Packages/com.unity.splines/CHANGELOG.md @@ -0,0 +1,553 @@ +# Changelog + +All notable changes to this package will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [2.8.2] - 2025-09-18 + +### Fixed + +- [DOCATT-4646], [DOCATT-5603], [DOCATT-7045], [DOCATT-5044], [DOCATT-6376], [DOCATT-6626] Clarified API documentation following user feedback. +- [SPLB-360] Fixed a bug when selecting the clear component option, resulting in out of range exception +- [SPLB-361] Fixed a bug where the spline would not animate with Scene/Domain reload disabled upon entering playmode +- [SPLB-356] Fixed a bug where a null reference exception would occur after baking a SplineInstantiate component and then pressing Undo. + +## [2.8.1] - 2025-03-28 + +### Fixed + +- [SPLB-345] Fixed a bug which was causing null reference exceptions during shutdown in IL2CPP builds. +- [SPLB-343] Fixed a bug where `JoinSplinesOnKnots` would throw a null reference exception when one of the splines was linked with another spline. +- [SPLB-341] Fixed a bug where changing the tangent mode on a knot on a prefab would not persist when entering play mode. + +### Changed + +- Cleaned up internal code to align with release standards. + +## [2.8.0] - 2025-03-13 + +### Fixed + +- [SPLB-322] Fixed a bug where `SplineExtrude` wouldn't update when multiple splines where modified. +- [SPLB-323] Fixed a bug where splines displayed in the Scene view would not match serialization changes. +- [SPLB-324] Re-added a dependency to the IMGUI module that was removed along with the UGUI package. +- [SPLB-332] Fixed a bug where `Element Inspector` fields get pushed and squashed. +- [SPLB-329] Fixed a bug where `SplineExtrude` could affect the mesh of other `SplineExtrude`. +- [SPLB-336] Fixed a bug where `SplineExtrude` would break with a range value of 0. +- [SPLB-333] Fixed a bug where `Create Spline` tool would sometimes throw an exception when the Esc or Enter keys were pressed. + +### Added + +- [SPLB-329] Added the ability to target a mesh in the library with a `SplineExtrude` component + +## [2.7.2] - 2024-11-08 + +### Fixed + +- [SPLB-315] Fixed a bug where the `DrawSplineTool` icon was missing in the Tools overlay. +- [STO-3434] Fixed a bug where the `DrawSplineTool` prevented the use of the View tool. +- [STO-3435] Fixed a bug where the `DrawSplineTool` did not display the Tool settings overlay. +- [SPLB-296] Fixed a bug where a log message appeared in the console when two knots are at the same position with 0-length tangents. +- [SPLB-304] Fixed a bug where an exception would be thrown when using `SplineInstantiate` with linear distance instantiate method and multiple splines. +- Fixed some failures related to the inline API documentation. +- [SPLB-302] Fixed a bug where an exception would be thrown when adding a knot to a closed spline from the Inspector. +- [SPLB-311] Fixed a bug where the `SplineAnimate` component would not function correctly with non-uniform scale transforms. +- Fixed compilation errors in builds. +- [SPLB-310] Fixed a bug where mesh extrude would not save when a change was applied to a mesh asset. +- [SPLB-303] Fixed a bug where spline section foldout labels (shape extrude, geometry, advanced) did not unfold the sections when clicked. +- [SPLB-294] Fixed a bug where adding new splines by using the `SplineContainer` inspector would dirty all open scenes. + +## [2.7.1] - 2024-10-17 + +### Added + +- [STO-3204] Added a **Create Spline** button to enter spline creation when you do not have the Spline tool context activated. +- New `SplineExtrude` and `SplineMesh` option enables new extrusion profiles, including `Circle`, `Square`, `Road`, and `Spline`. +- Added a section in the documentation for the `Source Spline Container` in the `SplineExtrude` component. + +### Fixed + +- [SPLB-292] Removed the dependency on the UGUI package. +- Removed the toggle to override the target spline in the `SplineExtrude` inspector. +- [SPLB-288] Fixed a bug where a prefab `SplineContainer` would unexpectedly restore splines deleted before entering and exiting playmode. +- [SPLB-284] Fixed a bug that prevented baking instances of multiple `SplineInstantiate` components when multi-selecting. +- [SPLB-277] Fixed a bug where instantiating a prefab with `SplineAnimate` component would throw messages in the console. +- [SPLB-279] Fixed a bug where closing a Spline would not update the auto-smooth knots at the extremities. + +## [2.6.1] - 2024-05-23 + +### Fixed + +- [SPLB-275] Fixed a bug where the `SplineContainer` component would throw warning when entering playmode. +- [SPLB-266] Fixed a bug where instantiating a `SplineExtrude` component at runtime would throw errors. +- [SPLB-269] Fixed a bug where instantiating a `SplineAnimate` component at runtime would throw errors. +- [SPLB-260] Fixed a bug where playing a `SplineAnimate` from a start method would not work. +- [SPLB-267] Fixed a bug where undoing a spline insertion in a container would throw errors from the `SplineInstantiate` component. +- [SPLB-261] Fixed a bug where the knot placement tool would not work when multiple scene views were opened. +- [SPLB-253] Fixed a bug where using the knot placement tool in 2D mode would not work if the grids are turned off. +- [SPLB-258] Fixed a bug where destroying a component would throw errors in the console. + +## [2.6.0] - 2024-04-15 + +### Added + +- Added new APIs that enable users to directly provide a collection of `float3` knot positions to a `Spline` constructor, or to the new `Add`, `AddRange`, `Insert`, and `InsertRange` methods, instead of using `BezierKnots`. +- Added an event to the `SplineAnimate` component that is triggered when the animation or loop is completed. + +### Changed + +- Changed supported version in the documentation dropdown selector to 2022.3 and later. + +### Fixed + +- [SPLB-246] Fixed performance and garbage collection (GC) memory allocation issues when evaluating splines using `SplineContainer` API. +- [STO-3176] Fixed an issue where `FitSplineToPoints` utility would not fit splines correctly. +- [SPLB-249] Fixed a bug where setting a spline game object position was overridden by the knot placement tool. +- Fixed a bug where using the knot placement tool on scaled objects would not create the correct tangents. +- Fixed a bug where changing the scale of a spline game object would not update the scene view handles. +- [SPLB-239] Fixed a bug where reverting overrides of a spline prefab instance would not properly update its visuals. +- [SPLB-238] Fixed a bug where `SplineAnimate` component would continuously output messages to the Console when in playmode and animated object was selected. +- [SPLB-245] Fixed a bug where `SplineAnimate` component would rotate the animated object on playmode exit. + +## [2.5.2] - 2023-12-22 + +### Added + +- [SPLB-222] Added safety checks to spline changed events. + +### Changed + +- [SPLB-233] Removed transform handles while dragging a knot using direct manipulation. +- [SPLB-234] Removed unnecessary spline metadata which was saved on disk. + +### Fixed + +- [SPLB-230] Fixed a bug where modifying the tangent mode on the last knot would change the spline shape unpredictably. +- [SPLB-225] Fixed a bug where closing a Spline with the `Draw Splines Tool` had inconsistent behaviour. +- [SPLB-236] Fixed a bug where the spline instantiate inspector was throwing an exception when the selection contained objects without that component. +- [SPLB-235] Fixed a bug where hovering a knot was create highlights when dragging tangents. +- [SPLB-234] Fixed a bug where it was impossible to add a knot on the latest added knot. +- [SPLB-214] Fixed an exception that would when adding a spline via the inspector if no other spline exists. +- [SPLB-226] Fixed broken preview when adding knots to a closed spline + +## [2.5.1] - 2023-10-17 + +### Fixed + +- [SPLB-208] Fixed a bug where `SplineToolContext` would attempt to draw empty Splines and flood the console with errors. + +## [2.5.0] - 2023-10-16 + +### Added + +- Exposed public API for `SplineInstantiate.Seed`. + +### Fixed + +- [SPLB-201] Fixed error messages showing in edit mode with spline components. +- [SPLB-203] Fixed a bug where baking `SplineInstantiate` instances broke prefab connections. +- [SPLB-196] Fixed a bug where the `Random` state was not restored after an update of the instances in `SplineInstantiate`. +- Fixed a bug where the `SplineCacheUtility` would send null reference exceptions. +- [SPLB-183] Fixed a bug where duplicating the `SplineExtrude` component was not updating the mesh asset reference. +- [SPLB-178] Fixed a bug where linking knots would not trigger a `Spline.changed` event. +- [SPLB-185] Fixed a bug where the Up vector evaluation would return NaN values when normals and curve tangents are parallel. + +### Changed + +- [SPLB-187] Fixed a bug where `Spline.EvaluatePosition` was allocating memory when called. +- [SPLB-181] Fixed a bug where the Auto tangent mode computed incorrect knot rotations. +- Changed the `SplineComponent` display name in the Inspector to `Spline Container` as a response to user feedback. + +## [2.4.0] - 2023-07-26 + +### Added + +- Exposed public APIs for `SplineUtility.ReverseFlow`, `SplineUtility.JoinSplinesOnKnots`, and `SplineUtility.SplitSplineOnKnot`. + +### Changed + +- For Editor versions of 2023.2 or newer, added clipboard operations for Splines to the Scene view context menu. +- Changed `Splines/Cycle Active Spline` shortcut to Shift-S to remove a conflict with Unity default shortcuts. +- [SPLB-163] Improved performance of spline handles by caching spline data. +- [SPLB-167] Changed the evaluation of up vectors to use a cache instead of re-evaluate the values on every single request. +- In Editor versions of 2023.2 or newer, moved the following actions from the Element Inspector to the Scene view context menu: Link, Unlink, Split, Join, and Reverse Spline Flow. + +### Fixed + +- [SPLB-176] Fixed a regression where the up vector would not evaluate correctly for some curves. +- Fixed the setter for SplineAnimate.Normalized time to handle ping-pong direction correctly when set. +- Fixed a bug where setting the time value to 0 after reaching the end of the spline animation was not resetting the object position. +- [SPLB-169] Fixed a bug where `CurveUtility.GetNearestPoint` would return incorrect values for the interpolation. + +## [2.3.0] - 2023-05-31 + +### Added + +- Exposed public APIs for `SplineTool` and `SplineHandles`. +- Added a method to *bake* SplineInstantiate objects in the scene so the users can modify the resulting GameObjects. + +### Fixed + +- [SPLB-165] Fixed a bug that prevented actions from being retained with prefab instances that contained splines when entering playmode. +- [SPLB-162] Fixed a bug where the start offset in `SplineAnimate` did not work in Play mode. +- [SPLB-152] Fixed objects created from `SplineInstantiate` not inheriting static flags from parent `GameObject`. +- [SPLB-160] Fixed potential 'look rotation vector is zero' in SplineInstantiate. +- [SPLB-156] Fixed possible null reference exception when accessing curve length. + +## [2.2.1] - 2023-04-21 + +### Added + +- [SPLB-100] Added a **Resolution** setting for spline meshes in Splines preference. + +### Changed + +- [SPLB-100] Improved `SplineMeshHandles` rendering. + +### Fixed + +- Fixed a bug where spline selection would be incorrect after a spline was deleted. +- [SPLB-146] Fixed a bug that prevented actions from being undone with prefab instances that contained splines . +- [SPLB-148] Fixed a bug in the `LoftRoadBehaviour` component where Undo calls prevented the project from building. + +### Changed + +- Changed `Knot Placement` tool behaviour regarding selection. Element selection is now empty when you exit the tool. + +## [2.2.0] - 2023-03-22 + +### Added + +- [SPLB-72] Added a public version of `SplineDataHandles.DataPointHandles` which requires an additional parameter, `splineID`. +- [SPLB-72] Added the `SplineContainer.SplineAdded`, `SplineContainer.SplineRemoved` and `SplineContainer.SplineReordered` public events and removed those same events from `ISplineContainer` +- [SPLB-72] Added the `SplineUtility.ReorderSpline` public method. +- [SPLB-72] Added an example to the **Loft Road** sample that supports spline data for multiple splines. +- Improved UI for editing points in the Inspector. +- Added preference to disable tangent dragging feature in `Knot Placement` tool. +- Added `ISplineContainer.AddSpline(Spline)` function overload. +- Added new functions on `Spline` to get and set `SplineData`. +- Added new `EmbeddedSplineData` type to easily create and reference `SplineData` stored on arbitrary `Spline` objects. + +### Changed + +- [SPLB-127] Changes made to a spline in the Inspector no longer invoke the `Spline.Changed` event with the `SplineModification.Default` type. The `Spline.Changed` event is still invoked, but with specific modification types like `SplineModification.KnotModified`. +- [SPLB-118] Changed the documentation of `SplineMath.PointLineNearestPoint` and `SplineMath.RayLineNearestPoint` to explain the returned values more precisely. +- [SPLB-96] Changed the default tension of tangents in **Auto** mode so they are smoother. **Auto** mode is now closer to the Catmull-Rom behavior of Splines 1.0. +- [SPLB-72] Removed the `WidthSplineData` and `MultipleRoadBehaviour` components from the samples. +- Reduced heap allocations when modifying Spline properties. +- [SPLB-92] Modified the Inspector to use `SplineModification.KnotRemoved` events to remove knots and pass the index for each removed knot. +- [SPLB-92] Modified the `Spline.SetTangentMode` and `Spline.SetAutoSmoothTension` methods to invoke `SplineModification.KnotModified` events for each modified knot and pass the index. +- Increased the threshold for tangent dragging when placing knots with the `Knot Placement` tool. + +### Fixed + +- [SPLB-141] Fixed a bug where `SplineExtrude` component would overwrite existing Mesh assets. +- [SPLB-129] Fixed a bug where `CurveUtility.EvaluateUpVector` caused burst errors. +- [SPLB-138] Fixed a bug where `SplineJobs.EvaluatePositionTangentNormal` returned incorrect values. +- [SPLB-136] Fixed a bug where undoing actions on a spline was not marking the spline as dirty. +- [SPLB-123] Fixed an inconsistency between inserting a `BezierKnot` using Editor tools and runtime API. +- [SPLB-130] Fixed a bug that would crash the Editor if the `SplineInstantiate` component had its parent GameObject in the list of items to instantiate. +- [SPLB-90] Fixed an issue where `Spline.SetKnotNoNotify` triggered change callbacks. +- [SPLB-77] Fixed a null reference exception when spline animate didn't have a spline referenced. +- [SPLB-125] Fixed issue where the spline would have different state during the `Spline.Changed` callback depending if it was modified using the API or inspector. +- [SPLB-74] Fixed a bug that caused an error when knots were deleted from the Inspector. +- [SPLB-121] Fixed a bug where spline data changes done using the Inspector would not undo correctly. +- [SPLB-92] Fixed an issue where adding knot using the inspector would trigger `SplineModification.KnotInserted` event twice. +- [SPLB-107] Fixed a bug where a duplicates of a spline with the Spline Instantiate component would have visible child GameObjects in the Hierarchy window. +- [SPLB-65] Fixed an issue where it wasn't possible to add a knot to a closed spline that is empty or contains a single knot. +- [SPLB-104] Fixed an issue where duplicating a spline using the Inspector would not copy knot link data. +- [SPLB-82] Fixed an issue where it would not be possible to undo adding a knot from the Inspector. +- [SPLB-84] Fixed an issue where the obsolete Spline Edit Mode would show in the Debug Inspector. +- [SPLB-135] Fixed an issue where the Auto Smooth tangent mode would not smooth a spline's curves correctly. +- [SPLB-104] Fixed an issue where shared knots would lose selection when a spline is selected using the Inspector. +- [SPLB-115] Fixed an issue where using the Width tool on MacOS (Metal) would render visual artifacts outside of the Scene view. +- [SPLB-98] Fixed an issue where `LoftRoadBehaviour` would create incorrect mesh geometry normals. +- [STO-2791] Fixed an issue where spline data's reorderable list would break if the data was not the field of a `MonoBehaviour`. +- [SPLB-86] Fixed a bug that caused a spline to change its shape when **Reverse Spline Flow** action was used. +- [SPLB-103] Fixed an issue where the spline tool settings' Visuals popup would display toggle checkboxes on the wrong size and be clipped in some editor versions. +- [SPLB-87] Fixed an issue where the cached Spline length could be incorrect after an undo action. +- Fixed an issue where modifying knot values or order in the Inspector could affect unassociated knot data. +- Fixed use of obsolete `Objects.FindObjectsOfType` API in Unity 2023.1 and newer. +- Fixed incorrect icon import settings. +- Fixed a bug that would prevent Spline Instantiate from instantiating when it was loaded from an addressable build in the Editor. +- Fixed a bug where calling `SplineDataHandles.DataPointHandles` without a `splineID` argument would crash. +- Fixed a bug that would cause `SplineData` handles to interfere with scene navigation. +- Fixed SplineData handles not setting `GUI.changed` correctly. +- Fixed an issue where `SplineSelection` errors could put the Scene view into an unrecoverable broken state. +- Added a new property drawer for `int` interpreted as a spline index, `SplineIndexAttribute`. +- Fixed a bug where modifying and undoing changes to `Spline` values in the Inspector resulted in an incorrect `Spline` length calculation. +- Added `SplineData.OnSplineModified` function to attempt to preserve knot indices when knots are inserted or removed. This is called automatically for all embedded `SplineData` collections. + +## [2.1.0] - 2022-10-18 + +### Added + +### Changed + +### Fixed + +- [STO-2745] Fixed an issue where the Speed Tilt tool's arrow handle cap would flicker when the View tool toggled on or off. +- [STO-2744] Fixed a bug where tangents would have the wrong orientation. + +## [2.1.0-pre.1] - 2022-10-12 + +### Added + +- New `SplineUtility.EvaluateNurbs` function to evaluate positions on NURBS curves. +- New `SplineUtility.FitSplineToPoints` function to fit a spline to a provided set of curve points. +- Added a new public static class, `InterpolatorUtility`, to improve the discoverability of `IInterpolator` implementations. +- Added the functionality to offset the starting position of a `SplineAnimate` component's animation. +- Added copy, paste, and duplicate support to Spline tools. +- Exposed API to draw spline and curve handles. +- Added settings to generate a 3D mesh around spline handles to better visualize depth. +- Added the functionality to disable specific Spline tool handles. +- Added the functionality to tweak knot position without being in the position tool. +- Added spline index to the Element Inspector when a spline element is selected. +- Updated public API documentation. +- Updated built-in Spline components to support spline containers with multiple splines. +- New `SplineUtility.ReducePoints` function to remove redundant points on a line and still retain the original shape. +- New `Spline.SetAutoSmoothTangentTension` function to specify the tension used when tangents are calculated. +- Added `Spline Filter` to the Spline tools settings. +- Added spline selection from the Spline Inspector. +- Added support to show knot indices in the Scene View. +- New `Paint` example shows how to create a spline from a list of points. +- Updated the `SplineUtility.GetAutoSmoothTangent` function to use centripetal parameterization to calculate the tangents in **Auto** tangent mode. +- New `SplineUtility.GetAutoSmoothTangent` function takes the current knot position and then uses centripetal parameterization to calculate the tangents in **Auto** tangent mode. +- Added new built-in Spline shapes: Rounded Square, Polygon, Helix, and Star. +- Added the functionality to to delete tangents. +- Removed the disc that displayed around selected knots. +- Added a disc that displays when a user has the Tweak tool enabled and hovers over a tangent. +- Added transparency to the disc that displays when a knot or tangent is hovered on if the disc occludes an object in the scene. +- Reduced the transparency of the Tweak tool handles when they occlude an object in the scene. +- New `EditorSplineUtility.SetKnotPlacementTool` function to set the active context to `SplineToolContext` and the active tool to `KnotPlacementTool`. + +### Changed + +- [STO-2666] Disabled the Visual dropdown button when using `KnotPlacementTool`. +- Modified spline element handles to use `Element Color`. +- [STO-2708] Modified spline deletion to remove empty splines. +- [STO-2682] Unified `Draw Splines Tool` naming across menus and documentation. +- [STO-2681] Attenuated the color of the tangents and the curve highlights when they are behind objects. +- [STO-2700] Modified Spline Instantiate so it no longer serializes instances in the Scene or prefabs. +- [STO-2682] Unified `Draw Splines Tool` naming across menus and docs. +- [STO-2728] Changed the label of the `SplineAnimate` component's `World` alignment mode to `World Space` in the Inspector. +- Modified the `Draw Splines Tool` to clear any Spline element selection when it activates. +- [STO-2490] Made active element selection consistent with standard Editor behavior for GameObjects. Now you can hold Shift and click a knot to set it as the active element. +- Spline element handles now use the `Element Selection` and `Element Preselection` colors. +- Changed tangent's shapes to diamonds. +- Modified the `Knot Placement Tool` to have a live preview for segments with auto-smoothed knots. +- Dependency on Unity Physics Module is now optional. +- Modified `SplinePath` to support the `Closed` property of Splines. +- Removed and merged redundant Sample scenes. +- Reduced the size of the flow indicator handle. +- Changed default colors and thickness for spline elements and curves. +- Improved the line visibility of handles and segments. +- Changed Burst from required dependency to optional. +- Burst compile `SplineJobs.EvaluationPosition` when Burst package is available. + +### Fixed + +- [STO-2746] Fixed an issue where it was impossible to delete knots on mac. +- [STO-2743] Fixed an issue where a curve's highlight would flicker when hovering near a knot. +- [STO-2729] Fixed an issue where reordering knots would break knot links until moved. +- [STO-2730] Fixed the curve highlight color when using the Tweak tool. +- [STO-2693] Fixed a bug that prevented users from adding and reordering knots in the Inspector when the spline comes from a class that inherits from `ISplineContainer`. +- [STO-2725] Fixed a bug where knots, discs, and the normal line of knots would use incorrect colors. +- [STO-2726] Fixed a bug where knots handles were drawn under curves handles. +- [STO-2727] Corrected a typo in the Loop Mode of the `SplineAnimate`. +- [STO-2653] Fixed a bug where the Tweak tool's guide plane would flicker when drawn directly on a surface. +- [STO-2731] Fixed View Tool not working when Spline Context was active. +- [STO-2700] Fixed spline instantiate having a delay before regenerating the instances. +- [STO-2679] Fixed the segmentation of the curve highlight. +- [STO-2665] Fixed sample scenes not rendering correctly when URP or HDRP was used. +- [STO-2702] Removed the **Dist** label in the Inspector when the `SplineInstantiate` component is set to `Exact`. +- [STO-2656] Fixed a bug where hovering on linked knots would display discs on each linked knot. +- [STO-2686] Fixed an issue where inserting a knot on the closing curve would result in other knots moving around. +- [STO-2685] Fixed a bug where `LoftRoadBehavior `would throw exceptions with knots that had linear tangents. +- [STO-2657] Fixed a bug where spline gizmos would appear at unexpected moments. +- [STO-2655] Fixed a bug that caused knots to highlight with the wrong color. +- [STO-2687] Fixed an error that would occur when deleting the last knot of a spline. +- [STO-2684] Fixed a bug that prevented Select All from selecting elements. +- [STO-2680] Fixed a bug where `SplineMesh.Extrude` would create twisted mesh geometry. +- [STO-2701] Fixed a bug where `LoftRoadBehavior` would either throw an exception or extrude incorrectly when the spline was in Linear tangent mode or if it was shorter than 1 unit length. +- [STO-2705] Fixed a bug where `SplineInstantiate` was not instantiating correctly when the instantiation method was set to `Method.InstanceCount`. +- [STO-2668] Fixed a bug where Spline element inspector values would not update when a knot is modified. +- [STO-2706] Fixed a bug where selecting a knot from the inspector was desynchronizing the tool selection. +- [STO-2696] Fixed a bug where clearing knot selection was not updating in the inspector. +- [STO-2689] Fixed the behavior of the spline inspector selection when clicking on a selected element. +- [STO-2688] Fixed a delay in the scene view update after changing selection from the spline inspector. +- [STO-2669] Fixed a bug where modifying a spline in the Inspector would not invoke the `Changed` callback. +- [STO-2695] Fixed a bug that would throw an exception when the `SplineAnimate` component was destroyed. +- [STO-2658] Fixed a bug that would delay the color change when you hover over a segment. +- [STO-2692] Fixed an issue where deleting a spline would result in errors. +- [STO-2716] Added missing tooltips to the Element Inspector. +- [STO-2636] Fixed an issue that prevented spline framing if the active tool context was not set to Spline. +- [STO-2714] Fixed transformation and direct manipulation tools not working correctly when spline has non-uniform scale. +- [STO-2698] Fixed a bug that could cause a knot link to desync if a linked knot was modified in the Inspector. +- [SPLB-54] Fixed a bug where flow arrows and curve highlights would not be centered on a spline's segments between knots. +- [SPLB-44] Fixed a bug where tangent selection would remain after changing to a tangent mode without modifiable tangents. +- [STO-2632] Fixed Spline Selection Undo when selecting a single element. +- Fixed a bug where the spline inspector was not working if the `Spline` object was not stored in a ISplineContainer. +- [SPLB-40] Fixed a bug where a tangent's Magnitude field in the `Element Inspector` created NaN values. +- [SPLB-39] Fixed a bug where knots from separate splines would link to the wrong knot. +- [SPLB-38] Fixed incorrect auto-smooth knots on reversed splines. +- Fixed a bug where the SplineContainer reorderable list broke the LinkKnots collection. +- Fixed a bug that caused the Inspector to display incorrect spline indexes. +- Fixed spline selection intercepting scene view navigation shortcuts. +- Fixed a bug where setting the Spline Instantiate component's instantiation items with the Inspector would have no effect. +- Fixed a potential exception that occurred when opening scenes with splines created in the 1.0 version of this package. +- Fixed tangent and knot handles incorrectly highlighting while a tool is engaged. +- Fixed a bug where deleting some element selections would result in an exception being thrown. +- Fixed a bug where undoing after deleting a selection would not re-select the restored elements. +- [STO-2690] Fixed a bug that prevented data points from being added to a spline when the spline was clicked on. +- [STO-2691] Fixed a bug where moving a data point along a spline behaved incorrectly. +- Fixed compile errors in sample scenes when building player. +- Added an ellipsis to the Draw Spline Tool menu item label. +- Fixed `Spline Tool Context` not working with `ISplineContainer` implementations that define a valid `KnotCollection`. + +## [2.0.0-pre.2] - 2022-05-11 + +### Added + +- Added the ability to edit multiple spline elements in the element inspector. +- Added functionality to join knots from different splines. +- Added functionality to reverse the flow of a spline. +- Added `SplinePath`, `SplineSlice`, and `SplineRange` types. These types enable interpolation and evaluation of partial or complete sections of discrete splines. + +### Changed + +- Modified rounding to be based on camera distance. +- [STO-2704] Changed `SplineUtility.GetBounds` to account for tangent positions when calculating bounds. +- Updated the design of the tangent mode fields in the Element Inspector. +- Added a dropdown menu to select tangent modes to the Element Inspector. +- Updated the `Draw Splines Tool` to display only one tangent when a new knot is created. +- Simplified tangents in the `Draw Splines Tool` by removing the interactable handle . +- Renamed `Knot Placement Tool` to `Draw Splines Tool`. +- Modified the `Draw Splines Tool` to account for multiple splines. + +### Fixed + +- Fixed SplineInspector knot removal not keeping metadata consistent (KnotLinks). +- Fixed an issue that caused auto-smoothed tangents to show in the `Draw Splines Tool` and be selectable by rect selection. +- Added `ReadOnly` to knot's and length's `NativeArray` to fix IndexOutOfRangeException on `NativeSpline`. +- Fixed tangents when closing the spline to keep user-defined values. +- Fixed index error in the `Spline.SendSizeChangeEvent` method. +- Fixed a case where inserting a knot would not update adjacent knots with "auto-smooth" tangent mode. + +## [2.0.0-pre.1] - 2022-04-19 + +### Added + +- Added structs and utility methods that use the [Job System](https://docs.unity3d.com/Manual/JobSystem.html) to evaluate splines. + +### Changed + +- Separated tangent and bezier modes in the Element Inspector. +- Added a feature to split splines at a knot from the Element Inspector. +- Added tool settings to change the default knot type. +- Added ON icons for tangent modes. +- Moved Spline creation menu items to `GameObject/Spline`. +- Modified the Spline Inspector to be reactive to spline element selections in the Scene View. +- New icons set for Spline-related items. +- Hiding knot handles if the EditorTool is not a SplineTool +- Tweaked the spline property drawer to make it a bit more clean. +- Changed the knot rotation property in the inspector to a Vector3Field instead of a QuaternionField. +- Added a new editor API to change the tangent mode of knots. +- Deprecated `Spline.EditType`. Tangent modes are now stored per knot. Use `Spline.GetTangentMode` and `Spline.SetTangentMode` to get and set tangent modes. +- Added ability to link and unlink knots using Element Inspector. + +### Fixed + +- [1411976] Fixed undo crash in SplineInstantiate component. +- Fixed scale offset in SplineInstantiate component. +- [1410919] Fixed SplineData Inspector PathIndexUnit when updating unit. +- Fixed issues with spline editor tools changes sometimes being overwritten +- Fixed `SplineUtility.Evaluate` incorrectly evaluating the up vector. +- [1403359] Fixed issue where `SplineExtrude` component would not update mesh after an undo operation. +- [1403386] Fixing SplineData Inspector triggering to SplineData.changed events. +- Fixing console InvalidOperationException when creating a Spline with a locked Inspector. +- [1384457] Fix for an exception being sometimes thrown when drawing a spline and rotating the scene view. +- [1384448] Fixed incorrect Rect Selection when using Shift or CTRL/CMD modifiers. +- [1413605] Fixed Linear to Bezier Edit Type conversion incorrectly leaving tangents set to zero length. +- [1413603] Spline creation menu items now respect the preference to place new objects at world origin. +- `SplineFactory.CreateSquare` now respects the `radius` argument. + +## [1.0.0] - 2022-02-25 + +### Changed + +- New icons set for Spline-related items. +- `SplineContainer` inspector is now more user-friendly. +- Fixed issue where Spline Inspector fields would not accept negative values. +- Fixed issue where the X shortcut would only cycle through World/Local handle orientations and ignore Parent/Element. +- Fixed samples compatibility issues on 2021.2. +- Spline Inspector no longer shows 2 editable tangent fields for Knots that only have one tangent. +- Fixed poor performance when manipulating long continuous tangents. +- `SplineUtility.ConvertIndexUnit` now wraps when returning normalized interpolations. +- Fixed issue where Knot rotation would not properly align to the surface the Knot is placed on. +- Fixed Spline length serialization issue that would result in incorrect Spline evaluations and length calculations. +- Updated Knot and Tangent handle design. + +## [1.0.0-pre.9] - 2022-01-26 + +### Changed + +- Adding new API to interact with SplineData Handles +- Adding a `SplineInstantiate` component and updating associated samples. +- Added a `SplineAnimate` component and sample scene. + +### Fixed + +- [1395734] Fixing SplineUtility errors with Spline made of 1 knot. +- Fixing Tangent Out when switching from Broken Tangents to Continuous Tangents Mode. +- Fixing Preview Curve for Linear and Catcall Rom when Closing Spline. + +## [1.0.0-pre.8] - 2021-12-21 + +### Changed + +- Added a `SplineExtrude` component and an accompanying ExtrudeSpline sample scene. +- When using a spline transform tool, CTRL/CMD + A now selects all spline elements. +- Improving Spline Inspector overlay. +- `SplineUtility.CalculateLength` now accepts `T : ISpline` instead of `Spline`. + +### Fixed + +- [1384451] Fixing knot handles size being too large. +- [1386704] Fixing SplineData Inspector not being displayed. +- Fixing wrong Spline length when editing spline using the inspector. +- [1384455] Fix single element selections breaking the undo stack. +- [1384448] Fix for CTRL/CMD + Drag not performing a multi selection. +- [1384457] Fix for an exception being sometimes thrown when drawing a spline and rotating the scene view. +- [1384520] Fixing stack overflow when entering playmode. +- Fixing SplineData conversion being wrong with KnotIndex. + +## [1.0.0-pre.7] - 2021-11-17 + +### Changed + +- Disable unstable GC alloc tests. + +## [1.0.0-pre.6] - 2021-11-15 + +### Changed + +- Replace references to 'time' with 'interpolation ratio' or 't'. +- Move distance to interpolation caching and lookup methods to `CurveUtility`, and document their use. +- Fix compile errors when opened in Unity 2021.2. +- Removed `Spline.ToNativeSpline`, use `new NativeSpline(ISpline)` instead. +- Removed `Spline.ToNativeArray`. + +### Fixed + +- Fixed issue where hidden start/end knot tangents would be selectable. +- Fixed active tangentOut incorrectly mirroring against tangentIn when changing tangent mode via shortcut. +- Fixed Knot Placement tool preview curve disappearing when cursor hovers over first knot. +- Fixed issue where knot would not align to tangents when switching from broken to mirrored or continuous modes. +- Fixed issue where hovering first knot while placing tangents would hide the last placed knot, its tangents and the preview curve. + +## [1.0.0-pre.5] - 2021-11-02 + +- Initial release diff --git a/Packages/com.unity.splines/CHANGELOG.md.meta b/Packages/com.unity.splines/CHANGELOG.md.meta new file mode 100644 index 00000000..0263407a --- /dev/null +++ b/Packages/com.unity.splines/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 06ba237cdfbe2264f89158773bd6268b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.splines/Editor.meta b/Packages/com.unity.splines/Editor.meta new file mode 100644 index 00000000..e30aa035 --- /dev/null +++ b/Packages/com.unity.splines/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7be002d6127770a45b33b37bd3ba98ac +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.splines/Editor/AssemblyInfo.cs b/Packages/com.unity.splines/Editor/AssemblyInfo.cs new file mode 100644 index 00000000..2f03a661 --- /dev/null +++ b/Packages/com.unity.splines/Editor/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Unity.Splines.Editor.Tests")] +[assembly: InternalsVisibleTo("Unity.Splines.Editor.Tests")] +[assembly: InternalsVisibleTo("Unity.Splines.Editor.Debug")] diff --git a/Packages/com.unity.splines/Editor/AssemblyInfo.cs.meta b/Packages/com.unity.splines/Editor/AssemblyInfo.cs.meta new file mode 100644 index 00000000..e5312477 --- /dev/null +++ b/Packages/com.unity.splines/Editor/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c854ca5f1d7eed04aa92565d35431e96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.splines/Editor/Components.meta b/Packages/com.unity.splines/Editor/Components.meta new file mode 100644 index 00000000..71cea24a --- /dev/null +++ b/Packages/com.unity.splines/Editor/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e88477d7eedfb4ca8b5d8912575efa76 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.splines/Editor/Components/SplineAnimateEditor.cs b/Packages/com.unity.splines/Editor/Components/SplineAnimateEditor.cs new file mode 100644 index 00000000..e927642d --- /dev/null +++ b/Packages/com.unity.splines/Editor/Components/SplineAnimateEditor.cs @@ -0,0 +1,355 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine.Splines; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +namespace UnityEditor.Splines +{ + [CustomEditor(typeof(SplineAnimate))] + [CanEditMultipleObjects] + class SplineAnimateEditor : UnityEditor.Editor + { + List m_Roots = new (); + List m_ProgressSliders = new (); + List m_ElapsedTimeFields = new (); + List m_ObjectForwardFields = new (); + List m_ObjectUpFields = new (); + + SerializedProperty m_MethodProperty; + SerializedProperty m_ObjectForwardProperty; + SerializedProperty m_ObjectUpProperty; + SerializedProperty m_StartOffsetProperty; + SerializedObject m_TransformSO; + + SplineAnimate m_SplineAnimate; + + const string k_UxmlPath = "Packages/com.unity.splines/Editor/Editor Resources/UI/UXML/splineanimate-inspector.uxml"; + static VisualTreeAsset s_TreeAsset; + static StyleSheet s_ThemeStyleSheet; + + SplineAnimate[] m_Components; + + void OnEnable() + { + m_SplineAnimate = target as SplineAnimate; + if (m_SplineAnimate == null) + return; + + m_SplineAnimate.Updated += OnSplineAnimateUpdated; + + try { + m_MethodProperty = serializedObject.FindProperty("m_Method"); + m_ObjectForwardProperty = serializedObject.FindProperty("m_ObjectForwardAxis"); + m_ObjectUpProperty = serializedObject.FindProperty("m_ObjectUpAxis"); + m_StartOffsetProperty = serializedObject.FindProperty("m_StartOffset"); + } + catch (Exception) + { + return; + } + + m_TransformSO = new SerializedObject(m_SplineAnimate.transform); + m_Components = targets.Select(x => x as SplineAnimate).Where(y => y != null).ToArray(); + + foreach (var animate in m_Components) + { + if (animate.Container != null) + animate.RecalculateAnimationParameters(); + } + + m_Roots.Clear(); + m_ObjectForwardFields.Clear(); + m_ObjectUpFields.Clear(); + m_ProgressSliders.Clear(); + m_ElapsedTimeFields.Clear(); + + EditorApplication.update += OnEditorUpdate; + Spline.Changed += OnSplineChange; + SplineContainer.SplineAdded += OnContainerSplineSetModified; + SplineContainer.SplineRemoved += OnContainerSplineSetModified; + } + + void OnDisable() + { + if(m_SplineAnimate != null) + m_SplineAnimate.Updated -= OnSplineAnimateUpdated; + + if (!EditorApplication.isPlaying && !EditorApplication.isPlayingOrWillChangePlaymode) + { + if (m_Components != null) + { + foreach (var animate in m_Components) + { + if (animate != null && animate.Container != null) + { + animate.RecalculateAnimationParameters(); + animate.Restart(false); + } + } + } + } + + EditorApplication.update -= OnEditorUpdate; + Spline.Changed -= OnSplineChange; + SplineContainer.SplineAdded -= OnContainerSplineSetModified; + SplineContainer.SplineRemoved -= OnContainerSplineSetModified; + } + + void OnEditorUpdate() + { + if (!EditorApplication.isPlaying) + { + if (m_SplineAnimate.Container != null && m_SplineAnimate.IsPlaying) + { + m_SplineAnimate.Update(); + RefreshProgressFields(); + } + } + else if(m_SplineAnimate.IsPlaying) + RefreshProgressFields(); + } + + void OnSplineChange(Spline spline, int knotIndex, SplineModification modificationType) + { + if (EditorApplication.isPlayingOrWillChangePlaymode) + return; + + foreach (var animate in m_Components) + { + if (animate.Container != null && animate.Container.Splines.Contains(spline)) + animate.RecalculateAnimationParameters(); + } + } + + void OnContainerSplineSetModified(SplineContainer container, int spline) + { + if (EditorApplication.isPlayingOrWillChangePlaymode) + return; + + foreach (var animate in m_Components) + { + if (animate.Container == container) + animate.RecalculateAnimationParameters(); + } + } + + public override VisualElement CreateInspectorGUI() + { + var root = new VisualElement(); + + if (s_TreeAsset == null) + s_TreeAsset = (VisualTreeAsset)AssetDatabase.LoadAssetAtPath(k_UxmlPath, typeof(VisualTreeAsset)); + s_TreeAsset.CloneTree(root); + + if (s_ThemeStyleSheet == null) + s_ThemeStyleSheet = AssetDatabase.LoadAssetAtPath($"Packages/com.unity.splines/Editor/Stylesheets/SplineAnimateInspector{(EditorGUIUtility.isProSkin ? "Dark" : "Light")}.uss"); + + root.styleSheets.Add(s_ThemeStyleSheet); + + var methodField = root.Q("method"); + methodField.RegisterValueChangeCallback((_) => { RefreshMethodParamFields((SplineAnimate.Method)m_MethodProperty.enumValueIndex); }); + RefreshMethodParamFields((SplineAnimate.Method)m_MethodProperty.enumValueIndex); + + var objectForwardField = root.Q("object-forward"); + objectForwardField.RegisterValueChangedCallback((evt) => OnObjectAxisFieldChange(evt, m_ObjectForwardProperty, m_ObjectUpProperty)); + + var objectUpField = root.Q("object-up"); + objectUpField.RegisterValueChangedCallback((evt) => OnObjectAxisFieldChange(evt, m_ObjectUpProperty, m_ObjectForwardProperty)); + + var playButton = root.Q