fix validator message

This commit is contained in:
Ondrej Samohel 2022-03-31 10:13:13 +02:00
parent 053748ac23
commit 34f5f7d60c
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 6 additions and 3 deletions

View file

@ -3,7 +3,7 @@
<error id="main">
<title>Invalid texture name</title>
<description>
## Source files not found
## Invalid file name
Submitted file has invalid name:
'{invalid_file}'
@ -11,7 +11,7 @@ Submitted file has invalid name:
### How to repair?
Texture file must adhere to naming conventions for Unreal:
T_[ASSET_NAME}_*.ext
T_{asset}_*.ext
</description>
</error>
</root>

View file

@ -20,4 +20,7 @@ class ValidateSimpleUnrealTextureNaming(pyblish.api.InstancePlugin):
if not re.match(pattern, file_name):
msg = f"Invalid file name {file_name}"
raise PublishXmlValidationError(
self, msg, formatting_data={"invalid_file": file_name})
self, msg, formatting_data={
"invalid_file": file_name,
"asset": instance.data.get("asset")
})