Repository navigation
fix(blender): OpenCode for Blender 0.4.5, say what the saved file lacks - #27
Merged
Merged
Conversation
In the 0.4.4 exercises (ex06, ex09) the agent checked the open document and concluded, while the saved file lacked its last changes (the robot's pose, the light-linking receiver) and the physics cache it measured was outdated. 0.4.5 adds short facts to existing results; nothing is imposed on the agent. unsaved: when the open document differs from its file, the results of blender_context, blender_apply, blender_execute_code and blender_verify say so: the file's name (never_saved for a new document) and the OpenCode undo steps pushed since its last save or load (changes made by hand are not listed). The adapter keeps those steps (barriers excluded) and clears them on a save of the open file or a load. blender_save says what it wrote: bytes and wrote_steps, the OpenCode steps now in the file; after a copy, what the open file still lacks. Blender calls the save handler for a copy too, with the copy's path: a copy no longer counts as a save of the open file (0.4.4 took it for one, and a background Blender then called the open file saved). caches: blender_verify names the simulation caches its checked frames read without a current bake: rigid body world, cloth, soft body, dynamic paint, simulated particles and fluid domains, not baked, baked but outdated (made before a later change), or baked without a checked frame. On the exercise's own file, frame 120 now reports the rigid body cache "cache is outdated!". A code run that opens a file pushes no undo step into it (its barrier was the old document's), so an opened file is as saved instead of modified. Validation: ops045_tests.py (5 tests) and one plugin test in a background Blender 5.3 fail on 0.4.4 and pass on 0.4.5; a trial through the plugin on copies of the exercises' files (ex06: outdated rigid cache at frame 120; ex09: a change after the save named in context, execute_code and verify, then blender_save's wrote_steps, nothing unsaved after). lint, typecheck, npm test, build, check:markers, trace scan, the Blender suites and native sessions with OpenCode 2.2.5 pass.
…ed bakes
The 0.4.5 trial (ex06, ex09) saved through execute_code
(bpy.ops.wm.save_as_mainfile) rather than blender_save, in an interface
Blender. Replayed there with the trial's own calls, on a desktop never shown:
- every run that saved still answered unsaved: right after the save, inside
the run, an interface Blender keeps is_dirty set until its next event loop
(a background Blender keeps it after any undo step: a run that changed the
document, then saved, answered unsaved there too; the tests saved without
changing anything). A document whose revision is the one saved is now saved
whatever is_dirty says, and a run that saved and changed nothing after it
(its content compared with the one saved) leaves it so.
- saved_steps listed "OpenCode: failed code": the step a failed run pushes is
undone at once by its restoration, and is no change of the file. A run that
changes then saves lists its own change ("OpenCode: code (this run)").
- blender_save after a save in code had nothing pending and returned no
wrote_steps, read as missing: a save of the open file always says it, an
empty list when nothing was pending (execute_code's saved_steps too).
- verify listed no cache: the rigid body cache baked in that run was current
(is_outdated false) at every verify. The QA read it outdated by reopening
the file: Blender 5.3 flags every rigid body bake outdated when its file is
opened (the cloth's stays current) and still plays its frames (same
positions at frame 120). caches now says so in a note on that entry.
Validation: three ops045 tests and the plugin test fail on the PR head
(5facbba) and pass; the trial's sequence replayed in an interface Blender on
the hidden desktop answers no unsaved after the save, saved_steps without
restorations, wrote_steps [] then ["OpenCode: code"]. lint, typecheck,
npm test, build, check:markers, trace scan, the Blender suites (22/22,
extension 1/1) and native sessions with OpenCode 2.2.5 pass.
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.
OpenCode for Blender 0.4.5, from the 0.4.4 trial (ex06, ex09): the agent checked the open document and concluded while the saved file lacked its last changes (robot pose, light-linking receiver) and the physics cache was outdated. Short facts in existing results; no new tool, nothing imposed.
What changes
unsavedinblender_context,blender_apply,blender_execute_codeandblender_verifyresults, only when the open document differs from its file:{file, never_saved?, opencode_steps}(the OpenCode undo steps since the last save or load; changes by hand are not listed).blender_savesays what it wrote:bytes,wrote_steps(the OpenCode steps now in the file); after a copy,unsaved(the open file still lacks them). A copy no longer counts as a save of the open file (0.4.4 took Blender'ssave_postfor a copy as one).cachesinblender_verify: the simulation caches its checked frames read without a current bake (rigid body world, cloth, soft body, dynamic paint, simulated particles, fluid): not baked, baked butoutdated, orchecked_frames_outsidethe bake.Validation
ops045_tests.py(5) and one plugin test in a background Blender 5.3: fail on 0.4.4, pass on 0.4.5.caches: [{"cache": "rigid body world", "baked": true, "outdated": true, "info": "120 frames in memory (85 KiB), cache is outdated!"}]; ex09, a change after the save →unsaved: {"file": "shot010.blend", "opencode_steps": ["OpenCode: code"]}in execute_code, context and verify;blender_save→wrote_steps: ["OpenCode: code"], nothing unsaved after.npm test, build,check:markers, trace scan, Blender suites, native sessions with OpenCode 2.2.5.