mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
Setup arrays constraints on loading .ifc #3753
This commit is contained in:
@@ -20,6 +20,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import bpy
|
import bpy
|
||||||
import time
|
import time
|
||||||
|
import json
|
||||||
import bmesh
|
import bmesh
|
||||||
import logging
|
import logging
|
||||||
import mathutils
|
import mathutils
|
||||||
@@ -306,6 +307,7 @@ class IfcImporter:
|
|||||||
self.set_default_context()
|
self.set_default_context()
|
||||||
self.profile_code("Setting default context")
|
self.profile_code("Setting default context")
|
||||||
self.setup_viewport_camera()
|
self.setup_viewport_camera()
|
||||||
|
self.setup_arrays()
|
||||||
self.update_progress(100)
|
self.update_progress(100)
|
||||||
bpy.context.window_manager.progress_end()
|
bpy.context.window_manager.progress_end()
|
||||||
|
|
||||||
@@ -1908,6 +1910,15 @@ class IfcImporter:
|
|||||||
bpy.ops.view3d.view_selected()
|
bpy.ops.view3d.view_selected()
|
||||||
bpy.ops.object.select_all(action="DESELECT")
|
bpy.ops.object.select_all(action="DESELECT")
|
||||||
|
|
||||||
|
def setup_arrays(self):
|
||||||
|
for element in self.file.by_type("IfcElement"):
|
||||||
|
pset_data = ifcopenshell.util.element.get_pset(element, "BBIM_Array")
|
||||||
|
if not pset_data["Data"]: # skip array children
|
||||||
|
continue
|
||||||
|
for i in range(len(json.loads(pset_data["Data"]))):
|
||||||
|
tool.Blender.Modifier.Array.set_children_lock_state(element, i, True)
|
||||||
|
tool.Blender.Modifier.Array.constrain_children_to_parent(element)
|
||||||
|
|
||||||
|
|
||||||
class IfcImportSettings:
|
class IfcImportSettings:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user