bonsai bcf - remove "bim.edit_bcf_author"

bcfxml doesn't actually have "author" field - this field is not stored in bcf, it's just needed as an UI for author for newly added comments and topics.
This commit is contained in:
Andrej730
2024-08-20 15:39:11 +05:00
parent d1f87d5467
commit fee56fc120
3 changed files with 5 additions and 24 deletions
@@ -32,7 +32,6 @@ classes = (
operator.AddBcfViewpoint,
operator.BCFFileHandlerOperator,
operator.BIM_FH_import_bcf,
operator.EditBcfAuthor,
operator.EditBcfComment,
operator.EditBcfLabels,
operator.EditBcfProjectName,
@@ -269,23 +269,6 @@ class EditBcfProjectName(bpy.types.Operator):
return {"FINISHED"}
class EditBcfAuthor(bpy.types.Operator):
bl_idname = "bim.edit_bcf_author"
bl_label = "Edit BCF Author"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
bcfxml = bcfstore.BcfStore.get_bcfxml()
assert bcfxml
if not (version := (bcfxml.version.version_id or "")).startswith("2"):
self.report({"INFO"}, f"BCF {version} is not yet supported: {self.bl_rna.bl_idname}.")
return {"FINISHED"}
bcfxml.author = context.scene.BCFProperties.author
return {"FINISHED"}
class EditBcfTopicName(bpy.types.Operator):
bl_idname = "bim.edit_bcf_topic_name"
bl_label = "Edit BCF Topic Name"
+5 -6
View File
@@ -59,11 +59,6 @@ def updateBcfProjectName(self, context):
bpy.ops.bim.edit_bcf_project_name()
def updateBcfAuthor(self, context):
if bcfstore.BcfStore.get_bcfxml():
bpy.ops.bim.edit_bcf_author()
def updateBcfTopicName(self, context):
if bcfstore.BcfStore.get_bcfxml():
bpy.ops.bim.edit_bcf_topic_name()
@@ -208,7 +203,11 @@ class BCFProperties(PropertyGroup):
bcf_file: StringProperty(name="BCF File")
comment_text_width: IntProperty(name="Comment Text Width", default=40)
name: StringProperty(default="", name="Project Name", update=updateBcfProjectName)
author: StringProperty(default="john@doe.com", name="Author Email", update=updateBcfAuthor)
author: StringProperty(
default="john@doe.com",
name="Author Email",
description="Author name that will be used for added comments, topics",
)
topics: CollectionProperty(name="BCF Topics", type=BcfTopic)
active_topic_index: IntProperty(name="Active BCF Topic Index", update=refreshBcfTopic)
file_reference: StringProperty(default="", name="Reference")