mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
fix bug where nested resources in task ICOM panel didn't show
This commit is contained in:
@@ -95,7 +95,7 @@ class ResourceData:
|
||||
sum = 0
|
||||
nested_resources = ifcopenshell.util.resource.get_nested_resources(resource)
|
||||
for nested_resource in nested_resources or []:
|
||||
if not nested_resource.Usage:
|
||||
if not nested_resource.Usage or not nested_resource.Usage.ScheduleWork:
|
||||
continue
|
||||
duration = ifcopenshell.util.date.ifc2datetime(nested_resource.Usage.ScheduleWork)
|
||||
sum += duration.total_seconds() / 3600
|
||||
|
||||
@@ -124,7 +124,7 @@ class BIM_PT_resources(Panel):
|
||||
schedule_work = resource.get("ScheduleWork", None)
|
||||
derived_schedule_work = resource.get("DerivedScheduleWork", None)
|
||||
row1col2.label(
|
||||
text="{}".format(schedule_work) if schedule_work else "*{}".format(derived_schedule_work),
|
||||
text="{}".format(schedule_work) if schedule_work else "{} h*".format(derived_schedule_work),
|
||||
icon="TIME",
|
||||
)
|
||||
|
||||
|
||||
@@ -489,15 +489,6 @@ class Sequence(blenderbim.core.tool.Sequence):
|
||||
is_deep = bpy.context.scene.BIMWorkScheduleProperties.show_nested_outputs
|
||||
return ifcopenshell.util.sequence.get_task_outputs(task, is_deep)
|
||||
|
||||
@classmethod
|
||||
def get_task_resources(cls, task):
|
||||
resources = []
|
||||
for rel in task.OperatesOn:
|
||||
for object in rel.RelatedObjects:
|
||||
if object.is_a("IfcResource"):
|
||||
resources.append(object)
|
||||
return resources
|
||||
|
||||
@classmethod
|
||||
def enable_editing_work_calendar_times(cls, work_calendar):
|
||||
props = bpy.context.scene.BIMWorkCalendarProperties
|
||||
|
||||
Reference in New Issue
Block a user