Skip to content

bonsai: clear stale references after patching the loaded model - #9487

Open
brunopostle wants to merge 1 commit into
v0.9.0from
bonsai-patch-stale-references
Open

brunopostle wants to merge 1 commit into
v0.9.0from
bonsai-patch-stale-references

Conversation

@brunopostle

Copy link
Copy Markdown
Contributor

A recipe that deletes elements left Blender objects linked to ids that no longer exist, so saving the project failed in
export_ifc.sync_object_placement with 'RuntimeError: Instance #N not found'

This is a fix for a glitch revealed by the general arrangement patch recipe #9484 but can be applied independently.

After a recipe runs on the loaded model, remove Blender objects whose elements are gone and rebuild the element maps, which also picks up GlobalIds the recipe changed. Reload the drawing, schedule, reference and sheet lists if they are open, as their entries hold element ids that refresh_ui_data does not touch.

Generated with the assistance of an AI coding tool.

A recipe that deletes elements left Blender objects linked to ids that
no longer exist, so saving the project failed in
export_ifc.sync_object_placement with 'RuntimeError: Instance #N not
found'

After a recipe runs on the loaded model, remove Blender objects whose
elements are gone and rebuild the element maps, which also picks up
GlobalIds the recipe changed. Reload the drawing, schedule, reference
and sheet lists if they are open, as their entries hold element ids that
refresh_ui_data does not touch.

Generated with the assistance of an AI coding tool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant