update labels and add settings tips

This commit is contained in:
Mustafa-Zarkash 2023-09-29 19:32:08 +03:00
parent 2af978342d
commit 82b2bd4b45
5 changed files with 16 additions and 6 deletions

View file

@ -789,7 +789,7 @@ def update_houdini_vars_context():
template_data
)
if item["is_dir_path"]:
if item["is_directory"]:
item_value = item_value.replace("\\", "/")
try:
os.makedirs(item_value)

View file

@ -6,7 +6,7 @@
{
"var": "JOB",
"value": "{root[work]}/{project[name]}/{hierarchy}/{asset}/work/{task[name]}",
"is_dir_path": true
"is_directory": true
}
]
}

View file

@ -17,6 +17,10 @@
"key": "enabled",
"label": "Enabled"
},
{
"type": "label",
"label": "Houdini Vars.<br>If a value is treated as a directory on update it will be ensured the folder exists"
},
{
"type": "list",
"key": "houdini_vars",
@ -37,8 +41,8 @@
},
{
"type": "boolean",
"key": "is_dir_path",
"label": "is Dir Path"
"key": "is_directory",
"label": "Treat as directory"
}
]
}

View file

@ -6,10 +6,16 @@ class HoudiniVarModel(BaseSettingsModel):
_layout = "expanded"
var: str = Field("", title="Var")
value: str = Field("", title="Value")
is_dir_path: bool = Field(False, title="is Dir Path")
is_directory: bool = Field(False, title="Treat as directory")
class UpdateHoudiniVarcontextModel(BaseSettingsModel):
"""Houdini Vars Note.
If a value is treated as a directory on update
it will be ensured the folder exists.
"""
enabled: bool = Field(title="Enabled")
# TODO this was dynamic dictionary '{var: path}'
houdini_vars: list[HoudiniVarModel] = Field(
@ -32,7 +38,7 @@ DEFAULT_GENERAL_SETTINGS = {
{
"var": "JOB",
"value": "{root[work]}/{project[name]}/{hierarchy}/{asset}/work/{task[name]}", # noqa
"is_dir_path": True
"is_directory": True
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After