mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
black format
This commit is contained in:
@@ -50,19 +50,17 @@ class Blender(blenderbim.core.tool.Blender):
|
|||||||
OBJECT_TYPES_THAT_SUPPORT_EDIT_GPENCIL_MODE = ("GPENCIL",)
|
OBJECT_TYPES_THAT_SUPPORT_EDIT_GPENCIL_MODE = ("GPENCIL",)
|
||||||
TYPE_MANAGER_ICON = "LIGHTPROBE_VOLUME" if bpy.app.version >= (4, 1, 0) else "LIGHTPROBE_GRID"
|
TYPE_MANAGER_ICON = "LIGHTPROBE_VOLUME" if bpy.app.version >= (4, 1, 0) else "LIGHTPROBE_GRID"
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def activate_camera(cls, obj: bpy.types.Object) -> None:
|
def activate_camera(cls, obj: bpy.types.Object) -> None:
|
||||||
|
|
||||||
|
|
||||||
area = tool.Blender.get_view3d_area()
|
area = tool.Blender.get_view3d_area()
|
||||||
is_local_view = area.spaces[0].local_view is not None
|
is_local_view = area.spaces[0].local_view is not None
|
||||||
|
|
||||||
if is_local_view:
|
if is_local_view:
|
||||||
# Turn off local view before activating drawing, and then turn it on again.
|
# Turn off local view before activating drawing, and then turn it on again.
|
||||||
for a in bpy.context.screen.areas:
|
for a in bpy.context.screen.areas:
|
||||||
if a.type == 'VIEW_3D':
|
if a.type == "VIEW_3D":
|
||||||
override = {'area': a, 'region': a.regions[-1], 'space': a.spaces[0], 'scene': bpy.context.scene}
|
override = {"area": a, "region": a.regions[-1], "space": a.spaces[0], "scene": bpy.context.scene}
|
||||||
with bpy.context.temp_override(**override):
|
with bpy.context.temp_override(**override):
|
||||||
bpy.ops.view3d.localview()
|
bpy.ops.view3d.localview()
|
||||||
bpy.context.scene.camera = obj
|
bpy.context.scene.camera = obj
|
||||||
@@ -70,10 +68,7 @@ class Blender(blenderbim.core.tool.Blender):
|
|||||||
else:
|
else:
|
||||||
bpy.context.scene.camera = obj
|
bpy.context.scene.camera = obj
|
||||||
|
|
||||||
area.spaces[0].region_3d.view_perspective = 'CAMERA'
|
area.spaces[0].region_3d.view_perspective = "CAMERA"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_area_props(cls, context: bpy.types.Context) -> Any:
|
def get_area_props(cls, context: bpy.types.Context) -> Any:
|
||||||
@@ -479,7 +474,7 @@ class Blender(blenderbim.core.tool.Blender):
|
|||||||
obj.select_set(False)
|
obj.select_set(False)
|
||||||
context.view_layer.objects.active = active_object
|
context.view_layer.objects.active = active_object
|
||||||
active_object.select_set(True)
|
active_object.select_set(True)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def select_object(cls, obj: bpy.types.Object):
|
def select_object(cls, obj: bpy.types.Object):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -403,7 +403,16 @@ def consume_iterator(it, with_progress=False):
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
def iterate(settings, file_or_filename, num_threads=1, include=None, exclude=None, with_progress=False, cache=None, geometry_library: str = "opencascade"):
|
def iterate(
|
||||||
|
settings,
|
||||||
|
file_or_filename,
|
||||||
|
num_threads=1,
|
||||||
|
include=None,
|
||||||
|
exclude=None,
|
||||||
|
with_progress=False,
|
||||||
|
cache=None,
|
||||||
|
geometry_library: str = "opencascade",
|
||||||
|
):
|
||||||
it = iterator(settings, file_or_filename, num_threads, include, exclude, geometry_library)
|
it = iterator(settings, file_or_filename, num_threads, include, exclude, geometry_library)
|
||||||
if cache:
|
if cache:
|
||||||
hdf5_cache = serializers.hdf5(cache, settings)
|
hdf5_cache = serializers.hdf5(cache, settings)
|
||||||
|
|||||||
Reference in New Issue
Block a user