@@ -1658,6 +1658,7 @@ class BIM_PT_bcf(Panel):
16581658 def draw (self , context ):
16591659 layout = self .layout
16601660 layout .use_property_split = True
1661+ layout .use_property_decorate = False
16611662
16621663 scene = context .scene
16631664 props = bpy .context .scene .BCFProperties
@@ -1682,96 +1683,130 @@ def draw(self, context):
16821683 row .template_list ("BIM_UL_topics" , "" , props , "topics" , props , "active_topic_index" )
16831684 col = row .column (align = True )
16841685 col .operator ("bim.add_bcf_topic" , icon = "ADD" , text = "" )
1686+ if props .active_topic_index < len (props .topics ):
1687+ topic = props .topics [props .active_topic_index ]
1688+ col .prop (topic , "is_editable" , icon = "CHECKMARK" if topic .is_editable else "GREASEPENCIL" , icon_only = True )
16851689
16861690 if props .active_topic_index < len (props .topics ):
16871691 topic = props .topics [props .active_topic_index ]
16881692 row = layout .row ()
1693+ row .enabled = topic .is_editable
16891694 row .prop (topic , "description" , text = "" )
16901695
16911696 row = layout .row ()
16921697 row .prop (topic , "viewpoints" )
16931698 row .operator ("bim.activate_bcf_viewpoint" , icon = "SCENE" , text = "" )
16941699
16951700 col = layout .column (align = True )
1696- col .prop (topic , "type" )
1697- col .prop (topic , "status" )
1698- col .prop (topic , "priority" )
1699- col .prop (topic , "stage" )
1700- col .prop (topic , "assigned_to" )
1701- col .prop (topic , "due_date" )
1701+ if topic .type :
1702+ col .prop (topic , "type" , emboss = topic .is_editable )
1703+ if topic .status :
1704+ col .prop (topic , "status" , emboss = topic .is_editable )
1705+ if topic .priority :
1706+ col .prop (topic , "priority" , emboss = topic .is_editable )
1707+ if topic .stage :
1708+ col .prop (topic , "stage" , emboss = topic .is_editable )
1709+ if topic .assigned_to :
1710+ col .prop (topic , "assigned_to" , emboss = topic .is_editable )
1711+ if topic .due_date :
1712+ col .prop (topic , "due_date" , emboss = topic .is_editable )
17021713
17031714 col = layout .column (align = True )
1704- col .enabled = False
1705- col .prop (topic , "creation_date" )
1706- col .prop (topic , "creation_author" )
1707- col .prop (topic , "modified_date" )
1708- col .prop (topic , "modified_author" )
1709-
1710- bcfxml = bcfstore .BcfStore .get_bcfxml ()
1711- bcf_topic = bcfxml .topics [topic .name ]
1712-
1713- if bcf_topic .header :
1714- layout .label (text = "Header Files:" )
1715- for index , f in enumerate (bcf_topic .header .files ):
1716- box = self .layout .box ()
1717- row = box .row (align = True )
1718- row .label (text = f .filename , icon = "FILE_BLANK" )
1719- if f .is_external :
1720- row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = f .reference
1721- else :
1722- op = row .operator ("bim.open_uri" , icon = "FILE_FOLDER" , text = "" )
1723- op .uri = os .path .join (bcfxml .filepath , topic .name , f .reference )
1724- box .label (text = f .date )
1725- #box.label(text=f.ifc_project)
1726- #box.label(text=f.ifc_spatial_structure_element)
1727-
1728- if topic .reference_links :
1729- layout .label (text = "Reference Links:" )
1730- for index , link in enumerate (topic .reference_links ):
1731- row = layout .row (align = True )
1732- row .prop (link , "name" )
1733- row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = link .name
1715+ if topic .modified_date :
1716+ col .prop (topic , "modified_date" , emboss = False )
1717+ col .prop (topic , "modified_author" , emboss = False )
1718+ else :
1719+ col .prop (topic , "creation_date" , emboss = False )
1720+ col .prop (topic , "creation_author" , emboss = False )
17341721
1735- if topic .labels :
1736- layout .label (text = "Labels:" )
1737- for index , label in enumerate (topic .labels ):
1738- row = layout .row (align = True )
1739- row .prop (label , "name" , text = "" )
17401722
1741- if topic .bim_snippet .schema :
1742- layout .label (text = "BIM Snippet:" )
1723+ class BIM_PT_bcf_metadata (Panel ):
1724+ bl_label = "BCF Metadata"
1725+ bl_idname = "BIM_PT_bcf_metadata"
1726+ bl_options = {"DEFAULT_CLOSED" }
1727+ bl_space_type = "PROPERTIES"
1728+ bl_region_type = "WINDOW"
1729+ bl_context = "scene"
1730+ bl_parent_id = "BIM_PT_bcf"
1731+
1732+ def draw (self , context ):
1733+ layout = self .layout
1734+ layout .use_property_split = True
1735+ layout .use_property_decorate = False
1736+
1737+ scene = context .scene
1738+ props = bpy .context .scene .BCFProperties
1739+
1740+ if props .active_topic_index >= len (props .topics ):
1741+ layout .label (text = "No BCF project is loaded" )
1742+ return
1743+
1744+ topic = props .topics [props .active_topic_index ]
1745+ bcfxml = bcfstore .BcfStore .get_bcfxml ()
1746+ bcf_topic = bcfxml .topics [topic .name ]
1747+
1748+ if bcf_topic .header :
1749+ layout .label (text = "Header Files:" )
1750+ for index , f in enumerate (bcf_topic .header .files ):
1751+ box = self .layout .box ()
1752+ row = box .row (align = True )
1753+ row .label (text = f .filename , icon = "FILE_BLANK" )
1754+ if f .is_external :
1755+ row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = f .reference
1756+ else :
1757+ op = row .operator ("bim.open_uri" , icon = "FILE_FOLDER" , text = "" )
1758+ op .uri = os .path .join (bcfxml .filepath , topic .name , f .reference )
1759+ box .label (text = f .date )
1760+ #box.label(text=f.ifc_project)
1761+ #box.label(text=f.ifc_spatial_structure_element)
1762+
1763+ if topic .reference_links :
1764+ layout .label (text = "Reference Links:" )
1765+ for index , link in enumerate (topic .reference_links ):
17431766 row = layout .row (align = True )
1744- row .prop (topic .bim_snippet , "type" )
1745- if topic .bim_snippet .schema :
1746- row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = topic .bim_snippet .schema
1767+ row .prop (link , "name" )
1768+ row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = link .name
17471769
1770+ if topic .labels :
1771+ layout .label (text = "Labels:" )
1772+ for index , label in enumerate (topic .labels ):
17481773 row = layout .row (align = True )
1749- row .prop (topic .bim_snippet , "reference" )
1750- if topic .bim_snippet .is_external :
1751- row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = topic .bim_snippet .reference
1774+ row .prop (label , "name" , text = "" )
1775+
1776+ if topic .bim_snippet .schema :
1777+ layout .label (text = "BIM Snippet:" )
1778+ row = layout .row (align = True )
1779+ row .prop (topic .bim_snippet , "type" )
1780+ if topic .bim_snippet .schema :
1781+ row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = topic .bim_snippet .schema
1782+
1783+ row = layout .row (align = True )
1784+ row .prop (topic .bim_snippet , "reference" )
1785+ if topic .bim_snippet .is_external :
1786+ row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = topic .bim_snippet .reference
1787+ else :
1788+ op = row .operator ("bim.open_uri" , icon = "FILE_FOLDER" , text = "" )
1789+ op .uri = os .path .join (bcfxml .filepath , topic .name , topic .bim_snippet .reference )
1790+
1791+ if topic .document_references :
1792+ layout .label (text = "Document References:" )
1793+ for index , doc in enumerate (topic .document_references ):
1794+ box = self .layout .box ()
1795+ row = box .row (align = True )
1796+ row .prop (doc , "reference" )
1797+ if doc .is_external :
1798+ row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = doc .reference
17521799 else :
17531800 op = row .operator ("bim.open_uri" , icon = "FILE_FOLDER" , text = "" )
1754- op .uri = os .path .join (bcfxml .filepath , topic .name , topic .bim_snippet .reference )
1755-
1756- if topic .document_references :
1757- layout .label (text = "Document References:" )
1758- for index , doc in enumerate (topic .document_references ):
1759- box = self .layout .box ()
1760- row = box .row (align = True )
1761- row .prop (doc , "reference" )
1762- if doc .is_external :
1763- row .operator ("bim.open_uri" , icon = "URL" , text = "" ).uri = doc .reference
1764- else :
1765- op = row .operator ("bim.open_uri" , icon = "FILE_FOLDER" , text = "" )
1766- op .uri = os .path .join (bcfxml .filepath , topic .name , doc .reference )
1767- row = box .row (align = True )
1768- row .prop (doc , "description" )
1801+ op .uri = os .path .join (bcfxml .filepath , topic .name , doc .reference )
1802+ row = box .row (align = True )
1803+ row .prop (doc , "description" )
17691804
1770- if topic .related_topics :
1771- layout .label (text = "Related Topics:" )
1772- for related_topic in topic .related_topics :
1773- row = layout .row (align = True )
1774- row .operator ("bim.view_bcf_topic" , text = related_topic .name ).topic_guid = related_topic .name
1805+ if topic .related_topics :
1806+ layout .label (text = "Related Topics:" )
1807+ for related_topic in topic .related_topics :
1808+ row = layout .row (align = True )
1809+ row .operator ("bim.view_bcf_topic" , text = related_topic .name ).topic_guid = related_topic .name
17751810
17761811
17771812class BIM_PT_bcf_comments (Panel ):
@@ -1786,6 +1821,7 @@ class BIM_PT_bcf_comments(Panel):
17861821 def draw (self , context ):
17871822 layout = self .layout
17881823 layout .use_property_split = True
1824+ layout .use_property_decorate = False
17891825
17901826 scene = context .scene
17911827 props = bpy .context .scene .BCFProperties
0 commit comments