You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AnimationExport fails with push! MethodError on JSON.jl v1.x #144
Root cause:
exportAnimation.jl parses mesh companion .json files via JSON.parse(io), then mutates the result with push!(dict, "key" => value, ...). This worked with JSON.jl v0.21, where JSON.parse returned a plain Dict{String,Any}. In JSON.jl v1.x, JSON.parse returns a custom JSON.Object{K,V} <: AbstractDict (linked-list based) that implements setindex!/delete! but not push!, so these calls fail.
Affected lines are in exportAnimation.jl.
Fix:
Replace push!(dict, "key" => value) with dict["key"] = value (setindex! instead of push!), which works for both Dict and JSON.Object. I verified against JSON.jl v1.7.1 by running test/ForceElements/PCMBouncingBubbles.jl with animationFile enabled — the simulation completes and produces a valid three.js JSON animation file. I attached the modified exportAnimation.jl file (as txt, since jl is not accepted as a source code file (funny, hah)) exportAnimation
Note: the existing test suite doesn't catch this since animationFile export is commented out in the shipped PCM test files.
Activity
exportAnimation.jl bug fix from #144 juguma
AndreaNeumayr commentedon Sep 4, 2026
I changed it. Thanks for reporting and the bug fix. Give it a try, please.
Merge pull request #145 from ModiaSim/an_issue144