Files
IfcOpenShell/src/blenderbim/blenderbim/bim/module/sequence/operator.py
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
908 B
Python
Raw Normal View History

2021-02-17 22:54:11 +11:00
import bpy
from blenderbim.bim.ifc import IfcStore
from ifcopenshell.api.sequence.data import Data
2021-02-17 22:54:11 +11:00
class LoadTasks(bpy.types.Operator):
bl_idname = "bim.load_tasks"
bl_label = "Load Tasks"
def execute(self, context):
props = context.scene.BIMTaskProperties
while len(props.tasks) > 0:
props.tasks.remove(0)
for ifc_definition_id, task in Data.tasks.items():
new = props.tasks.add()
new.ifc_definition_id = ifc_definition_id
new.name = task["Name"]
new.identification = task["Identification"]
props.is_editing = True
return {"FINISHED"}
class DisableTaskEditingUI(bpy.types.Operator):
bl_idname = "bim.disable_task_editing_ui"
bl_label = "Disable Task Editing UI"
def execute(self, context):
context.scene.BIMTaskProperties.is_editing = False
return {"FINISHED"}