mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
flame: distribute better value types
This commit is contained in:
parent
48ce34c58e
commit
d867b872a8
1 changed files with 14 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin):
|
|||
xml_preset_attrs_from_comments = {
|
||||
"width": "number",
|
||||
"height": "number",
|
||||
"pixelRatio": "number",
|
||||
"pixelRatio": "float",
|
||||
"resizeType": "string",
|
||||
"resizeFilter": "string"
|
||||
}
|
||||
|
|
@ -183,11 +183,14 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
for a_name, a_type in self.xml_preset_attrs_from_comments.items():
|
||||
# exclude all not related attributes
|
||||
if a_name.lower() not in key:
|
||||
if a_name.lower() not in key.lower():
|
||||
continue
|
||||
|
||||
# get pattern defined by type
|
||||
pattern = TXT_PATERN if "string" in a_type else NUM_PATERN
|
||||
pattern = TXT_PATERN
|
||||
if "number" in a_type or "float" in a_type:
|
||||
pattern = NUM_PATERN
|
||||
|
||||
res_goup = pattern.findall(value)
|
||||
|
||||
# raise if nothing is found as it is not correctly defined
|
||||
|
|
@ -196,7 +199,14 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin):
|
|||
"Value for `{}` attribute is not "
|
||||
"set correctly: `{}`").format(a_name, split))
|
||||
|
||||
attributes["xml_overrides"][a_name] = res_goup[0]
|
||||
if "string" in a_type:
|
||||
_value = res_goup[0]
|
||||
if "float" in a_type:
|
||||
_value = float(res_goup[0])
|
||||
if "number" in a_type:
|
||||
_value = int(res_goup[0])
|
||||
|
||||
attributes["xml_overrides"][a_name] = _value
|
||||
|
||||
# condition for resolution in key
|
||||
if "resolution" in key.lower():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue