-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclarisse_scripts.py
More file actions
122 lines (55 loc) · 3.71 KB
/
Copy pathclarisse_scripts.py
File metadata and controls
122 lines (55 loc) · 3.71 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
'''
script edit Clarisse Preferences samples :: Edit > Preferences
'''
import ix
#Color_Management :
ix.application.get_prefs(ix.api.AppPreferences.MODE_APPLICATION).set_bool_value("color_management", "use_ocio_config_file", True)
ix.application.get_prefs(ix.api.AppPreferences.MODE_APPLICATION).set_bool_value("color_management", "auto_detect_color_space", True)
ix.application.get_prefs(ix.api.AppPreferences.MODE_APPLICATION).set_string_value("color_management", "ocio_config_file", "C:/config.ocio")
ix.application.get_prefs(ix.api.AppPreferences.MODE_APPLICATION).set_preset_value("color_management", "scene_color_space", "ACES|ACES - ACEScg")
ix.application.get_prefs(ix.api.AppPreferences.MODE_APPLICATION).set_preset_value("color_management", "default_display_color_space", "Output|Output - sRGB")
#Clarisse Command Port :
ix.application.get_prefs(ix.api.AppPreferences.MODE_APPLICATION).set_bool_value("command_port", "enabled",True)
ix.application.get_prefs(ix.api.AppPreferences.MODE_APPLICATION).set_long_value("command_port", "port",55000)
#=================================================================================================================
#=================================================================================================================
#=================================================================================================================
"""
select all Texture Nodes in the scene
"""
import ix
item_List = ix.api.OfObjectArray() # Make empty object list
ix.application.get_factory().get_all_objects("ProjectItem", item_List) # assign all scene nodes to item_List
selection = []
for i in range(item_List.get_count()):
"""
filter all items in the scene , add just "TextureStreamedMapFile,TextureMapFile,TextureMap" to selection list
"""
if item_List[i].is_kindof("TextureStreamedMapFile") == True or item_List[i].is_kindof("TextureMapFile") or item_List[i].is_kindof("TextureMap"):
"""
Check if the node is Texture Node
"""
selection.append(item_List[i]) # append to selection list
ix.application.get_selection().set_selection('global','Global',selection[0] ) # select first item in selection list
for sel in range(len(selection)-1):
"""
range(len(selection)-1) to extract first item in the selection list that already selected and append the rest of items to this one
"""
ix.application.get_selection().add_item('global',selection[sel+1],'Global') # select all items
#=================================================================================================================
#=================================================================================================================
#=================================================================================================================
"""
form all texture nodes in the scene get attribute and name
"""
import ix
objectList = ix.api.OfObjectArray() # the item that will contain all our objects
ix.application.get_factory().get_all_objects("ProjectItem", objectList) # this function fill the objectList
for i in range(objectList.get_count()):
if objectList[i].is_kindof("TextureStreamedMapFile") == True or objectList[i].is_kindof("TextureMapFile") or objectList[i].is_kindof("TextureMap"):
obj_full_name = objectList[i].get_full_name()
obj_attr = objectList[i].get_attribute("filename").get_string()
print obj_name , ":" , obj_attr
###################################################################################################
#get scene variables, Ex:'_renderPath'
ix.application.get_factory().get_vars().get("_renderPath").get_string()