mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +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 os
|
||||
|
||||
import maya.cmds as cmds
|
||||
|
||||
import pyblish.api
|
||||
import colorbleed.api
|
||||
|
|
@ -21,9 +24,15 @@ class ValidateFileNameConvention(pyblish.api.InstancePlugin):
|
|||
# todo: change pattern to company standard
|
||||
pattern = re.compile("[a-zA-Z]+_[A-Z]{3}")
|
||||
|
||||
nodes = list(instance)
|
||||
nodes = cmds.ls(instance, type="file")
|
||||
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:
|
||||
invalid.append(node)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue