unity-mcp/MCPForUnity/Editor/Helpers
dsarno 552b2d3aae
Harden `manage_scriptable_object` Tool (#522)
* feat(manage_scriptable_object): harden tool with path normalization, auto-resize, bulk mapping

Phase 1: Path Syntax & Auto-Resizing
- Add NormalizePropertyPath() to convert field[index] to Array.data format
- Add EnsureArrayCapacity() to auto-grow arrays when targeting out-of-bounds indices

Phase 2: Consolidation
- Replace duplicate TryGet* helpers with ParamCoercion/VectorParsing shared utilities
- Add Vector4 parsing support to VectorParsing.cs

Phase 3: Bulk Data Mapping
- Handle JArray values for list/array properties (recursive element setting)
- Handle JObject values for nested struct/class properties

Phase 4: Enhanced Reference Resolution
- Support plain 32-char GUID strings for ObjectReference fields

Phase 5: Validation & Dry-Run
- Add ValidatePatches() for pre-validation of all patches
- Add dry_run parameter to validate without mutating

Includes comprehensive stress test suite covering:
- Big Bang (large nested arrays), Out of Bounds, Friendly Path Syntax
- Deep Nesting, Mixed References, Rapid Fire, Type Mismatch
- Bulk Array Mapping, GUID Shorthand, Dry Run validation

* feat: Add AnimationCurve and Quaternion support to manage_scriptable_object tool

- Implement TrySetAnimationCurve() supporting both {'keys': [...]} and direct [...] formats
  * Support keyframe properties: time, value, inSlope, outSlope, weightedMode, inWeight, outWeight
  * Gracefully default missing optional fields to 0
  * Clear error messages for malformed structures

- Implement TrySetQuaternion() with 4 input formats:
  * Euler array [x, y, z] - 3 elements interpreted as degrees
  * Raw array [x, y, z, w] - 4 components
  * Object format {x, y, z, w} - explicit components
  * Explicit euler {euler: [x, y, z]} - labeled format

- Improve error handling:
  * Null values: AnimationCurve→empty, Quaternion→identity
  * Invalid inputs rejected with specific, actionable error messages
  * Validate keyframe objects and array sizes

- Add comprehensive test coverage in ManageScriptableObjectStressTests.cs:
  * AnimationCurve with keyframe array format
  * AnimationCurve with direct array (no wrapper)
  * Quaternion via Euler angles
  * Quaternion via raw components
  * Quaternion via object format
  * Quaternion via explicit euler property

- Fix test file compilation issues:
  * Replace undefined TestFolder with _runRoot
  * Add System.IO using statement

* refactor: consolidate test utilities to eliminate duplication

- Add TestUtilities.cs with shared helpers:
  - ToJObject() - consolidates 11 duplicates across test files
  - EnsureFolder() - consolidates 2 duplicates
  - WaitForUnityReady() - consolidates 2 duplicates
  - FindFallbackShader() - consolidates shader chain duplicates
  - SafeDeleteAsset() - helper for asset cleanup
  - CleanupEmptyParentFolders() - standardizes TearDown cleanup

- Update 11 test files to use shared TestUtilities via 'using static'
- Standardize TearDown cleanup patterns across all test files
- Net reduction of ~40 lines while improving maintainability

* fix: add missing animCurve and rotation fields to ComplexStressSO

Add AnimationCurve and Quaternion fields required by Phase 6 stress tests.
2026-01-07 10:46:35 -04:00
..
AssetPathUtility.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
AssetPathUtility.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
CodexConfigHelper.cs Payload-safe paging for hierarchy/components + safer asset search + docs (#490) 2025-12-28 20:57:57 -08:00
CodexConfigHelper.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ComponentOps.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
ComponentOps.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
ConfigJsonBuilder.cs Payload-safe paging for hierarchy/components + safer asset search + docs (#490) 2025-12-28 20:57:57 -08:00
ConfigJsonBuilder.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ExecPath.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
ExecPath.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
GameObjectLookup.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
GameObjectLookup.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00
GameObjectSerializer.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
GameObjectSerializer.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
HttpEndpointUtility.cs Remove distribution settings scriptable object (#473) 2025-12-19 19:11:54 -04:00
HttpEndpointUtility.cs.meta HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
MaterialOps.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
MaterialOps.cs.meta feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
McpConfigurationHelper.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
McpConfigurationHelper.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
McpJobStateStore.cs HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
McpJobStateStore.cs.meta HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
McpLog.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
McpLog.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
ObjectResolver.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
ObjectResolver.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
Pagination.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
Pagination.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
ParamCoercion.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
ParamCoercion.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00
PortManager.cs Fix: Python Detection, Port Conflicts, and Script Creation Reliability (#428) 2025-12-04 13:19:42 -08:00
PortManager.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
ProjectIdentityUtility.cs HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
ProjectIdentityUtility.cs.meta HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
PropertyConversion.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
PropertyConversion.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
RenderPipelineUtility.cs [FIX] Temp Update on Material Assignment (#420) 2025-12-03 00:39:38 -05:00
RenderPipelineUtility.cs.meta [FIX] Temp Update on Material Assignment (#420) 2025-12-03 00:39:38 -05:00
RendererHelpers.cs [FEATURE]: Manage VFX function (#520) 2026-01-07 01:47:32 -05:00
RendererHelpers.cs.meta [FEATURE]: Manage VFX function (#520) 2026-01-07 01:47:32 -05:00
Response.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
Response.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
TelemetryHelper.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
TelemetryHelper.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
UnityJsonSerializer.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
UnityJsonSerializer.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
UnityTypeResolver.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
UnityTypeResolver.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
VectorParsing.cs Harden `manage_scriptable_object` Tool (#522) 2026-01-07 10:46:35 -04:00
VectorParsing.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00