mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
BlenderBIM keep camera position on git switch
New 'zoom extents' behaviour on IFC load is unwanted when switching between git revisions
This commit is contained in:
@@ -8,6 +8,8 @@ try:
|
|||||||
except:
|
except:
|
||||||
print("Warning: GitPython not available.")
|
print("Warning: GitPython not available.")
|
||||||
import bpy
|
import bpy
|
||||||
|
import logging
|
||||||
|
from blenderbim.bim import import_ifc
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
|
|
||||||
@@ -220,7 +222,16 @@ class IfcGit:
|
|||||||
|
|
||||||
bpy.data.orphans_purge(do_recursive=True)
|
bpy.data.orphans_purge(do_recursive=True)
|
||||||
|
|
||||||
bpy.ops.bim.load_project(filepath=path_ifc, should_start_fresh_session=False)
|
settings = import_ifc.IfcImportSettings.factory(
|
||||||
|
bpy.context, bpy.context.scene.BIMProperties.ifc_file, logging.getLogger("ImportIFC")
|
||||||
|
)
|
||||||
|
settings.should_setup_viewport_camera = False
|
||||||
|
ifc_importer = import_ifc.IfcImporter(settings)
|
||||||
|
ifc_importer.execute()
|
||||||
|
tool.Project.load_pset_templates()
|
||||||
|
tool.Project.load_default_thumbnails()
|
||||||
|
tool.Project.set_default_context()
|
||||||
|
tool.Project.set_default_modeling_dimensions()
|
||||||
bpy.ops.object.select_all(action="DESELECT")
|
bpy.ops.object.select_all(action="DESELECT")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user