Repository navigation
fix(examples): free hay-bale's bmesh on every path; per-run depsgraph-export OBJ - #421
Merged
Merged
Conversation
…-export OBJ hay-bale (#401): a measurement helper built a bmesh inside `try: ... finally: pass`, so its early `return []` leaked the BMesh and the later bm.free() was unprotected; the --stray-vert falsifier path did from_mesh/to_mesh/free with no try at all, the literal "WRONG" example of the always-free-bmesh rule. Both now free in finally. BVHTree.FromBMesh copies the geometry, so freeing before the ray casts is safe: the piece's full output is byte-identical before and after. depsgraph-export (#404): the export wrote gettempdir()/depsgraph_export.obj and never removed it, so a previous run's OBJ could satisfy the "file exists" check when an export wrote nothing (and Blender points TMPDIR at the working directory). It now uses a pid-suffixed name and deletes the .obj and .mtl before and after. Closes #404 Refs #401 Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
CI evidence before merge: all checks pass ( 13 pass ). Blender Smoke on PR head: Blender 5.2.2 LTS / Blender 4.5.14 LTS. Summaries (happy path; falsifiers) per leg: 143 passed, 1 skipped, 0 failed;142 passed, 0 skipped, 0 failed;141 passed, 3 skipped, 0 failed;136 passed, 6 skipped, 0 failed; |
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.
Closes #404. Refs #401: this fixes the hay-bale defect. The rule-vs-builder-class mismatch #401 also describes is left for the rule lint in #400.
hay-bale (#401)
belt_depths()helper:bm = bmesh.new(), thentry: … if not bm.faces: return [] … finally: pass. The early return leaked the BMesh, and the laterbm.free()was outside anyfinally. It now frees infinally.BVHTree.FromBMeshcopies the geometry, and the evidence below confirms it.--stray-vertfalsifier path:from_mesh/to_mesh/freehad notry; it is now wrapped.depsgraph-export (#404)
gettempdir()/depsgraph_export.obj(plus.mtl) and never removed it. A previous run's OBJ could therefore satisfy theexists and size > 0check when an export wrote nothing..objand.mtlbefore the export and infinally. A caller-suppliedobj_pathis still pre-deleted but kept afterwards.Evidence
Live run (
--factory-startup --python-exit-code 1; binary reports 5.2.1 LTS). Each script was run on unmodifiedmainfirst, then on this branch:hay_bale.pyhay_bale.py --stray-vert(catalog falsifier)depsgraph_export.py%TEMP%\depsgraph_export.obj+.mtlbehinddepsgraph_export.py --unevaluated(falsifier)check_exit_code_readmeandcheck_helper_driftpass.🤖 Generated with Claude Code