forked from lookbothways/vfxTools
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathattachShaders
More file actions
43 lines (25 loc) · 781 Bytes
/
Copy pathattachShaders
File metadata and controls
43 lines (25 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#CURRENTLY UNFINISHED
""" Attach shaders to alembic by matching geo to shaders (by name)
"""
import maya.cmds as cmds
import sets
# Get all geo called claws
shaderNames = []
selected = cmds.ls(sl=True)
shaderNames = []
noNC = ""
for i in selected:
object = str(i)
# Gets the shader attached to the object
shaders = cmds.listConnections(cmds.listHistory(i,f=1),type='shadingEngine')
print shaders
#remove duplicates using sets.Set
removeDuplicates = sets.Set(shaders)
import renameShadingNodes
reload(renameShadingNodes)
renameShadingNodes.renameShadingNodes()
for x in selectedShaders:
if "_aiStandardSurface" in x and "SG" :
noNC = str(x).split(':', 1)[-1]
shaderNames.append(noNC)
print shaderNames