mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
finishing code for future testing
This commit is contained in:
parent
ac3ed4dd71
commit
394054e6d5
1 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,7 @@
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
|
|
||||||
|
import maya.cmds as cmds
|
||||||
|
|
||||||
import pyblish.api
|
import pyblish.api
|
||||||
import colorbleed.api
|
import colorbleed.api
|
||||||
|
|
@ -21,9 +24,15 @@ class ValidateFileNameConvention(pyblish.api.InstancePlugin):
|
||||||
# todo: change pattern to company standard
|
# todo: change pattern to company standard
|
||||||
pattern = re.compile("[a-zA-Z]+_[A-Z]{3}")
|
pattern = re.compile("[a-zA-Z]+_[A-Z]{3}")
|
||||||
|
|
||||||
nodes = list(instance)
|
nodes = cmds.ls(instance, type="file")
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
match = pattern.match(node)
|
# get texture path
|
||||||
|
texture = cmds.getAttr("{}.fileTextureName".format(node))
|
||||||
|
if not texture:
|
||||||
|
self.log.error("")
|
||||||
|
invalid.append(node)
|
||||||
|
filename = os.path.split(os.path.basename(texture))[0]
|
||||||
|
match = pattern.match(filename)
|
||||||
if not match:
|
if not match:
|
||||||
invalid.append(node)
|
invalid.append(node)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue