Implement support for adding BCF labels to topics

This commit is contained in:
Dion Moult
2020-12-28 12:46:52 +11:00
parent d5566785be
commit 3deba2e71e
4 changed files with 47 additions and 20 deletions
@@ -860,6 +860,25 @@ class AddBcfReferenceLink(bpy.types.Operator):
return {"FINISHED"}
class AddBcfLabel(bpy.types.Operator):
bl_idname = "bim.add_bcf_label"
bl_label = "Add BCF Label"
def execute(self, context):
bcfxml = bcfstore.BcfStore.get_bcfxml()
props = bpy.context.scene.BCFProperties
blender_topic = props.topics[props.active_topic_index]
topic = bcfxml.topics[blender_topic.name]
if not blender_topic.label:
return {"FINISHED"}
new = blender_topic.labels.add()
new.name = blender_topic.label
topic.labels.append(blender_topic.label)
bcfxml.edit_topic(topic)
blender_topic.label = ""
return {"FINISHED"}
class EditBcfReferenceLinks(bpy.types.Operator):
bl_idname = "bim.edit_bcf_reference_links"
bl_label = "Edit BCF Reference Link"