-
Notifications
You must be signed in to change notification settings - Fork 0
/
importNodeFromKatanaLookVarient.py
79 lines (40 loc) · 1.74 KB
/
importNodeFromKatanaLookVarient.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import NodegraphAPI
from Katana import KatanaFile
import os
# import NodegraphAPI
# node = NodegraphAPI.GetNode("Dot")
# ff =NodegraphAPI.BuildNodegraphXmlIO()
# for x in ff:
# print ff
# import sys
# for x,y in sys.modules.items():
# print x,y
# NodegraphAPI.Util.GetAllConnectedInputs([node])
# graphUtil = NodegraphAPI.Util
# help(graphUtil)
# from Katana import KatanaFile
# for n in NodegraphAPI.Util.GetAllConnectedInputs([node]):
# if n.getParent() == NodegraphAPI.GetRootNode():
# print n
# path = r"Z:\wzrylan\assets\char\c001006cwjkb\surface\look\main\ok\c001006cwjkb_look_main.katana"
# nodes = KatanaFile.Import(path,True)
# node = [n for n in nodes if node.getName() == "Dot"]
# topNodeBeforeDot = []
# nn =NodegraphAPI.GetNode("cloth_kuabao2")
# xmlTree = NodegraphAPI.BuildNodesXmlIO(NodegraphAPI.GetAllSelectedNodes())
# rootNode = NodegraphAPI.GetRootNode()
# node = KatanaFile.Paste(xmlTree, rootNode)
# outputs = NodegraphAPI.Util.GetAllConnectedOutputs([nn])
# root_group = NodegraphAPI.GetNode("Group")
# output_top = [n for n in outputs if n.getParent() == root_group]
# [n for n in NodegraphAPI.GetAllNodesByType("Backdrop",) if n.getParent() == root_group]
def getUsefullNodeFromLookVarientFile(file_path):
if file_path and os.path.isfile(file_path) and file_path.endswith(".katana"):
# 导入文件
# 创建一个临时储存位置
root = NodegraphAPI.GetRootNode()
temp_group = NodegraphAPI.CreateNode('Group', root)
fileNodes = KatanaFile.import(file_path,False,temp_group)
# 过滤有用的节点
# materials 节点
# 属性设置节点