BBIM Parametric psets - show warning when user edits them manually

as they are not intended to be edited manually but through the special ui

example - https://i.imgur.com/nsuy0I0.png
This commit is contained in:
Andrej730
2024-09-23 12:48:25 +05:00
parent 2b35e5fb91
commit c6c9f400d3
2 changed files with 16 additions and 1 deletions
+8 -1
View File
@@ -151,10 +151,17 @@ def draw_psetqto_ui(
remove_pset_row.enabled = allow_removing
if pset["is_expanded"]:
if props.active_pset_id == pset_id:
is_parametric_pset = props.active_pset_name in tool.Model.BBIM_PARAMETRIC_PSETS
if is_parametric_pset:
box_ = box.box()
box_.alert = True
box_.label(text="Warning! This pset should not be edited directly", icon="ERROR")
box_.label(text="and should be edited from Parametric Geometry UI.")
for prop in props.properties:
draw_psetqto_editable_ui(box, props, prop)
if not props.active_pset_has_template:
if not props.active_pset_has_template and not is_parametric_pset:
row = box.row(align=True)
row.prop(props, "prop_name", text="")
row.prop(props, "prop_value", text="")
+8
View File
@@ -846,6 +846,14 @@ class Model(bonsai.core.tool.Model):
AuthoringData.type_thumbnails[element.id()] = obj.preview.icon_id
BBIM_PARAMETRIC_PSETS = (
"BBIM_Window",
"BBIM_Door",
"BBIM_Roof",
"BBIM_Railing",
"BBIM_Stair",
)
@classmethod
def get_modeling_bbim_pset_data(cls, object, pset_name):
"""get modelling BBIM pset data (eg, BBIM_Roof) and loads it's `Data` as json to `data_dict`"""