brunopostle / homemaker-addon

Design buildings the pointy-clicky way, a blender add-on that transforms spatial geometry into IFC building models
GNU General Public License v3.0
125 stars 7 forks source link

Undo functionality needs to use Blenderbim hooks #42

Open brunopostle opened 2 years ago

brunopostle commented 2 years ago

Undo currently sort-of works: if there are no IfcProject collections in the blender file, the Blenderbim ifcstore singleton is flushed, and the IFC model is generated as if this was a fresh project.

This works with a single building project, as there is no need to retain any other IFC buildings, however when there are other buildings in the ifcstore, this flushing step is skipped (to avoid destroying user data), the result is duplicated buildings (as undo only removes the blender geometry and collections).

Blenderbim registers the ifcstore with blender so as to allow clean undo, the Homemaker-addon needs to use the same hooks.

brunopostle commented 2 years ago

See IfcOpenShell/IfcOpenShell#2200