|
3 | 3 | BoolVectorProperty, PointerProperty, CollectionProperty,EnumProperty)
|
4 | 4 | from bpy.types import (PropertyGroup, UIList,AddonPreferences)
|
5 | 5 |
|
6 |
| -from . functions import ( enum_sockets_cb, auto_mode_up, ch_sockets_up, enum_sockets_up, manual_up, |
7 |
| - split_rgb_up, line_on_up, get_name_up,set_name_up, |
8 |
| - get_line_bools,set_line_bools,get_line_vals,set_line_vals) |
9 |
| - |
10 |
| -from . propertygroups import (StmProps, NodesLinks, ShaderLinks) |
11 |
| - |
12 |
| - |
13 |
| -class StmChannelSocket(PropertyGroup): |
14 |
| - input_sockets: EnumProperty( |
15 |
| - name="Input socket", |
16 |
| - description="Target shader input sockets for this texture node.\ |
17 |
| - \n Selected automaticaly if -Detect target socket- is enabled", |
18 |
| - items=enum_sockets_cb, |
19 |
| - update=ch_sockets_up |
20 |
| - ) |
21 |
| - line_name: StringProperty( |
22 |
| - name="Color", |
23 |
| - description="name of the line owning this instance", |
24 |
| - default="Select a name" |
25 |
| - ) |
26 |
| - |
27 |
| - |
28 |
| -class StmChannelSockets(PropertyGroup): |
29 |
| - socket: CollectionProperty(type=StmChannelSocket) |
30 |
| - |
31 |
| - |
32 |
| -class StmPanelLines(PropertyGroup): |
33 |
| - name: StringProperty( |
34 |
| - name="name", |
35 |
| - description="Keyword identifier of the texture map to import", |
36 |
| - get=get_name_up, |
37 |
| - set=set_name_up |
38 |
| - ) |
39 |
| - line_id: IntProperty() |
40 |
| - |
41 |
| - line_bools: BoolVectorProperty(get=get_line_bools,set=set_line_bools,size=4) |
42 |
| - line_vals: IntVectorProperty(get=get_line_vals,set=set_line_vals,size=4) |
43 |
| - |
44 |
| - channels: PointerProperty(type=StmChannelSockets) |
45 |
| - |
46 |
| - file_name: StringProperty( |
47 |
| - name="File", |
48 |
| - subtype='FILE_PATH', |
49 |
| - description="Complete filepath of the texture map", |
50 |
| - default="Select a file" |
51 |
| - ) |
52 |
| - auto_mode: BoolProperty( |
53 |
| - name="Detect target socket", |
54 |
| - description="Auto detect target shader socket", |
55 |
| - default=True, |
56 |
| - update=auto_mode_up |
57 |
| - ) |
58 |
| - input_sockets: EnumProperty( |
59 |
| - name="", |
60 |
| - description="Target shader input sockets for this texture node.\ |
61 |
| - \n Selected automaticaly if Autodetect sockets is enabled", |
62 |
| - items=enum_sockets_cb, |
63 |
| - update=enum_sockets_up |
64 |
| - ) |
65 |
| - file_is_real: BoolProperty( |
66 |
| - description="Associated file exists", |
67 |
| - default=False |
68 |
| - ) |
69 |
| - manual: BoolProperty( |
70 |
| - name='Overwrite file name', |
71 |
| - description="Manual mode switch", |
72 |
| - default=False, |
73 |
| - update=manual_up |
74 |
| - ) |
75 |
| - line_on: BoolProperty( |
76 |
| - name="Active", |
77 |
| - description="Enable/Disable line", |
78 |
| - default=True, |
79 |
| - update=line_on_up |
80 |
| - ) |
81 |
| - split_rgb: BoolProperty( |
82 |
| - name="Split rgb channels", |
83 |
| - description="Split the RGB channels of the target image \ |
84 |
| - to plug them into individual sockets", |
85 |
| - default=False, |
86 |
| - update=split_rgb_up |
87 |
| - ) |
88 |
| - |
89 |
| - |
90 |
| -class StmPanelLiner(PropertyGroup): |
91 |
| - textures: CollectionProperty(type=StmPanelLines) |
92 |
| - texture_index: IntProperty(default=0) |
93 |
| - |
94 |
| - |
95 |
| -class StmNodes(PropertyGroup): |
96 |
| - node_links: CollectionProperty(type=NodesLinks) |
97 |
| - node_index: IntProperty(default=0) |
98 |
| - |
99 |
| - |
100 |
| -class StmShaders(PropertyGroup): |
101 |
| - shader_links: CollectionProperty(type=ShaderLinks) |
102 |
| - shader_index: IntProperty(default=0) |
| 6 | +from . propertygroups import (StmProps, NodesLinks, ShaderLinks, StmChannelSocket,StmShaders, |
| 7 | + StmChannelSockets,StmPanelLines, StmPanelLiner, StmNodes) |
103 | 8 |
|
104 | 9 |
|
105 | 10 | class NODE_UL_stm_list(UIList):
|
@@ -137,17 +42,21 @@ class StmAddonPreferences(AddonPreferences):
|
137 | 42 | \n It will remain available in the File menu\
|
138 | 43 | > Import > Substance Textures and via \
|
139 | 44 | \n F3 Search > Import Surfacing Textures")
|
| 45 | + debug_results: BoolProperty( |
| 46 | + default=True, |
| 47 | + description="Show extension activity in Blender console") |
140 | 48 | props: bpy.props.PointerProperty(type=StmProps)
|
141 | 49 |
|
142 | 50 | def draw(self, context):
|
143 | 51 | layout = self.layout
|
144 | 52 | row = layout.row()
|
145 | 53 | row.prop(self.props, 'usr_dir',text="Textures folder:")
|
146 | 54 | row = layout.row()
|
147 |
| - row.operator('node.stm_surfacing_setup',text="Show Extension Panel") |
| 55 | + row.operator('node.stm_surfacing_setup',text="Show Substance Texture Importer Panel") |
148 | 56 | row = layout.row()
|
149 | 57 | row.label(text="Separator used for multi-sockets: ")
|
150 | 58 | row.split(factor=10)
|
151 | 59 | row.prop(self.props,'separators_list',text="")
|
152 |
| - layout.prop(self,'display_in_editor',text="Display shortcut button in Shader Nodes Editor") |
153 |
| - layout.prop(self,'display_in_properties',text="Display shortcut button in Material Properties") |
| 60 | + layout.prop(self,'display_in_editor',text="Display shortcut button in Shader Nodes Editor.") |
| 61 | + layout.prop(self,'display_in_properties',text="Display shortcut button in Material Properties.") |
| 62 | + layout.prop(self,'debug_results',text="Show output messages in console.") |
0 commit comments