@@ -261,6 +261,16 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn
261261 row .prop (item , "finish" , emboss = False , text = "" )
262262 row .prop (item , "duration" , emboss = False , text = "" )
263263
264+ if context .active_object :
265+ oprops = context .active_object .BIMObjectProperties
266+ row = layout .row (align = True )
267+ if oprops .ifc_definition_id in Data .tasks [item .ifc_definition_id ]["RelatingProducts" ]:
268+ op = row .operator ("bim.unassign_product" , text = "" , icon = "KEYFRAME_HLT" , emboss = False )
269+ op .task = item .ifc_definition_id
270+ else :
271+ op = row .operator ("bim.assign_product" , text = "" , icon = "KEYFRAME" , emboss = False )
272+ op .task = item .ifc_definition_id
273+
264274 if props .active_task_id == item .ifc_definition_id :
265275 if props .active_task_time_id :
266276 row .operator ("bim.edit_task_time" , text = "" , icon = "CHECKMARK" )
@@ -293,5 +303,3 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn
293303 row .operator ("bim.enable_editing_task" , text = "" , icon = "GREASEPENCIL" ).task = item .ifc_definition_id
294304 row .operator ("bim.add_task" , text = "" , icon = "ADD" ).task = item .ifc_definition_id
295305 row .operator ("bim.remove_task" , text = "" , icon = "X" ).task = item .ifc_definition_id
296- row = layout .row (align = True )
297- row .operator ("bim.assign_product" , text = "ADD" , icon = "OUTLINER_COLLECTION" ).task = item .ifc_definition_id
0 commit comments