@@ -151,9 +151,10 @@ def duplicate_variable(self, __data, __index):
151151 unique_hash = '' .join (random .choices (string .ascii_lowercase + string .digits , k = 3 ))
152152 if name .endswith ('_start' ):
153153 name = f"hammer5tools_category_{ unique_hash } _start"
154+ self .add_category (name , __data [3 ], __data [4 ], __index )
154155 elif name .endswith ('_end' ):
155156 name = f"hammer5tools_category_{ unique_hash } _end"
156- self .add_category (name , __data [ 3 ] , __data [4 ], __index )
157+ self .add_category (name , False , __data [4 ], __index )
157158 else :
158159 # For regular variables, unique name generation is handled on focus out,
159160 # but let's make it unique initially to avoid collision.
@@ -210,6 +211,8 @@ def add_new_variable(self):
210211 self ._sync_committed_state ()
211212
212213 def add_category (self , name , var_visible_in_editor , var_display_name , index = None , expanded = True ):
214+ if name .endswith ('_end' ):
215+ var_visible_in_editor = False
213216 category = CategoryFrame (
214217 name = name ,
215218 var_visible_in_editor = var_visible_in_editor ,
@@ -253,7 +256,7 @@ def add_new_category(self):
253256 self .add_category (start_name , var_visible , f" ----===={ display_name } ===------" )
254257 # Add End
255258 end_name = f"hammer5tools_category_{ unique_hash } _end"
256- self .add_category (end_name , var_visible , " " )
259+ self .add_category (end_name , False , " " )
257260
258261 new_state = self ._snapshot ()
259262 from src .editors .smartprop_editor .commands import VariablesSnapshotCommand
0 commit comments