sketchup-api-stubs 0.7.9 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +157 -151
- data/lib/sketchup-api-stubs/stubs/Array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +182 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +111 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +423 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +693 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +535 -509
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +500 -476
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +267 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +133 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +547 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +678 -693
- data/lib/sketchup-api-stubs/stubs/Geom.rb +351 -351
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -595
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +751 -747
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb +234 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +683 -517
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +464 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +614 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +282 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +458 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +346 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -82
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +714 -692
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1565 -1519
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/Length.rb +286 -278
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +196 -144
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +226 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +145 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +294 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +296 -302
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +473 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -121
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +673 -659
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +600 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +252 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +443 -449
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +167 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +403 -406
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -397
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1282 -1239
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +519 -545
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environment.rb +406 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environments.rb +185 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb +113 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +122 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +1006 -937
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +740 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +289 -282
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +64 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +405 -468
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +432 -406
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +307 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +332 -326
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +380 -422
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +409 -427
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +241 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +55 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -114
- data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1115 -414
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +330 -317
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1714 -1652
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +372 -357
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +133 -130
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -271
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +463 -490
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +104 -116
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +939 -797
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +388 -361
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +501 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +385 -361
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +451 -458
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +211 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +259 -255
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/Snap.rb +125 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +88 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +263 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +283 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +199 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +924 -834
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +143 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1566 -1311
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +71 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1429 -1377
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +399 -389
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +580 -494
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +280 -269
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +258 -241
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +636 -635
- data/lib/sketchup-api-stubs/stubs/UI.rb +791 -683
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -303
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +10 -24
|
@@ -1,414 +1,1115 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
2
|
-
# License:: The MIT License (MIT)
|
|
3
|
-
|
|
4
|
-
# The Material class represents a
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
# face
|
|
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
|
-
#
|
|
123
|
-
#
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
#
|
|
129
|
-
#
|
|
130
|
-
#
|
|
131
|
-
#
|
|
132
|
-
#
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
#
|
|
137
|
-
#
|
|
138
|
-
#
|
|
139
|
-
#
|
|
140
|
-
#
|
|
141
|
-
#
|
|
142
|
-
#
|
|
143
|
-
#
|
|
144
|
-
# @
|
|
145
|
-
#
|
|
146
|
-
#
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
#
|
|
151
|
-
#
|
|
152
|
-
#
|
|
153
|
-
#
|
|
154
|
-
#
|
|
155
|
-
#
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
#
|
|
160
|
-
#
|
|
161
|
-
# @
|
|
162
|
-
#
|
|
163
|
-
#
|
|
164
|
-
#
|
|
165
|
-
# @
|
|
166
|
-
#
|
|
167
|
-
# @
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
#
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
#
|
|
176
|
-
#
|
|
177
|
-
#
|
|
178
|
-
#
|
|
179
|
-
#
|
|
180
|
-
#
|
|
181
|
-
#
|
|
182
|
-
#
|
|
183
|
-
#
|
|
184
|
-
#
|
|
185
|
-
#
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
#
|
|
190
|
-
#
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
#
|
|
195
|
-
#
|
|
196
|
-
#
|
|
197
|
-
#
|
|
198
|
-
# material =
|
|
199
|
-
#
|
|
200
|
-
#
|
|
201
|
-
#
|
|
202
|
-
#
|
|
203
|
-
#
|
|
204
|
-
#
|
|
205
|
-
#
|
|
206
|
-
#
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
#
|
|
214
|
-
#
|
|
215
|
-
#
|
|
216
|
-
#
|
|
217
|
-
#
|
|
218
|
-
#
|
|
219
|
-
#
|
|
220
|
-
#
|
|
221
|
-
#
|
|
222
|
-
#
|
|
223
|
-
#
|
|
224
|
-
#
|
|
225
|
-
#
|
|
226
|
-
# @
|
|
227
|
-
#
|
|
228
|
-
# @version SketchUp
|
|
229
|
-
def
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
#
|
|
233
|
-
#
|
|
234
|
-
#
|
|
235
|
-
#
|
|
236
|
-
#
|
|
237
|
-
#
|
|
238
|
-
#
|
|
239
|
-
#
|
|
240
|
-
#
|
|
241
|
-
#
|
|
242
|
-
#
|
|
243
|
-
#
|
|
244
|
-
#
|
|
245
|
-
#
|
|
246
|
-
#
|
|
247
|
-
#
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
#
|
|
252
|
-
#
|
|
253
|
-
#
|
|
254
|
-
#
|
|
255
|
-
#
|
|
256
|
-
#
|
|
257
|
-
# @
|
|
258
|
-
#
|
|
259
|
-
#
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
#
|
|
264
|
-
#
|
|
265
|
-
#
|
|
266
|
-
#
|
|
267
|
-
#
|
|
268
|
-
#
|
|
269
|
-
#
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
# The {
|
|
274
|
-
#
|
|
275
|
-
#
|
|
276
|
-
#
|
|
277
|
-
#
|
|
278
|
-
#
|
|
279
|
-
#
|
|
280
|
-
#
|
|
281
|
-
#
|
|
282
|
-
#
|
|
283
|
-
# @
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
#
|
|
288
|
-
#
|
|
289
|
-
#
|
|
290
|
-
#
|
|
291
|
-
#
|
|
292
|
-
#
|
|
293
|
-
#
|
|
294
|
-
#
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
#
|
|
299
|
-
#
|
|
300
|
-
#
|
|
301
|
-
#
|
|
302
|
-
#
|
|
303
|
-
#
|
|
304
|
-
#
|
|
305
|
-
#
|
|
306
|
-
# @
|
|
307
|
-
#
|
|
308
|
-
#
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
#
|
|
313
|
-
#
|
|
314
|
-
#
|
|
315
|
-
#
|
|
316
|
-
#
|
|
317
|
-
# @
|
|
318
|
-
#
|
|
319
|
-
#
|
|
320
|
-
#
|
|
321
|
-
#
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
#
|
|
326
|
-
#
|
|
327
|
-
# @
|
|
328
|
-
#
|
|
329
|
-
#
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
#
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
#
|
|
338
|
-
#
|
|
339
|
-
#
|
|
340
|
-
#
|
|
341
|
-
#
|
|
342
|
-
#
|
|
343
|
-
#
|
|
344
|
-
#
|
|
345
|
-
#
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
#
|
|
350
|
-
#
|
|
351
|
-
#
|
|
352
|
-
#
|
|
353
|
-
# @
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
#
|
|
358
|
-
#
|
|
359
|
-
#
|
|
360
|
-
#
|
|
361
|
-
#
|
|
362
|
-
#
|
|
363
|
-
#
|
|
364
|
-
# @
|
|
365
|
-
#
|
|
366
|
-
#
|
|
367
|
-
#
|
|
368
|
-
#
|
|
369
|
-
#
|
|
370
|
-
#
|
|
371
|
-
#
|
|
372
|
-
#
|
|
373
|
-
#
|
|
374
|
-
# @version SketchUp
|
|
375
|
-
def
|
|
376
|
-
end
|
|
377
|
-
|
|
378
|
-
# The
|
|
379
|
-
#
|
|
380
|
-
#
|
|
381
|
-
#
|
|
382
|
-
#
|
|
383
|
-
#
|
|
384
|
-
#
|
|
385
|
-
#
|
|
386
|
-
#
|
|
387
|
-
#
|
|
388
|
-
#
|
|
389
|
-
#
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
#
|
|
394
|
-
#
|
|
395
|
-
#
|
|
396
|
-
#
|
|
397
|
-
#
|
|
398
|
-
#
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
#
|
|
403
|
-
#
|
|
404
|
-
#
|
|
405
|
-
#
|
|
406
|
-
#
|
|
407
|
-
#
|
|
408
|
-
#
|
|
409
|
-
#
|
|
410
|
-
#
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
|
+
# License:: The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
# The {Sketchup::Material} class represents a {Sketchup::Texture}
|
|
5
|
+
# or {Sketchup::Color} that can be applied to {Sketchup::Drawingelement}s.
|
|
6
|
+
# It is most often applied to {Sketchup::Face}s.
|
|
7
|
+
#
|
|
8
|
+
# You can pass any object that can be used as a material to a method that
|
|
9
|
+
# requires a material. Objects include actual {Sketchup::Material},
|
|
10
|
+
# {Sketchup::Color}, and classes that can be converted to a color.
|
|
11
|
+
#
|
|
12
|
+
# @example
|
|
13
|
+
# model = Sketchup.active_model
|
|
14
|
+
# face = model.entities.add_face([0, 0, 0], [9, 0, 0], [9, 9, 0], [0, 9, 0])
|
|
15
|
+
# material = model.materials.add('Example')
|
|
16
|
+
# # The following will all assign a red material to the face:
|
|
17
|
+
# material.color = Sketchup::Color.new(255, 0, 0)
|
|
18
|
+
# face.material = material
|
|
19
|
+
# face.material = Sketchup::Color.new(255, 0, 0)
|
|
20
|
+
# face.material = [255, 0, 0]
|
|
21
|
+
# face.material = "red"
|
|
22
|
+
# face.material = 0xff0000
|
|
23
|
+
#
|
|
24
|
+
# @version SketchUp 6.0
|
|
25
|
+
class Sketchup::Material < Sketchup::Entity
|
|
26
|
+
|
|
27
|
+
# Includes
|
|
28
|
+
|
|
29
|
+
include Comparable
|
|
30
|
+
|
|
31
|
+
# Constants
|
|
32
|
+
|
|
33
|
+
COLORIZE_SHIFT = nil # Stub value.
|
|
34
|
+
COLORIZE_TINT = nil # Stub value.
|
|
35
|
+
|
|
36
|
+
MATERIAL_COLORIZED_TEXTURED = nil # Stub value.
|
|
37
|
+
MATERIAL_SOLID = nil # Stub value.
|
|
38
|
+
MATERIAL_TEXTURED = nil # Stub value.
|
|
39
|
+
|
|
40
|
+
NORMAL_STYLE_DIRECTX = nil # Stub value.
|
|
41
|
+
NORMAL_STYLE_OPENGL = nil # Stub value.
|
|
42
|
+
|
|
43
|
+
OWNER_IMAGE = nil # Stub value.
|
|
44
|
+
OWNER_LAYER = nil # Stub value.
|
|
45
|
+
OWNER_MANAGER = nil # Stub value.
|
|
46
|
+
|
|
47
|
+
WORKFLOW_CLASSIC = nil # Stub value.
|
|
48
|
+
WORKFLOW_PBR_METALLIC_ROUGHNESS = nil # Stub value.
|
|
49
|
+
|
|
50
|
+
# Instance Methods
|
|
51
|
+
|
|
52
|
+
# The {#<=>} method is used to compare two materials based on #{display_name}.
|
|
53
|
+
#
|
|
54
|
+
# @example
|
|
55
|
+
# materials = Sketchup.active_model.materials
|
|
56
|
+
# m1 = materials.add('Joe')
|
|
57
|
+
# m2 = materials.add('Fred')
|
|
58
|
+
# m1 <=> m2
|
|
59
|
+
# # > 1
|
|
60
|
+
#
|
|
61
|
+
# @param [Sketchup::Material] material
|
|
62
|
+
#
|
|
63
|
+
# @return [Integer] +0+ if they are equal,
|
|
64
|
+
# +1+ if material1 > material2, +-1+ if material1 < material2
|
|
65
|
+
#
|
|
66
|
+
# @version SketchUp 6.0
|
|
67
|
+
def <=>(material)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# The {#==} method is used to test if two materials are the same.
|
|
71
|
+
#
|
|
72
|
+
# @example
|
|
73
|
+
# model = Sketchup.active_model
|
|
74
|
+
# materials = model.materials
|
|
75
|
+
# m1 = materials.add('Joe')
|
|
76
|
+
# m2 = materials.add('Fred')
|
|
77
|
+
# m1 == m2
|
|
78
|
+
# # > false
|
|
79
|
+
#
|
|
80
|
+
# @param [Sketchup::Material] material
|
|
81
|
+
#
|
|
82
|
+
# @return [Boolean]
|
|
83
|
+
#
|
|
84
|
+
# @version SketchUp 6.0
|
|
85
|
+
def ==(material)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# The {#alpha} method is used to get the opacity of the material.
|
|
89
|
+
#
|
|
90
|
+
# The value will be between +0.0+ and +1.0+. A value of +0.0+ means that the
|
|
91
|
+
# material is completely transparent. A value of +1.0+ means that the material
|
|
92
|
+
# is completely opaque.
|
|
93
|
+
#
|
|
94
|
+
# @example
|
|
95
|
+
# material = Sketchup.active_model.materials.add('Example')
|
|
96
|
+
# material.alpha
|
|
97
|
+
# # > 1.0
|
|
98
|
+
#
|
|
99
|
+
# @return [Float] A value between +0.0+ and +1.0+.
|
|
100
|
+
#
|
|
101
|
+
# @see #use_alpha?
|
|
102
|
+
#
|
|
103
|
+
# @version SketchUp 6.0
|
|
104
|
+
def alpha
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# The {#alpha=} method is used to set the opacity of the material.
|
|
108
|
+
#
|
|
109
|
+
# The value must be between +0.0+ and +1.0+. A value of +0.0+ means that the
|
|
110
|
+
# material is completely transparent. A value of +1.0+ means that the material
|
|
111
|
+
# is completely opaque.
|
|
112
|
+
#
|
|
113
|
+
# @example
|
|
114
|
+
# material = Sketchup.active_model.materials.add('Example')
|
|
115
|
+
# material.alpha = 0.5
|
|
116
|
+
#
|
|
117
|
+
# @param [Float] alpha
|
|
118
|
+
# An alpha value between +0.0+ and +1.0+.
|
|
119
|
+
#
|
|
120
|
+
# @return [Float]
|
|
121
|
+
#
|
|
122
|
+
# @see #use_alpha?
|
|
123
|
+
#
|
|
124
|
+
# @version SketchUp 6.0
|
|
125
|
+
def alpha=(alpha)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
#
|
|
129
|
+
# @example
|
|
130
|
+
# material = Sketchup.active_model.materials.add("Material")
|
|
131
|
+
# material.ao_enabled = true
|
|
132
|
+
#
|
|
133
|
+
# @raise [ArgumentError] if the ambient occlusion texture is not set before enabling ambient
|
|
134
|
+
# occlusion.
|
|
135
|
+
#
|
|
136
|
+
# @see ao_enabled?
|
|
137
|
+
#
|
|
138
|
+
# @see #ao_texture
|
|
139
|
+
#
|
|
140
|
+
# @see #ao_texture=
|
|
141
|
+
#
|
|
142
|
+
# @see #ao_strength
|
|
143
|
+
#
|
|
144
|
+
# @see #ao_strength=
|
|
145
|
+
#
|
|
146
|
+
# @version SketchUp 2025.0.2
|
|
147
|
+
def ao_enabled=(enabled)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
#
|
|
151
|
+
# @example
|
|
152
|
+
# material = Sketchup.active_model.materials.add("Material")
|
|
153
|
+
# material.ao_enabled?
|
|
154
|
+
# # > false
|
|
155
|
+
#
|
|
156
|
+
# @note There is no setter for this property. Instead it's dictated whether a
|
|
157
|
+
# {#ao_texture} is set.
|
|
158
|
+
#
|
|
159
|
+
# @return [Boolean]
|
|
160
|
+
#
|
|
161
|
+
# @see #ao_enabled=
|
|
162
|
+
#
|
|
163
|
+
# @see #ao_texture
|
|
164
|
+
#
|
|
165
|
+
# @see #ao_texture=
|
|
166
|
+
#
|
|
167
|
+
# @see #ao_strength
|
|
168
|
+
#
|
|
169
|
+
# @see #ao_strength=
|
|
170
|
+
#
|
|
171
|
+
# @version SketchUp 2025.0
|
|
172
|
+
def ao_enabled?
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
#
|
|
176
|
+
# @example
|
|
177
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
178
|
+
# material.ao_texture = 'path/to/ao_texture.png'
|
|
179
|
+
# material.ao_strength
|
|
180
|
+
# # > 1.0
|
|
181
|
+
#
|
|
182
|
+
# @return [Float] A value between +0.0+ and +1.0+.
|
|
183
|
+
#
|
|
184
|
+
# @see #ao_enabled?
|
|
185
|
+
#
|
|
186
|
+
# @see #ao_texture
|
|
187
|
+
#
|
|
188
|
+
# @see #ao_texture=
|
|
189
|
+
#
|
|
190
|
+
# @version SketchUp 2025.0
|
|
191
|
+
def ao_strength
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
#
|
|
195
|
+
# @example
|
|
196
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
197
|
+
# material.ao_texture = 'path/to/ao_texture.png'
|
|
198
|
+
# material.ao_strength = 1.0
|
|
199
|
+
#
|
|
200
|
+
# @param [Float] strenght
|
|
201
|
+
# A value between +0.0+ and +1.0+.
|
|
202
|
+
#
|
|
203
|
+
# @see #ao_enabled?
|
|
204
|
+
#
|
|
205
|
+
# @see #ao_texture
|
|
206
|
+
#
|
|
207
|
+
# @see #ao_texture=
|
|
208
|
+
#
|
|
209
|
+
# @version SketchUp 2025.0
|
|
210
|
+
def ao_strength=(strenght)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
#
|
|
214
|
+
# @example
|
|
215
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
216
|
+
# material.ao_texture = 'path/to/ao_texture.png'
|
|
217
|
+
# material.ao_texture
|
|
218
|
+
# # > nil
|
|
219
|
+
#
|
|
220
|
+
# @return [Sketchup::Texture]
|
|
221
|
+
#
|
|
222
|
+
# @see #ao_enabled?
|
|
223
|
+
#
|
|
224
|
+
# @see #ao_strength
|
|
225
|
+
#
|
|
226
|
+
# @see #ao_strength=
|
|
227
|
+
#
|
|
228
|
+
# @version SketchUp 2025.0
|
|
229
|
+
def ao_texture
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
#
|
|
233
|
+
# @example
|
|
234
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
235
|
+
# material.texture = 'path/to/texture.png'
|
|
236
|
+
# material.ao_texture = 'path/to/ao_texture.png'
|
|
237
|
+
#
|
|
238
|
+
# @overload ao_texture=(image_path)
|
|
239
|
+
#
|
|
240
|
+
# @param [String] image_path
|
|
241
|
+
#
|
|
242
|
+
# @overload ao_texture=(image_rep)
|
|
243
|
+
#
|
|
244
|
+
# @param [Sketchup::ImageRep] image_rep
|
|
245
|
+
#
|
|
246
|
+
# @overload ao_texture=(texture)
|
|
247
|
+
#
|
|
248
|
+
# Copies another texture to this texture.
|
|
249
|
+
# @param [Sketchup::Texture] texture
|
|
250
|
+
#
|
|
251
|
+
# @raise [ArgumentError] if the image data of the texture is invalid or corrupt.
|
|
252
|
+
#
|
|
253
|
+
# @see #ao_enabled?
|
|
254
|
+
#
|
|
255
|
+
# @see #ao_strength
|
|
256
|
+
#
|
|
257
|
+
# @see #ao_strength=
|
|
258
|
+
#
|
|
259
|
+
# @version SketchUp 2025.0
|
|
260
|
+
def ao_texture=(texture)
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# The {#color} method is used to retrieve the color of the material.
|
|
264
|
+
#
|
|
265
|
+
# If it uses a colorized {Sketchup::Texture}, this will return the average
|
|
266
|
+
# color of the texture.
|
|
267
|
+
#
|
|
268
|
+
# @example
|
|
269
|
+
# materials = Sketchup.active_model.materials.add('Example')
|
|
270
|
+
# material.color = 'red'
|
|
271
|
+
# color = material.color
|
|
272
|
+
#
|
|
273
|
+
# @note The alpha value of the {Sketchup::Color} object is not used for the
|
|
274
|
+
# material's transparency. This is controlled by the {#alpha} property in
|
|
275
|
+
# order for textured materials to also have transparency.
|
|
276
|
+
#
|
|
277
|
+
# @return [Sketchup::Color]
|
|
278
|
+
#
|
|
279
|
+
# @see #alpha
|
|
280
|
+
#
|
|
281
|
+
# @see #texture
|
|
282
|
+
#
|
|
283
|
+
# @version SketchUp 6.0
|
|
284
|
+
def color
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# The {#color=} method is used to set the color of the material.
|
|
288
|
+
#
|
|
289
|
+
# If the material has a {Sketchup::Texture}, then this turns it into a colorized
|
|
290
|
+
# texture.
|
|
291
|
+
#
|
|
292
|
+
# To reset the color of a material with a colorized texture, set the color
|
|
293
|
+
# to +nil+. If the texture is not colorized it'll be reset to some undefined
|
|
294
|
+
# default color.
|
|
295
|
+
#
|
|
296
|
+
# @example
|
|
297
|
+
# model = Sketchup.active_model
|
|
298
|
+
# materials = model.materials
|
|
299
|
+
# material = materials.add('Joe')
|
|
300
|
+
# material.color = 'red'
|
|
301
|
+
#
|
|
302
|
+
# @note The alpha value of the {Sketchup::Color} object is not used for the
|
|
303
|
+
# material's transparency. This is controlled by the {#alpha} property in
|
|
304
|
+
# order for textured materials to also have transparency.
|
|
305
|
+
#
|
|
306
|
+
# @param [Sketchup::Color, String, Array(Numeric, Numeric, Numeric, Numeric), Integer, nil] color
|
|
307
|
+
# Any value you can create a {Sketchup::Color} from or +nil+.
|
|
308
|
+
#
|
|
309
|
+
# @see #alpha=
|
|
310
|
+
#
|
|
311
|
+
# @see #texture=
|
|
312
|
+
#
|
|
313
|
+
# @see #colorize_deltas
|
|
314
|
+
#
|
|
315
|
+
# @see #colorize_type
|
|
316
|
+
#
|
|
317
|
+
# @see #materialType
|
|
318
|
+
#
|
|
319
|
+
# @see Sketchup::Color#initialize
|
|
320
|
+
#
|
|
321
|
+
# @version SketchUp 6.0
|
|
322
|
+
def color=(color)
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
# The {#colorize_deltas} method retrieves the HLS delta for colorized materials.
|
|
326
|
+
#
|
|
327
|
+
# @example
|
|
328
|
+
# material = Sketchup.active_model.materials.add('Example')
|
|
329
|
+
# h, l, s = material.colorize_deltas
|
|
330
|
+
#
|
|
331
|
+
# @return [Array(Float, Float, Float)] An array of floats representing the HLS delta.
|
|
332
|
+
#
|
|
333
|
+
# @version SketchUp 2015
|
|
334
|
+
def colorize_deltas
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# The {#colorize_type} method retrieves the type of colorization of the material.
|
|
338
|
+
#
|
|
339
|
+
# {Material Colorize Types}[#normal_style_summary]:
|
|
340
|
+
#
|
|
341
|
+
# - {Sketchup::Material::COLORIZE_SHIFT}
|
|
342
|
+
# - {Sketchup::Material::COLORIZE_TINT}
|
|
343
|
+
#
|
|
344
|
+
# @example
|
|
345
|
+
# material = Sketchup.active_model.materials.add('Example')
|
|
346
|
+
# type = material.colorize_type
|
|
347
|
+
#
|
|
348
|
+
# @note This value is only relevant when the {#materialType} is set to
|
|
349
|
+
# {Sketchup::Material::MATERIAL_COLORIZED_TEXTURED}.
|
|
350
|
+
#
|
|
351
|
+
# @return [Integer] One of +Sketchup::Material::COLORIZE_*+ values.
|
|
352
|
+
#
|
|
353
|
+
# @version SketchUp 2015
|
|
354
|
+
def colorize_type
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# The {#colorize_type=} method set the type of colorization of the material.
|
|
358
|
+
#
|
|
359
|
+
# {Material Colorize Types}[#normal_style_summary]:
|
|
360
|
+
#
|
|
361
|
+
# - {Sketchup::Material::COLORIZE_SHIFT}
|
|
362
|
+
# - {Sketchup::Material::COLORIZE_TINT}
|
|
363
|
+
#
|
|
364
|
+
# @example
|
|
365
|
+
# material = Sketchup.active_model.materials.add('Example')
|
|
366
|
+
# material.colorize_type = Sketchup::Material::COLORIZE_TINT
|
|
367
|
+
#
|
|
368
|
+
# @note This value is only relevant when the {#materialType} is set to
|
|
369
|
+
# {Sketchup::Material::MATERIAL_COLORIZED_TEXTURED}.
|
|
370
|
+
#
|
|
371
|
+
# @param [Integer] type
|
|
372
|
+
# One of +Sketchup::Material::COLORIZE_*+ values.
|
|
373
|
+
#
|
|
374
|
+
# @version SketchUp 2015
|
|
375
|
+
def colorize_type=(type)
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# The {#display_name} method retrieves the name that is displayed within SketchUp
|
|
379
|
+
# for the material.
|
|
380
|
+
#
|
|
381
|
+
# This should be used when presenting the name in the UI, but the returned name
|
|
382
|
+
# cannot be used as a key in {Sketchup::Model#materials}.
|
|
383
|
+
#
|
|
384
|
+
# @example
|
|
385
|
+
# model = Sketchup.active_model
|
|
386
|
+
# materials = model.materials
|
|
387
|
+
# material = materials.add('[Joe]')
|
|
388
|
+
# # Use .name for the internal name of a material
|
|
389
|
+
# puts material.name # Outputs "[Joe]"
|
|
390
|
+
# # Use .display_name for presenting the material name
|
|
391
|
+
# # to the UI like SketchUp does.
|
|
392
|
+
# puts material.display_name # Outputs "Joe"
|
|
393
|
+
#
|
|
394
|
+
# @return [String]
|
|
395
|
+
#
|
|
396
|
+
# @see #name
|
|
397
|
+
#
|
|
398
|
+
# @version SketchUp 6.0
|
|
399
|
+
def display_name
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
# The {#materialType} method retrieves the type of the material.
|
|
403
|
+
#
|
|
404
|
+
# {Material Types}[#material_type_constant_summary]:
|
|
405
|
+
#
|
|
406
|
+
# - +0+ = solid ({Sketchup::Material::MATERIAL_SOLID})
|
|
407
|
+
# - +1+ = textured ({Sketchup::Material::MATERIAL_TEXTURED})
|
|
408
|
+
# - +2+ = colorized textured ({Sketchup::Material::MATERIAL_COLORIZED_TEXTURED})
|
|
409
|
+
#
|
|
410
|
+
# The constants were added in SketchUp 2015.
|
|
411
|
+
#
|
|
412
|
+
# @example
|
|
413
|
+
# material = Sketchup.active_model.materials.add('Example')
|
|
414
|
+
# material.materialType == Sketchup::Material::MATERIAL_SOLID
|
|
415
|
+
# # > true
|
|
416
|
+
#
|
|
417
|
+
# @return [Integer] One of +Sketchup::Material::MATERIAL_*+ values.
|
|
418
|
+
#
|
|
419
|
+
# @version SketchUp 6.0
|
|
420
|
+
def materialType
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
#
|
|
424
|
+
# @example
|
|
425
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
426
|
+
# material.metalness_enabled = true
|
|
427
|
+
# material.metallic_factor
|
|
428
|
+
# # > 1.0
|
|
429
|
+
#
|
|
430
|
+
# @return [Float] A value between +0.0+ and +1.0+.
|
|
431
|
+
#
|
|
432
|
+
# @see #metalness_enabled?
|
|
433
|
+
#
|
|
434
|
+
# @see #metalness_enabled=
|
|
435
|
+
#
|
|
436
|
+
# @see #metallic_texture
|
|
437
|
+
#
|
|
438
|
+
# @see #metallic_texture=
|
|
439
|
+
#
|
|
440
|
+
# @version SketchUp 2025.0
|
|
441
|
+
def metallic_factor
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
#
|
|
445
|
+
# @example
|
|
446
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
447
|
+
# material.metalness_enabled = true
|
|
448
|
+
# material.metallic_factor = 1.0
|
|
449
|
+
#
|
|
450
|
+
# @param [Float] factor
|
|
451
|
+
# A value between +0.0+ and +1.0+.
|
|
452
|
+
#
|
|
453
|
+
# @see #metalness_enabled?
|
|
454
|
+
#
|
|
455
|
+
# @see #metalness_enabled=
|
|
456
|
+
#
|
|
457
|
+
# @see #metallic_texture
|
|
458
|
+
#
|
|
459
|
+
# @see #metallic_texture=
|
|
460
|
+
#
|
|
461
|
+
# @version SketchUp 2025.0
|
|
462
|
+
def metallic_factor=(factor)
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
#
|
|
466
|
+
# @example
|
|
467
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
468
|
+
# material.metalness_enabled = true
|
|
469
|
+
# material.metallic_texture
|
|
470
|
+
# # > nil
|
|
471
|
+
#
|
|
472
|
+
# @return [Sketchup::Texture]
|
|
473
|
+
#
|
|
474
|
+
# @see #metalness_enabled?
|
|
475
|
+
#
|
|
476
|
+
# @see #metalness_enabled=
|
|
477
|
+
#
|
|
478
|
+
# @see #metallic_factor
|
|
479
|
+
#
|
|
480
|
+
# @see #metallic_factor=
|
|
481
|
+
#
|
|
482
|
+
# @version SketchUp 2025.0
|
|
483
|
+
def metallic_texture
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
#
|
|
487
|
+
# @example
|
|
488
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
489
|
+
# material.texture = 'path/to/texture.png'
|
|
490
|
+
# material.metallic_texture = 'path/to/metallic_texture.png'
|
|
491
|
+
#
|
|
492
|
+
# @overload metallic_texture=(image_path)
|
|
493
|
+
#
|
|
494
|
+
# @param [String] image_path
|
|
495
|
+
#
|
|
496
|
+
# @overload metallic_texture=(image_rep)
|
|
497
|
+
#
|
|
498
|
+
# @param [Sketchup::ImageRep] image_rep
|
|
499
|
+
#
|
|
500
|
+
# @overload metallic_texture=(texture)
|
|
501
|
+
#
|
|
502
|
+
# Copies another texture to this texture.
|
|
503
|
+
# @param [Sketchup::Texture] texture
|
|
504
|
+
#
|
|
505
|
+
# @raise [ArgumentError] if the image data of the texture is invalid or corrupt.
|
|
506
|
+
#
|
|
507
|
+
# @see #metalness_enabled?
|
|
508
|
+
#
|
|
509
|
+
# @see #metalness_enabled=
|
|
510
|
+
#
|
|
511
|
+
# @see #metallic_factor
|
|
512
|
+
#
|
|
513
|
+
# @see #metallic_factor=
|
|
514
|
+
#
|
|
515
|
+
# @version SketchUp 2025.0
|
|
516
|
+
def metallic_texture=(texture)
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
#
|
|
520
|
+
# @example
|
|
521
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
522
|
+
# material.metalness_enabled = true
|
|
523
|
+
#
|
|
524
|
+
# @param [Boolean] enabled
|
|
525
|
+
#
|
|
526
|
+
# @see #metallic_texture
|
|
527
|
+
#
|
|
528
|
+
# @see #metallic_texture=
|
|
529
|
+
#
|
|
530
|
+
# @see #metallic_factor
|
|
531
|
+
#
|
|
532
|
+
# @see #metallic_factor=
|
|
533
|
+
#
|
|
534
|
+
# @version SketchUp 2025.0
|
|
535
|
+
def metalness_enabled=(enabled)
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
#
|
|
539
|
+
# @example
|
|
540
|
+
# material = Sketchup.active_model.materials.add("Material")
|
|
541
|
+
# material.metalness_enabled?
|
|
542
|
+
# # > false
|
|
543
|
+
#
|
|
544
|
+
# @return [Boolean]
|
|
545
|
+
#
|
|
546
|
+
# @see #metallic_texture
|
|
547
|
+
#
|
|
548
|
+
# @see #metallic_texture=
|
|
549
|
+
#
|
|
550
|
+
# @see #metallic_factor
|
|
551
|
+
#
|
|
552
|
+
# @see #metallic_factor=
|
|
553
|
+
#
|
|
554
|
+
# @version SketchUp 2025.0
|
|
555
|
+
def metalness_enabled?
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
# The {#name} method retrieves the name of the material. This is the
|
|
559
|
+
# unique internal name of the object which should be used for retrieving
|
|
560
|
+
# the material from the model's material list.
|
|
561
|
+
#
|
|
562
|
+
# Use {#display_name} to display the name in the UI.
|
|
563
|
+
#
|
|
564
|
+
# @example
|
|
565
|
+
# model = Sketchup.active_model
|
|
566
|
+
# materials = model.materials
|
|
567
|
+
# material = materials.add('[Joe]')
|
|
568
|
+
# # Use .name for the internal name of a material
|
|
569
|
+
# puts material.name # Outputs "[Joe]"
|
|
570
|
+
# # Use .display_name for presenting the material name
|
|
571
|
+
# # to the UI like SketchUp does.
|
|
572
|
+
# puts material.display_name # Outputs "Joe"
|
|
573
|
+
#
|
|
574
|
+
# @return [String]
|
|
575
|
+
#
|
|
576
|
+
# @see #display_name
|
|
577
|
+
#
|
|
578
|
+
# @version SketchUp 6.0
|
|
579
|
+
def name
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
# The {#name=} method sets the name of the material.
|
|
583
|
+
#
|
|
584
|
+
# @bug SketchUp 2018 would raise an error if you named material the name it
|
|
585
|
+
# already had.
|
|
586
|
+
#
|
|
587
|
+
# @example Safely change name without raising errors
|
|
588
|
+
# materials = Sketchup.active_model.materials
|
|
589
|
+
# material = materials.add("Joe")
|
|
590
|
+
# material.name = materials.unique_name('Jeff')
|
|
591
|
+
#
|
|
592
|
+
# @note Since SketchUp 2018 this method will raise an +ArgumentError+ if the
|
|
593
|
+
# name is not unique.
|
|
594
|
+
#
|
|
595
|
+
# @param [String] str
|
|
596
|
+
# the new material name
|
|
597
|
+
#
|
|
598
|
+
# @raise [ArgumentError] if the name is not unique to the model.
|
|
599
|
+
# (Added in SU2018)
|
|
600
|
+
#
|
|
601
|
+
# @return [String]
|
|
602
|
+
#
|
|
603
|
+
# @version SketchUp 8.0 M1
|
|
604
|
+
def name=(str)
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
#
|
|
608
|
+
# @example
|
|
609
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
610
|
+
# material.normal_enabled = true
|
|
611
|
+
#
|
|
612
|
+
# @param [Boolean] enabled
|
|
613
|
+
#
|
|
614
|
+
# @raise [ArgumentError] if the normal texture is not set before enabling normal mapping.
|
|
615
|
+
#
|
|
616
|
+
# @see #normal_enabled?
|
|
617
|
+
#
|
|
618
|
+
# @see #normal_texture
|
|
619
|
+
#
|
|
620
|
+
# @see #normal_texture=
|
|
621
|
+
#
|
|
622
|
+
# @see #normal_scale
|
|
623
|
+
#
|
|
624
|
+
# @see #normal_scale=
|
|
625
|
+
#
|
|
626
|
+
# @see #normal_style
|
|
627
|
+
#
|
|
628
|
+
# @see #normal_style=
|
|
629
|
+
#
|
|
630
|
+
# @version SketchUp 2025.0.2
|
|
631
|
+
def normal_enabled=(enabled)
|
|
632
|
+
end
|
|
633
|
+
|
|
634
|
+
#
|
|
635
|
+
# @example
|
|
636
|
+
# material = Sketchup.active_model.materials.add("Material")
|
|
637
|
+
# material.normal_enabled?
|
|
638
|
+
# # > false
|
|
639
|
+
#
|
|
640
|
+
# @return [Boolean]
|
|
641
|
+
#
|
|
642
|
+
# @see #normal_enabled=
|
|
643
|
+
#
|
|
644
|
+
# @see #normal_texture
|
|
645
|
+
#
|
|
646
|
+
# @see #normal_texture=
|
|
647
|
+
#
|
|
648
|
+
# @see #normal_scale
|
|
649
|
+
#
|
|
650
|
+
# @see #normal_scale=
|
|
651
|
+
#
|
|
652
|
+
# @see #normal_style
|
|
653
|
+
#
|
|
654
|
+
# @see #normal_style=
|
|
655
|
+
#
|
|
656
|
+
# @version SketchUp 2025.0
|
|
657
|
+
def normal_enabled?
|
|
658
|
+
end
|
|
659
|
+
|
|
660
|
+
#
|
|
661
|
+
# @example
|
|
662
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
663
|
+
# material.normal_texture = 'path/to/normal_texture.png'
|
|
664
|
+
# material.normal_scale
|
|
665
|
+
# # > 1.0
|
|
666
|
+
#
|
|
667
|
+
# @return [Float] A value larger than or equal to +0.0+.
|
|
668
|
+
#
|
|
669
|
+
# @see #normal_enabled?
|
|
670
|
+
#
|
|
671
|
+
# @see #normal_texture
|
|
672
|
+
#
|
|
673
|
+
# @see #normal_texture=
|
|
674
|
+
#
|
|
675
|
+
# @see #normal_style
|
|
676
|
+
#
|
|
677
|
+
# @see #normal_style=
|
|
678
|
+
#
|
|
679
|
+
# @version SketchUp 2025.0
|
|
680
|
+
def normal_scale
|
|
681
|
+
end
|
|
682
|
+
|
|
683
|
+
#
|
|
684
|
+
# @example
|
|
685
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
686
|
+
# material.normal_texture = 'path/to/normal_texture.png'
|
|
687
|
+
# material.normal_scale = 1.0
|
|
688
|
+
#
|
|
689
|
+
# @param [Float] scale
|
|
690
|
+
# A value larger than or equal to +0.0+.
|
|
691
|
+
#
|
|
692
|
+
# @see #normal_enabled?
|
|
693
|
+
#
|
|
694
|
+
# @see #normal_texture
|
|
695
|
+
#
|
|
696
|
+
# @see #normal_texture=
|
|
697
|
+
#
|
|
698
|
+
# @see #normal_style
|
|
699
|
+
#
|
|
700
|
+
# @see #normal_style=
|
|
701
|
+
#
|
|
702
|
+
# @version SketchUp 2025.0
|
|
703
|
+
def normal_scale=(scale)
|
|
704
|
+
end
|
|
705
|
+
|
|
706
|
+
# {Material Normal Styles}[#normal_style_summary]:
|
|
707
|
+
#
|
|
708
|
+
# - {NORMAL_STYLE_OPENGL}
|
|
709
|
+
# - {NORMAL_STYLE_DIRECTX}
|
|
710
|
+
#
|
|
711
|
+
# @example
|
|
712
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
713
|
+
# material.normal_texture = 'path/to/normal_texture.png'
|
|
714
|
+
# material.normal_style
|
|
715
|
+
# # > Sketchup::Material::NORMAL_STYLE_OPENGL
|
|
716
|
+
#
|
|
717
|
+
# @return [Integer] One of +Sketchup::Material::NORMAL_STYLE_*+ values.
|
|
718
|
+
#
|
|
719
|
+
# @see #normal_enabled?
|
|
720
|
+
#
|
|
721
|
+
# @see #normal_texture
|
|
722
|
+
#
|
|
723
|
+
# @see #normal_texture=
|
|
724
|
+
#
|
|
725
|
+
# @see #normal_scale
|
|
726
|
+
#
|
|
727
|
+
# @see #normal_scale=
|
|
728
|
+
#
|
|
729
|
+
# @version SketchUp 2025.0
|
|
730
|
+
def normal_style
|
|
731
|
+
end
|
|
732
|
+
|
|
733
|
+
# {Material Normal Styles}[#normal_style_summary]:
|
|
734
|
+
#
|
|
735
|
+
# - {NORMAL_STYLE_OPENGL}
|
|
736
|
+
# - {NORMAL_STYLE_DIRECTX}
|
|
737
|
+
#
|
|
738
|
+
# @example
|
|
739
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
740
|
+
# material.normal_texture = 'path/to/normal_texture.png'
|
|
741
|
+
# material.normal_style = Sketchup::Material::NORMAL_STYLE_DIRECTX
|
|
742
|
+
#
|
|
743
|
+
# @param [Integer] style
|
|
744
|
+
#
|
|
745
|
+
# @see #normal_enabled?
|
|
746
|
+
#
|
|
747
|
+
# @see #normal_texture
|
|
748
|
+
#
|
|
749
|
+
# @see #normal_texture=
|
|
750
|
+
#
|
|
751
|
+
# @see #normal_scale
|
|
752
|
+
#
|
|
753
|
+
# @see #normal_scale=
|
|
754
|
+
#
|
|
755
|
+
# @version SketchUp 2025.0
|
|
756
|
+
def normal_style=(style)
|
|
757
|
+
end
|
|
758
|
+
|
|
759
|
+
#
|
|
760
|
+
# @example
|
|
761
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
762
|
+
# material.normal_texture = 'path/to/normal_texture.png'
|
|
763
|
+
# material.normal_texture
|
|
764
|
+
# # > #<Sketchup::Texture>
|
|
765
|
+
#
|
|
766
|
+
# @return [Sketchup::Texture]
|
|
767
|
+
#
|
|
768
|
+
# @see #normal_enabled?
|
|
769
|
+
#
|
|
770
|
+
# @see #normal_scale
|
|
771
|
+
#
|
|
772
|
+
# @see #normal_scale=
|
|
773
|
+
#
|
|
774
|
+
# @see #normal_style
|
|
775
|
+
#
|
|
776
|
+
# @see #normal_style=
|
|
777
|
+
#
|
|
778
|
+
# @version SketchUp 2025.0
|
|
779
|
+
def normal_texture
|
|
780
|
+
end
|
|
781
|
+
|
|
782
|
+
#
|
|
783
|
+
# @example
|
|
784
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
785
|
+
# material.texture = 'path/to/texture.png'
|
|
786
|
+
# material.normal_texture = 'path/to/normal_texture.png'
|
|
787
|
+
#
|
|
788
|
+
# @overload normal_texture=(image_path)
|
|
789
|
+
#
|
|
790
|
+
# @param [String] image_path
|
|
791
|
+
#
|
|
792
|
+
# @overload normal_texture=(image_rep)
|
|
793
|
+
#
|
|
794
|
+
# @param [Sketchup::ImageRep] image_rep
|
|
795
|
+
#
|
|
796
|
+
# @overload normal_texture=(texture)
|
|
797
|
+
#
|
|
798
|
+
# Copies another texture to this texture.
|
|
799
|
+
# @param [Sketchup::Texture] texture
|
|
800
|
+
#
|
|
801
|
+
# @raise [ArgumentError] if the image data of the texture is invalid or corrupt.
|
|
802
|
+
#
|
|
803
|
+
# @raise [ArgumentError] if the image data is not 24 bits per pixels or higher.
|
|
804
|
+
#
|
|
805
|
+
# @see #normal_enabled?
|
|
806
|
+
#
|
|
807
|
+
# @see #normal_scale
|
|
808
|
+
#
|
|
809
|
+
# @see #normal_scale=
|
|
810
|
+
#
|
|
811
|
+
# @see #normal_style
|
|
812
|
+
#
|
|
813
|
+
# @see #normal_style=
|
|
814
|
+
#
|
|
815
|
+
# @version SketchUp 2025.0
|
|
816
|
+
def normal_texture=(texture)
|
|
817
|
+
end
|
|
818
|
+
|
|
819
|
+
# The {#owner_type} method is used to determine what owns the material.
|
|
820
|
+
#
|
|
821
|
+
# {Material Owner Types}[#owner_type_constant_summary]:
|
|
822
|
+
#
|
|
823
|
+
# - {Sketchup::Material::OWNER_MANAGER}
|
|
824
|
+
# - {Sketchup::Material::OWNER_IMAGE}
|
|
825
|
+
# - {Sketchup::Material::OWNER_LAYER}
|
|
826
|
+
#
|
|
827
|
+
# @return [Integer]
|
|
828
|
+
#
|
|
829
|
+
# @version SketchUp 2019.2
|
|
830
|
+
def owner_type
|
|
831
|
+
end
|
|
832
|
+
|
|
833
|
+
#
|
|
834
|
+
# @example
|
|
835
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
836
|
+
# material.roughness_enabled = true
|
|
837
|
+
#
|
|
838
|
+
# @param [Boolean] enabled
|
|
839
|
+
#
|
|
840
|
+
# @see #roughness_texture
|
|
841
|
+
#
|
|
842
|
+
# @see #roughness_texture=
|
|
843
|
+
#
|
|
844
|
+
# @see #roughness_factor
|
|
845
|
+
#
|
|
846
|
+
# @see #roughness_factor=
|
|
847
|
+
#
|
|
848
|
+
# @version SketchUp 2025.0
|
|
849
|
+
def roughness_enabled=(enabled)
|
|
850
|
+
end
|
|
851
|
+
|
|
852
|
+
#
|
|
853
|
+
# @example
|
|
854
|
+
# material = Sketchup.active_model.materials.add("Material")
|
|
855
|
+
# material.roughness_enabled?
|
|
856
|
+
# # > false
|
|
857
|
+
#
|
|
858
|
+
# @return [Boolean]
|
|
859
|
+
#
|
|
860
|
+
# @see #roughness_texture
|
|
861
|
+
#
|
|
862
|
+
# @see #roughness_texture=
|
|
863
|
+
#
|
|
864
|
+
# @see #roughness_factor
|
|
865
|
+
#
|
|
866
|
+
# @see #roughness_factor=
|
|
867
|
+
#
|
|
868
|
+
# @version SketchUp 2025.0
|
|
869
|
+
def roughness_enabled?
|
|
870
|
+
end
|
|
871
|
+
|
|
872
|
+
#
|
|
873
|
+
# @example
|
|
874
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
875
|
+
# material.roughness_enabled = true
|
|
876
|
+
# material.roughness_factor
|
|
877
|
+
# # > 1.0
|
|
878
|
+
#
|
|
879
|
+
# @return [Float] A value between +0.0+ and +1.0+.
|
|
880
|
+
#
|
|
881
|
+
# @see #roughness_enabled?
|
|
882
|
+
#
|
|
883
|
+
# @see #roughness_enabled=
|
|
884
|
+
#
|
|
885
|
+
# @see #roughness_texture
|
|
886
|
+
#
|
|
887
|
+
# @see #roughness_texture=
|
|
888
|
+
#
|
|
889
|
+
# @version SketchUp 2025.0
|
|
890
|
+
def roughness_factor
|
|
891
|
+
end
|
|
892
|
+
|
|
893
|
+
#
|
|
894
|
+
# @example
|
|
895
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
896
|
+
# material.roughness_enabled = true
|
|
897
|
+
# material.roughness_factor = 1.0
|
|
898
|
+
#
|
|
899
|
+
# @param [Float] factor
|
|
900
|
+
# A value between +0.0+ and +1.0+.
|
|
901
|
+
#
|
|
902
|
+
# @see #roughness_enabled?
|
|
903
|
+
#
|
|
904
|
+
# @see #roughness_enabled=
|
|
905
|
+
#
|
|
906
|
+
# @see #roughness_texture
|
|
907
|
+
#
|
|
908
|
+
# @see #roughness_texture=
|
|
909
|
+
#
|
|
910
|
+
# @version SketchUp 2025.0
|
|
911
|
+
def roughness_factor=(factor)
|
|
912
|
+
end
|
|
913
|
+
|
|
914
|
+
#
|
|
915
|
+
# @example
|
|
916
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
917
|
+
# material.roughness_enabled = true
|
|
918
|
+
# material.roughness_texture
|
|
919
|
+
# # > nil
|
|
920
|
+
#
|
|
921
|
+
# @return [Sketchup::Texture]
|
|
922
|
+
#
|
|
923
|
+
# @see #roughness_enabled?
|
|
924
|
+
#
|
|
925
|
+
# @see #roughness_enabled=
|
|
926
|
+
#
|
|
927
|
+
# @see #roughness_factor
|
|
928
|
+
#
|
|
929
|
+
# @see #roughness_factor=
|
|
930
|
+
#
|
|
931
|
+
# @version SketchUp 2025.0
|
|
932
|
+
def roughness_texture
|
|
933
|
+
end
|
|
934
|
+
|
|
935
|
+
#
|
|
936
|
+
# @example
|
|
937
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
938
|
+
# material.texture = 'path/to/texture.png'
|
|
939
|
+
# material.roughness_texture = 'path/to/roughness_texture.png'
|
|
940
|
+
#
|
|
941
|
+
# @overload roughness_texture=(image_path)
|
|
942
|
+
#
|
|
943
|
+
# @param [String] image_path
|
|
944
|
+
#
|
|
945
|
+
# @overload roughness_texture=(image_rep)
|
|
946
|
+
#
|
|
947
|
+
# @param [Sketchup::ImageRep] image_rep
|
|
948
|
+
#
|
|
949
|
+
# @overload roughness_texture=(texture)
|
|
950
|
+
#
|
|
951
|
+
# Copies another texture to this texture.
|
|
952
|
+
# @param [Sketchup::Texture] texture
|
|
953
|
+
#
|
|
954
|
+
# @raise [ArgumentError] if the image data of the texture is invalid or corrupt.
|
|
955
|
+
#
|
|
956
|
+
# @see #roughness_enabled?
|
|
957
|
+
#
|
|
958
|
+
# @see #roughness_enabled=
|
|
959
|
+
#
|
|
960
|
+
# @see #roughness_factor
|
|
961
|
+
#
|
|
962
|
+
# @see #roughness_factor=
|
|
963
|
+
#
|
|
964
|
+
# @version SketchUp 2025.0
|
|
965
|
+
def roughness_texture=(texture)
|
|
966
|
+
end
|
|
967
|
+
|
|
968
|
+
# The {#save_as} method is used to write a material to a SKM file.
|
|
969
|
+
#
|
|
970
|
+
# @example
|
|
971
|
+
# filename = File.join(Sketchup.temp_dir, 'su_test.skm')
|
|
972
|
+
# materials = Sketchup.active_model.materials
|
|
973
|
+
# material = materials.add("Hello World")
|
|
974
|
+
# material.color = 'red'
|
|
975
|
+
# material.save_as(filename)
|
|
976
|
+
#
|
|
977
|
+
# @note You must remember to append ".skm" to the filename as this will not be
|
|
978
|
+
# done automatically.
|
|
979
|
+
#
|
|
980
|
+
# @param [String] filename
|
|
981
|
+
# the path to the SKM file to load.
|
|
982
|
+
#
|
|
983
|
+
# @return [Boolean]
|
|
984
|
+
#
|
|
985
|
+
# @version SketchUp 2017
|
|
986
|
+
def save_as(filename)
|
|
987
|
+
end
|
|
988
|
+
|
|
989
|
+
# The {#texture} method retrieves the texture of the material.
|
|
990
|
+
#
|
|
991
|
+
# @example
|
|
992
|
+
# model = Sketchup.active_model
|
|
993
|
+
# materials = model.materials
|
|
994
|
+
# material = materials.add('Joe')
|
|
995
|
+
# material.texture = 'path/to/metallic_texture.png'
|
|
996
|
+
# texture = material.texture
|
|
997
|
+
#
|
|
998
|
+
# @return [Sketchup::Texture, nil]
|
|
999
|
+
#
|
|
1000
|
+
# @version SketchUp 6.0
|
|
1001
|
+
def texture
|
|
1002
|
+
end
|
|
1003
|
+
|
|
1004
|
+
# The {#texture=} method sets the texture for the material.
|
|
1005
|
+
#
|
|
1006
|
+
# Setting the texture to +nil+ will turn remove it and the material will use
|
|
1007
|
+
# {#color}.
|
|
1008
|
+
#
|
|
1009
|
+
# @example
|
|
1010
|
+
# model = Sketchup.active_model
|
|
1011
|
+
# materials = model.materials
|
|
1012
|
+
# material = materials.add('Joe')
|
|
1013
|
+
# material.texture = 'path/to/metallic_texture.png'
|
|
1014
|
+
#
|
|
1015
|
+
# @overload texture=(filename)
|
|
1016
|
+
#
|
|
1017
|
+
# @param [String] filename
|
|
1018
|
+
# The file path to the texture the material should use.
|
|
1019
|
+
#
|
|
1020
|
+
# @overload texture=(properties)
|
|
1021
|
+
#
|
|
1022
|
+
# @param [Array(String, Length, Length)] properties
|
|
1023
|
+
# An array with the texture file path and optionally a width and height
|
|
1024
|
+
# which sets {Sketchup::Texture#width} and {Sketchup::Texture#height}.
|
|
1025
|
+
#
|
|
1026
|
+
# @overload texture=(properties)
|
|
1027
|
+
#
|
|
1028
|
+
# @param [Array(String, Length)] properties
|
|
1029
|
+
# An array with the texture file path and optionally a size
|
|
1030
|
+
# which sets {Sketchup::Texture#width} and {Sketchup::Texture#height}.
|
|
1031
|
+
#
|
|
1032
|
+
# @overload texture=(image_rep)
|
|
1033
|
+
#
|
|
1034
|
+
# @version SketchUp 2018
|
|
1035
|
+
# @param [Sketchup::ImageRep] image_rep The pixel data representing the
|
|
1036
|
+
# texture.
|
|
1037
|
+
#
|
|
1038
|
+
# @version SketchUp 6.0
|
|
1039
|
+
def texture=(arg)
|
|
1040
|
+
end
|
|
1041
|
+
|
|
1042
|
+
# The {#use_alpha?} method tells if the material uses transparency. It uses
|
|
1043
|
+
# some tolerance checking to account for floating point precision noise.
|
|
1044
|
+
#
|
|
1045
|
+
# @example
|
|
1046
|
+
# material = Sketchup.active_model.materials.add('Example')
|
|
1047
|
+
# material.use_alpha?
|
|
1048
|
+
# # > false
|
|
1049
|
+
#
|
|
1050
|
+
# material.alpha = 0.5
|
|
1051
|
+
# material.use_alpha?
|
|
1052
|
+
# # > true
|
|
1053
|
+
#
|
|
1054
|
+
# @note that this is not affected by the alpha value of the {#color} object.
|
|
1055
|
+
# Only the {#alpha} value will make this method return +true+.
|
|
1056
|
+
#
|
|
1057
|
+
# @return [Boolean]
|
|
1058
|
+
#
|
|
1059
|
+
# @see #alpha
|
|
1060
|
+
#
|
|
1061
|
+
# @see #alpha=
|
|
1062
|
+
#
|
|
1063
|
+
# @version SketchUp 6.0
|
|
1064
|
+
def use_alpha?
|
|
1065
|
+
end
|
|
1066
|
+
|
|
1067
|
+
# {Material Workflows}[#workflow_constant_summary]:
|
|
1068
|
+
#
|
|
1069
|
+
# - {WORKFLOW_CLASSIC}
|
|
1070
|
+
# - {WORKFLOW_PBR_METALLIC_ROUGHNESS}
|
|
1071
|
+
#
|
|
1072
|
+
# When the workflow returns +WORKFLOW_PBR_METALLIC_ROUGHNESS+ the properties
|
|
1073
|
+
# listed under {PBR Metallic Roughness Workflow}[#pbr_metallic_roughness_workflow]
|
|
1074
|
+
# are relevant.
|
|
1075
|
+
#
|
|
1076
|
+
# @example Classic material
|
|
1077
|
+
# material = Sketchup.active_model.materials.add("Material")
|
|
1078
|
+
# workflow = material.workflow
|
|
1079
|
+
# # > workflow == Sketchup::Material::WORKFLOW_CLASSIC
|
|
1080
|
+
#
|
|
1081
|
+
# @example PBR material
|
|
1082
|
+
# material = Sketchup.active_model.materials.add("PBR Material")
|
|
1083
|
+
# material.metalness_enabled = true # Or any of the other PBR properties.
|
|
1084
|
+
# workflow = material.workflow
|
|
1085
|
+
# # > workflow == Sketchup::Material::WORKFLOW_PBR_METALLIC_ROUGHNESS
|
|
1086
|
+
#
|
|
1087
|
+
# @return [Integer] One of +Sketchup::Material::WORKFLOW_*+ values.
|
|
1088
|
+
#
|
|
1089
|
+
# @version SketchUp 2025.0
|
|
1090
|
+
def workflow
|
|
1091
|
+
end
|
|
1092
|
+
|
|
1093
|
+
# The {#write_thumbnail} method writes a bitmap thumbnail to the given file name.
|
|
1094
|
+
#
|
|
1095
|
+
# @example
|
|
1096
|
+
# model = Sketchup.active_model
|
|
1097
|
+
# model.materials.each { |material|
|
|
1098
|
+
# thumbnail_file = File.join(Sketchup.temp_dir, "#{material.display_name}.png")
|
|
1099
|
+
# material.write_thumbnail(thumbnail_file, 128)
|
|
1100
|
+
# }
|
|
1101
|
+
#
|
|
1102
|
+
# @param [String] path
|
|
1103
|
+
# The file path for the thumbnail.
|
|
1104
|
+
#
|
|
1105
|
+
# @param [Integer] max_size
|
|
1106
|
+
# The maximum width or height of the generated image.
|
|
1107
|
+
#
|
|
1108
|
+
# @return [Boolean, nil] +true+ if successful, +false+ if unsuccessful.
|
|
1109
|
+
# +nil+ if arguments are invalid.
|
|
1110
|
+
#
|
|
1111
|
+
# @version SketchUp 8.0 M1
|
|
1112
|
+
def write_thumbnail(path, max_size)
|
|
1113
|
+
end
|
|
1114
|
+
|
|
1115
|
+
end
|