Repository navigation
Blender exporter, cluster demo app, and the 3D/animation fixes it needed - #365
Merged
Merged
Conversation
Getting an exported 3D scene to render and animate in a real app exposed a run of engine bugs. Each is fixed where it lives: SceneKit - Viewport3D crashed on a Screen parent (Screen has no Node2D). - Model3D discarded Material.BlendMode: an unset node override read back as -1 through an unsigned parameter and replaced the material's mode. - Camera projection: drop the 1.05 FOV fudge and convert horizontal FOV correctly (same fix as b45c771); give Fov/ZNear/ZFar usable defaults. - PrefabView3D loaded its prefab twice at startup. - TextBlock3D gets a Color property instead of always drawing white. Core / renderer - AnimationPlayer stalled after its first frame, and the frame clock never advanced on app-loop paints, so clips could not play in a running app. - Setting AnimationPlayer.CurrentTime while stopped now applies the clip, so a clip can be scrubbed from an input value. - vec2/vec3/vec4 uniforms fell through into the int case and were corrupted. - Shader BlendMode/DepthTestFunction/DepthWriteEnabled became uniforms and never reached the draw call. - Render-pass tags were never registered. - CDATA text content in XML was dropped. - Texture_Create crashed without a GL context (headless tests). Tools and docs - orca-fbx: honour arguments, create the output directory, write vertex colours, compile against current headers and FBX SDK 2020.2; add a `make orca-fbx` target and fix the premake project. - create-app.py generates package.lua (package.xml is no longer loaded). - QUICKSTART and docs/animations.md match what the loader accepts. Adds a headless test for AnimationPlayer scrubbing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
tools/blender-export.py runs inside Blender and writes an ORCA project's 3D assets from the open file: meshes (FBX through orca-fbx), one Shader per shader node group with a "<group>.frag" text block, one Material per Blender material (uniforms read from the group node's inputs), AnimationClips from actions, a scene prefab with one AnimationPlayer per clip, and a first-time package.lua and screen. apps/cluster-demo is its first output: a 1920x720 digital instrument cluster built procedurally in Blender (blender/build_cluster.py, blender/cluster.blend). Every gauge has a linear fill-up clip; the app drives a gauge by setting its player's CurrentTime, and Animations.lua names each clip's signal and range. Demo/FillAll.xml scrubs all gauges together as a stand-in for real inputs. .mesh files are ignored by .gitignore, so Meshes/ only carries the <Mesh> declarations; run the exporter to regenerate the binary meshes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
CI has failed on main since the SVG loader rework: three tests still described code that no longer exists. - test_filesystem.c tested _ParseLoaderArgs, removed with the .svg loader; keep only the inline-XML expansion test so the binary links again. - test_layout.lua expected the removed "&type=mask" icon query and an ImageView in IconCard; both are VectorView now. The CSS popup test expected a centred panel to stretch; align-items: center sizes it to its content, so assert that instead. - test_navigationhost.lua looked for "GameBack"; the back control moved into the NavigationBar prefab as "BackButton". Add two skills, .opencode/skills/orca-blender-pipeline (authoring a Blender scene so tools/blender-export.py can turn it into a project) and .opencode/skills/orca-3d-scene (project layout, scene XML, shaders and uniforms, animation players scrubbed from inputs, running and verifying), and expose all skills to Claude Code and Codex through .claude/skills and .agents/skills symlinks. AGENTS.md lists them; apps/cluster-demo/README.md explains the reference project. Ignore Blender's *.blend1 backups. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
tools/blender-export.py— runs inside Blender and writes an ORCA project's 3D assets: meshes (FBX →orca-fbx), shaders, materials, animation clips, a scene prefab, and a first-timepackage.luaand screen.apps/cluster-demo/— a 1920×720 digital instrument cluster built procedurally in Blender and exported with the tool. Each gauge has a linear fill-up clip; the app drives a gauge by setting itsAnimationPlayer.CurrentTime.Demo/FillAll.xmlscrubs every gauge together as a stand-in for real inputs.orca-fbx(tools/fbx-import.cpp) — honours its arguments, creates the output directory, writes vertex colours, compiles against current headers and FBX SDK 2020.2. Newmake orca-fbxtarget.Run the demo with
build/bin/orca apps/cluster-demoafter regenerating the meshes (see below).Engine fixes
Getting an exported scene to render and animate in a running app exposed these:
SceneKit
Viewport3Dcrashed when its parent was aScreen(noNode2D).Model3DdiscardedMaterial.BlendMode(unset node override came back as-1through an unsigned parameter).Fov/ZNear/ZFarnow have defaults.PrefabView3Dloaded its prefab twice at startup.TextBlock3Dhas aColorproperty instead of always drawing white.Core / renderer
AnimationPlayerstalled after its first frame, and the frame clock did not advance on app-loop paints, so clips never played in a running app. The clock now advances inScreen's paint handler.CurrentTimeon a stopped player applies the clip (scrubbing).break.BlendMode/DepthTestFunction/DepthWriteEnabledbecame uniforms and never reached the draw call.Texture_Createcrashed without a GL context.Tools and docs
tools/create-app.pygeneratespackage.lua(the runtime no longer readspackage.xml).QUICKSTART.md,docs/animations.mdand theorca-fbxpremake project corrected.Testing
make test-headlessandmake testpass locally on macOS; a scrubbing test was added totests/test_animations.lua.mainsince the SVG loader rework because three tests described removed code; they are brought up to date here:test_filesystem.c(tested the removed_ParseLoaderArgs),test_layout.lua(expected the removed&type=maskicon query, anImageViewinIconCard, and a centred panel to stretch),test_navigationhost.lua(looked forGameBack, nowBackButtonin the NavigationBar prefab).Skills
Two skills document the pipeline for agents:
.opencode/skills/orca-blender-pipeline(authoring in Blender for the exporter) and.opencode/skills/orca-3d-scene(project layout, scene XML, shaders/uniforms, animation binding, running and verifying)..claude/skillsand.agents/skillsare symlinks to.opencode/skillsso Claude Code and Codex find them;AGENTS.mdlists them.Reviewer notes
.gitignoreignores*.mesh, soapps/cluster-demo/Meshes/only carries the<Mesh>declarations. Regenerate with Blender, the FBX SDK andmake orca-fbx:blender -b apps/cluster-demo/blender/cluster.blend --python tools/blender-export.py -- apps/cluster-demo --collection InstrumentCluster(the headless invocation is untested; the export was run from an interactive Blender).
Material.BlendModenow takes effect, and the frame clock advances on every screen paint.TextBlock3D.Model3Dloads its own material and compiles its own shader),Viewport3Dalways draws to the full window, orthographic cameras are ignored,orca newstill writespackage.xml.🤖 Generated with Claude Code