Visora v0.1.3 — Giving Agents Eyes on Unity Animations
So, we just fixed a massive problem. Once I hit merge, a huge weight lifted off my shoulders. It feels like the raw volume of code I write is getting smaller each time, but what actually lands has a massive, cascading impact on the entire system.Until now, whenever an AI agent needed to inspect an animation in Unity, it was basically flying blind. The old approach was either pulling raw curve data (which tells an agent nothing about clipping, silhouette, or visual feel) or recording full video dumps over the HTTP bridge. Video was heavy, expensive on tokens, slow to transfer, and worse: if the camera wasn’t manually lined up in the scene, the character would just walk right out of frame or get clipped halfway through. With Visora v0.1.3, we tackled this head-on by building preview_animation. It’s not just a snapshot tool — it’s a complete visual pipeline designed specifically for agent context budgets.
What Actually Changed Under the Hood
Trajectory-Aware Auto-Framing (C# Engine Side) Instead of relying on whatever camera happens to be in the scene, Visora now spins up a transient preview camera. Before snapping a single frame, it samples the clip across its timeline, collects every active skinned and mesh renderer, and computes a union bounding sphere for the entire motion trajectory.
It places the camera at an ideal 45° vantage point, automatically calculates the optimal distance based on camera FOV, and dynamically compensates for vertical vs. horizontal aspect ratios so tall or wide aspect ratios don’t clip the character’s head or limbs.
Smart Keyframe Selection (Python Side) Agents can’t look at 120 raw frames — that would incinerate context windows and latency. We built an intelligent keyframe extractor (preview_keyframes.py) that analyzes the clip curves to find where actual motion happens: curve extrema, zero-crossings, sudden velocity changes, and animation event timestamps. It pins the start and end poses, then fits the most informative frames within a strict frame budget (e.g. 4 to 8 images).
Zero-Side-Effect Scene Safety One of the hardest parts of building agent tooling for Unity is engine hygiene. The preview system samples the animation, renders offscreen to a custom RenderTexture, encodes directly to PNG byte buffers, and cleans up after itself. No dummy cameras left in the hierarchy, no dirty scene flags, and character poses are strictly restored to their pre-sampling state.
Hardened CI & The Unity Package Gate We also tightened our pre-commit and CI gates. We introduced scripts/check_unity_package.py, compiling the C# package directly against real Unity assemblies with Microsoft.Unity.Analyzers in headless Linux containers. If there’s an obsolete API, a loose memory allocation, or a CA analyzer warning, the build fails before it ever touches a project.
It feels great to have this merged and rock-solid. With animation visual inspection out of the way, I’m heading straight to the next item on the Roadmap: Typed Clip, Event, and Camera Authoring!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.