Skip to content

Commit

Permalink
hide old properties instead of removing it
Browse files Browse the repository at this point in the history
  • Loading branch information
shaise committed Dec 8, 2024
1 parent a464a35 commit b6779ed
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions SheetMetalTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,14 @@ def smAddProperty(obj, proptype, name, proptip, defval=None,
obj.addProperty(proptype, name, paramgroup, proptip)
if defval is not None:
setattr(obj, name, defval)
# replaced name is either given or automatically search for
# old lower case version of the same parameter
if replacedname is None and name[0].isupper():
replacedname = name[0].lower() + name[1:]
if replacedname is not None and hasattr(obj, replacedname):
setattr(obj, name, getattr(obj, replacedname))
obj.removeProperty(replacedname)
# replaced name is either given or automatically search for
# old lower case version of the same parameter
if replacedname is None and name[0].isupper():
replacedname = name[0].lower() + name[1:]
if replacedname is not None and hasattr(obj, replacedname):
setattr(obj, name, getattr(obj, replacedname))
#obj.removeProperty(replacedname)
obj.setEditorMode(replacedname, 2) # Hide



Expand Down

0 comments on commit b6779ed

Please sign in to comment.