Skip to content

v2.39.5 — community-reported fixes (ShaderGraph, macOS Roslyn, sprite animation) - #24

Merged
francoios merged 3 commits into
mainfrom
Development-Fable-Improvements
Jul 27, 2026
Merged

v2.39.5 — community-reported fixes (ShaderGraph, macOS Roslyn, sprite animation)#24
francoios merged 3 commits into
mainfrom
Development-Fable-Improvements

Conversation

@francoios

Copy link
Copy Markdown
Contributor

Three community reports, each verified against the shipped Unity assemblies before being acted on. Companion server: 2.35.6.

Closes #23, closes #19, closes AnkleBreaker-Studio/unity-mcp-server#30.

ShaderGraph (PR #23 by @mrooney)

  • get_edges returned blank ids on every edge. The patterns used .*? without RegexOptions.Singleline, so . couldn't cross the newline between "m_OutputSlot" and the nested "m_Id" — and a .shadergraph writes one field per line. Read-only path, so nothing on disk was ever wrong, but every reported id was "". Verified live: connectget_edges now returns the real objectId and slot.
  • Property nodes were still added unbound (issue Shader Graph MCP tools corrupt / produce invalid .shadergraph assets (create, disconnect, add_node) #18 bug 3). Our GraphData rewrite fixed three of the four Shader Graph MCP tools corrupt / produce invalid .shadergraph assets (create, disconnect, add_node) #18 bugs and left this one — fair catch. add_node now takes propertyId and binds via PropertyNode.property; an unbound Property node is refused before anything is written (verified: target graph intact at 15099 B).
  • The version guard now names the missing members instead of "One or more ShaderGraph API methods not found", which made reports against this path unfalsifiable in both directions.

On PR #23's headline claim — not reproduced

The PR's premise was that ShaderGraph 17.3.0 exposes only AddNode(node, bool), disabling the whole suite on Unity 6.3. Reflecting the shipped Unity.ShaderGraph.Editor on 17.3.0 shows the opposite: only the 1-arg AddNode(AbstractMaterialNode) exists, the 2-arg does not, and Available is true — which is also why the two real fixes above were reachable for us to verify at all.

We took the fallback anyway (accepting either arity costs nothing), but did not adopt the PR's approach of hard-requiring PropertyNode.property in Initialize — as Copilot noted on the PR, that would disable the entire ShaderGraph surface if that member ever moved, reintroducing exactly the brittleness being reported. Those members are resolved optionally and only error when a Property node is actually added.

macOS (PR #19 by @JetNik)

  • execute_code still failed on macOS. Unity 6000.3+ re-roots scripting assemblies under Contents/Resources/Scripting; probing only that bare folder never reached the nested MonoBleedingEdge/… and DotNetSdkRoslyn layout inside. Now mirrored. Provably inert off macOS (the existing Directory.Exists guard skips absent paths), and execute_code verified still resolving Roslyn on Windows.

2D sprite animation (server issue #30 by @VM233)

  • New animation/set-object-reference-curve. clip.SetCurve/AnimationCurve can only express float curves, so animating SpriteRenderer.m_Sprite had no route through the MCP at all and the reporter had to hand-write .anim YAML — which produced curve type is invalid import errors. Routes through AnimationUtility.SetObjectReferenceCurve so Unity writes the binding. Sub-asset name selects one sprite from a sliced sheet; fails closed on any unresolvable keyframe.
  • clip-info now reports object-reference curves — a correct sprite clip previously showed curveCount: 0 and looked empty.

Verification

0 Unity compile errors; ShaderGraph, execute_code and a full 3-frame sprite clip all exercised live through the real MCP (clip re-imported by Unity with 0 console errors, all references resolved). Companion server 60/60 tests. Route registry 337 → 338.

…unity PR #23 by mrooney) : the m_OutputSlot/m_InputSlot patterns used `.*?` WITHOUT RegexOptions.Singleline, so `.` could not cross the newline between the key and the nested m_Id - and a .shadergraph writes one field per line. Every id came back as "" and every slot as 0 while the on-disk edges were correct. Read-only path, nothing was corrupted. Reproduced against real multi-line edge JSON, then verified live: connect -> get_edges now returns the real objectId and slot 2

[FIX] ShaderGraph, Property nodes were still added unbound (issue #18 bug 3, reported still-open in PR #23) : the GraphData rewrite fixed the other three bugs but added Property nodes type-only, so they serialized with an empty m_Property and no slots and the next import threw in PropertyNode.AddOutputSlot, failing the whole asset. add-node now takes propertyId (alias property) and binds it via PropertyNode.property, which rebuilds the output slot from the property's concrete type. Verified live: an unbound Property node is REFUSED before anything is written and the target graph still imports (15099B intact)

[FIX] ShaderGraph, the version-mismatch guard named nothing : it reported "One or more ShaderGraph API methods not found", which made a report against this path unfalsifiable in both directions. It now lists exactly which members are missing and asks for the Unity + shadergraph versions

[CLEAN] ShaderGraph : accept either AddNode(node) or AddNode(node, bool). On com.unity.shadergraph 17.3.0 only the 1-arg overload exists (verified by reflecting the shipped assembly), contrary to PR #23's premise - but accepting both costs nothing. Property-binding members are resolved OPTIONALLY so a build lacking PropertyNode cannot disable the entire ShaderGraph surface (the all-or-nothing brittleness the PR would have introduced; also raised by Copilot on the PR)

[FIX] EditorCommands, execute-code still failed on macOS (community PR #19 by JetNik) : Unity 6000.3+ re-roots the scripting assemblies under Contents/Resources/Scripting, and probing that bare folder missed the nested MonoBleedingEdge/DotNetSdkRoslyn layout inside it. Mirror each Roslyn subpath there. Inert off macOS - the existing Directory.Exists guard skips absent paths - and execute-code verified still working on Windows
…n was impossible (issue #30 by VM233) : clip.SetCurve/AnimationCurve can only express FLOAT curves, so animating SpriteRenderer.m_Sprite had no route through the MCP at all and the reporter had to hand-write .anim YAML, which is version-fragile and produced "curve type is invalid" import errors. New animation/set-object-reference-curve goes through AnimationUtility.SetObjectReferenceCurve + EditorCurveBinding.PPtrCurve so Unity writes the binding itself. Keyframes name an asset path, with an optional sub-asset name to pick one sprite out of a sliced sheet, and the call FAILS CLOSED if any keyframe is unresolvable rather than leaving a half-wired clip animating to the wrong frames

[FIX] Animation, clip-info hid object-reference curves entirely : GetCurveBindings returns only float curves, so a correct sprite animation reported curveCount:0 and looked empty through the MCP - the reporter had no way to verify their own clip. clip-info now also reports objectReferenceCurves (binding path, property, type, and each keyframe's time + resolved asset path)

Verified live end to end: 3-frame sprite clip built through the real MCP tool, reported back correctly by clip-info, and re-imported by Unity with 0 console errors and all references resolved. Route registry 337 -> 338.
…y-reported wave (ShaderGraph get-edges + Property binding from PR #23, macOS Roslyn paths from PR #19, object-reference animation curves from issue #30), including why PR #23's AddNode-arity premise did not reproduce on ShaderGraph 17.3.0
@francoios
francoios merged commit 9032874 into main Jul 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Animation tools cannot create or inspect SpriteRenderer.m_Sprite object reference curves

1 participant