Repository navigation
Commit 7ca0fdc
fix(examples): make the examples follow the rules they teach, and lint it (#431)
Agents copy these scripts (bmesh-gear is the documented anatomy), but
nothing checked them against the repo's own rules, and they broke them:
53 per-face `use_smooth` loops (three in bmesh-gear), 74 per-vertex
`v.co.z += ...` loops, more per-element material/co writes, and seven
`active_object` reads with no None guard.
- 127 single-statement loops became foreach_set / foreach_get by a
scripted AST rewrite (inline comments kept); seven more hand-converted
(constant material indices, uniform co scale/offset, the moka-pot lean).
- Eight loops with genuinely per-element logic (ring/station material
bands, n-gon marking, ball-surface tests) carry a
`# foreach-exempt: <why>` marker.
- Seven `X = bpy.context.active_object` reads get `if X is None: raise`.
- tests/check_example_rules.py (Validate) rejects an unmarked
per-element write in a loop over .polygons/.vertices (Mesh-only names,
so bmesh code is never hit) and an unguarded active_object read.
Old and new versions of six scripts, run on 5.2.1 across ten paths
including the touched falsifiers, print identical output with identical
exit codes.
Closes #400
Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 5177e24 commit 7ca0fdc
108 files changed
Lines changed: 503 additions & 274 deletions
File tree
- .github/workflows
- docs
- examples
- armature-bend
- bake-normal-high-to-low
- bmesh-gear
- boolean-exact-volume
- car-mirror-symmetry
- collision-hull-proxy
- color-attribute-wheel
- compositor-glare
- custom-normals-shade
- depsgraph-export
- driver-wave
- gltf-export-roundtrip
- gn-sdf-remesh
- gn-socket-rename
- gp-lineart-contour
- grease-pencil-rosette
- lattice-deform
- light-link-studio
- lightmap-uv-channel
- mesh-hygiene-audit
- prop-origin-transform
- ray-cast-space
- shader-node-group
- sky-texture-sun-elevation
- soccer-ball-goldberg
- socket-attach-points
- solidify-even-thickness
- swatch-grid
- triangulate-tangents
- turntable
- usd-export-evaluation-mode
- showcase
- anvil
- apothecary-shelf
- archery-target
- bamboo-clump
- basketball-hoop
- book-trolley
- bookshelf
- boulder-cluster
- bowling-pins
- brazier
- broadleaf-oak
- butter-churn
- cactus-garden
- campfire
- cargo-loader
- cart
- crate-stack
- cricket-wicket
- desk-lamp
- espresso-machine
- fallen-log
- farm-tractor
- fence-kit
- fern-mossy-rock
- floor-fan
- garden-gate
- go-kart
- grain-sacks
- grindstone
- hand-pump
- hay-bale
- hitching-post
- hover-bike
- iron-cauldron
- market-stall
- mine-cart
- moka-pot
- motor-scooter
- mushroom-stump
- office-chair
- palm-tree
- park-bench
- pine-tree
- planet-rover
- pond-edge
- quad-drone
- road-bicycle
- rope-bridge
- sawhorse-plank
- sea-stack-arch
- shipping-crate
- ships-wheel
- signpost
- skate-ramp
- soccer-goal
- stand-mixer
- stone-archway
- stone-well
- street-lantern
- sundial
- tavern-stool
- terrain-scatter
- toboggan
- traffic-cones
- treasure-chest
- wall-torch
- watchtower
- water-trough
- weight-rack
- wheelbarrow
- wingback-armchair
- wooden-barrel
- wooden-bucket
- wooden-yoke
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
294 | | - | |
| 293 | + | |
295 | 294 | | |
296 | 295 | | |
297 | 296 | | |
| |||
329 | 328 | | |
330 | 329 | | |
331 | 330 | | |
332 | | - | |
333 | | - | |
| 331 | + | |
334 | 332 | | |
335 | 333 | | |
336 | 334 | | |
| |||
368 | 366 | | |
369 | 367 | | |
370 | 368 | | |
371 | | - | |
372 | | - | |
| 369 | + | |
373 | 370 | | |
374 | 371 | | |
375 | 372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
| 291 | + | |
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
| |||
357 | 356 | | |
358 | 357 | | |
359 | 358 | | |
360 | | - | |
361 | | - | |
| 359 | + | |
362 | 360 | | |
363 | 361 | | |
364 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
387 | | - | |
388 | | - | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
| 418 | + | |
420 | 419 | | |
421 | 420 | | |
422 | 421 | | |
| |||
521 | 520 | | |
522 | 521 | | |
523 | 522 | | |
524 | | - | |
525 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
| 262 | + | |
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | | - | |
133 | | - | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
0 commit comments