blockbench-types 5.1.0 → 5.2.0-beta.0-next.2
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.
- package/README.md +30 -30
- package/custom/animation.d.ts +257 -256
- package/custom/animation_controller.d.ts +124 -124
- package/custom/blockbench.d.ts +73 -73
- package/custom/canvas.d.ts +324 -307
- package/custom/codec.d.ts +182 -182
- package/custom/copy_paste.d.ts +43 -42
- package/custom/cube.d.ts +151 -151
- package/custom/desktop.d.ts +61 -73
- package/custom/display_mode.d.ts +141 -137
- package/custom/edit_session.d.ts +38 -37
- package/custom/global.d.ts +181 -168
- package/custom/group.d.ts +113 -113
- package/custom/interface.d.ts +88 -78
- package/custom/io.d.ts +12 -12
- package/custom/{toolbars.d.ts → keybind.d.ts} +150 -221
- package/custom/keyframe.d.ts +94 -94
- package/custom/libs.d.ts +13 -13
- package/custom/menu_bar.d.ts +66 -0
- package/custom/mesh.d.ts +196 -196
- package/custom/misc.d.ts +196 -199
- package/custom/molang.d.ts +159 -159
- package/custom/outliner.d.ts +158 -158
- package/custom/painter.d.ts +102 -69
- package/custom/preview_scene.d.ts +120 -120
- package/custom/screencam.d.ts +71 -71
- package/custom/spline_mesh.d.ts +190 -189
- package/custom/texture_group.d.ts +68 -68
- package/custom/textures.d.ts +526 -515
- package/custom/timeline.d.ts +66 -66
- package/custom/undo.d.ts +209 -208
- package/custom/util/version_util.d.ts +32 -32
- package/custom/util.d.ts +235 -235
- package/custom/uveditor.d.ts +3 -3
- package/custom/validator.d.ts +99 -99
- package/documentation.md +12 -12
- package/generated/animations/mirror_animating.d.ts +7 -0
- package/generated/animations/timeline_animators.d.ts +1 -1
- package/generated/api.d.ts +8 -1
- package/generated/file_system.d.ts +2 -1
- package/generated/find_replace.d.ts +6 -0
- package/generated/formats/standards/obj.d.ts +9 -11
- package/generated/interface/actions.d.ts +16 -12
- package/generated/interface/form.d.ts +2 -1
- package/generated/interface/main_tools.d.ts +23 -0
- package/generated/interface/menu.d.ts +141 -0
- package/generated/interface/menu_bar.d.ts +2 -3
- package/generated/interface/resize_lines.d.ts +2 -0
- package/generated/interface/settings.d.ts +6 -2
- package/generated/interface/shared_actions.d.ts +5 -0
- package/generated/interface/start_screen.d.ts +62 -42
- package/generated/interface/toolbars.d.ts +146 -46
- package/generated/io/format.d.ts +1 -0
- package/generated/io/project.d.ts +10 -2
- package/generated/lib/CanvasFrame.d.ts +1 -0
- package/generated/main.d.ts +4 -1
- package/generated/modeling/mesh/add_mesh.d.ts +6 -0
- package/generated/modeling/mesh/proportional_edit.d.ts +15 -13
- package/generated/modeling/mesh/util.d.ts +8 -2
- package/generated/modeling/mirror_modeling.d.ts +4 -0
- package/generated/modeling/weight_paint.d.ts +11 -0
- package/generated/modes.d.ts +2 -2
- package/generated/native_apis.d.ts +3 -0
- package/generated/outliner/abstract/outliner_element.d.ts +1 -0
- package/generated/outliner/abstract/outliner_node.d.ts +1 -0
- package/generated/outliner/types/armature.d.ts +1 -1
- package/generated/outliner/types/armature_bone.d.ts +1 -1
- package/generated/outliner/types/billboard.d.ts +1 -1
- package/generated/outliner/types/bounding_box.d.ts +1 -1
- package/generated/outliner/types/cube.d.ts +1 -1
- package/generated/outliner/types/group.d.ts +1 -1
- package/generated/outliner/types/locator.d.ts +1 -1
- package/generated/outliner/types/mesh.d.ts +1 -1
- package/generated/outliner/types/null_object.d.ts +1 -1
- package/generated/outliner/types/spline_mesh.d.ts +1 -2
- package/generated/outliner/types/texture_mesh.d.ts +1 -1
- package/generated/plugin_loader.d.ts +1 -1
- package/generated/preview/preview.d.ts +280 -0
- package/generated/preview/reference_images.d.ts +1 -1
- package/generated/texturing/layers.d.ts +140 -0
- package/generated/util/gif.d.ts +12 -3
- package/generated/util/state_memory.d.ts +3 -11
- package/index.d.ts +2 -2
- package/package.json +39 -39
- package/tsconfig.json +19 -19
- package/type_config.json +43 -46
- package/custom/menu.d.ts +0 -136
- package/custom/preview.d.ts +0 -137
- package/custom/start_screen.d.ts +0 -15
- package/custom/texture_layers.d.ts +0 -117
- package/generated/global_types.d.ts +0 -47
- package/generated/io/formats/bedrock.d.ts +0 -4
- package/generated/io/formats/bedrock_old.d.ts +0 -4
- package/generated/io/formats/collada.d.ts +0 -4
- package/generated/io/formats/fbx.d.ts +0 -17
- package/generated/io/formats/gltf.d.ts +0 -6
- package/generated/io/formats/java_block.d.ts +0 -4
- package/generated/io/formats/modded_entity.d.ts +0 -139
- package/generated/io/formats/obj.d.ts +0 -12
- package/generated/io/formats/optifine_jem.d.ts +0 -3
- package/generated/io/formats/optifine_jpm.d.ts +0 -3
- package/generated/io/formats/skin.d.ts +0 -22
package/custom/canvas.d.ts
CHANGED
|
@@ -1,307 +1,324 @@
|
|
|
1
|
-
/// <reference types="./blockbench"/>
|
|
2
|
-
interface UpdateViewOptions {
|
|
3
|
-
/**
|
|
4
|
-
* List of elements to update
|
|
5
|
-
*/
|
|
6
|
-
elements?: OutlinerElement[]
|
|
7
|
-
/**
|
|
8
|
-
* Which aspects of the elements to update
|
|
9
|
-
*/
|
|
10
|
-
element_aspects?: {
|
|
11
|
-
/**
|
|
12
|
-
* Update visibility of elements
|
|
13
|
-
*/
|
|
14
|
-
visibility?: boolean
|
|
15
|
-
/**
|
|
16
|
-
* Update the position and geometry
|
|
17
|
-
*/
|
|
18
|
-
geometry?: boolean
|
|
19
|
-
/**
|
|
20
|
-
* Update the mesh faces
|
|
21
|
-
*/
|
|
22
|
-
faces?: boolean
|
|
23
|
-
/**
|
|
24
|
-
* Update the UV mapping
|
|
25
|
-
*/
|
|
26
|
-
uv?: boolean
|
|
27
|
-
/**
|
|
28
|
-
* Update the painting grid
|
|
29
|
-
*/
|
|
30
|
-
painting_grid?: boolean
|
|
31
|
-
/**
|
|
32
|
-
* Update the transform of elements
|
|
33
|
-
*/
|
|
34
|
-
transform?: boolean
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Groups to update
|
|
38
|
-
*/
|
|
39
|
-
groups?: Group[]
|
|
40
|
-
/**
|
|
41
|
-
* Which aspects of the groups to update
|
|
42
|
-
*/
|
|
43
|
-
group_aspects?: {
|
|
44
|
-
/**
|
|
45
|
-
* Update the transform of elements
|
|
46
|
-
*/
|
|
47
|
-
transform?: boolean
|
|
48
|
-
/**
|
|
49
|
-
* Update visibility of elements
|
|
50
|
-
*/
|
|
51
|
-
visibility?: boolean
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Whether to update the selection (updates the selection outlines and interface)
|
|
55
|
-
*/
|
|
56
|
-
selection?: boolean
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* A global namespace handling miscellaneous functionality related to the 3D preview
|
|
61
|
-
*/
|
|
62
|
-
declare namespace Canvas {
|
|
63
|
-
const gizmo_colors: Record<string, THREE.Color>
|
|
64
|
-
const materials: {
|
|
65
|
-
[uuid: UUID]: THREE.Material
|
|
66
|
-
}
|
|
67
|
-
const emptyMaterials: {
|
|
68
|
-
[uuid: UUID]: THREE.Material
|
|
69
|
-
}
|
|
70
|
-
const coloredSolidMaterials: THREE.ShaderMaterial[]
|
|
71
|
-
const meshes: {
|
|
72
|
-
[uuid: UUID]: THREE.Mesh
|
|
73
|
-
}
|
|
74
|
-
const bones: {
|
|
75
|
-
[uuid: UUID]: THREE.Object3D
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
interface UpdateViewOptions {
|
|
3
|
+
/**
|
|
4
|
+
* List of elements to update
|
|
5
|
+
*/
|
|
6
|
+
elements?: OutlinerElement[]
|
|
7
|
+
/**
|
|
8
|
+
* Which aspects of the elements to update
|
|
9
|
+
*/
|
|
10
|
+
element_aspects?: {
|
|
11
|
+
/**
|
|
12
|
+
* Update visibility of elements
|
|
13
|
+
*/
|
|
14
|
+
visibility?: boolean
|
|
15
|
+
/**
|
|
16
|
+
* Update the position and geometry
|
|
17
|
+
*/
|
|
18
|
+
geometry?: boolean
|
|
19
|
+
/**
|
|
20
|
+
* Update the mesh faces
|
|
21
|
+
*/
|
|
22
|
+
faces?: boolean
|
|
23
|
+
/**
|
|
24
|
+
* Update the UV mapping
|
|
25
|
+
*/
|
|
26
|
+
uv?: boolean
|
|
27
|
+
/**
|
|
28
|
+
* Update the painting grid
|
|
29
|
+
*/
|
|
30
|
+
painting_grid?: boolean
|
|
31
|
+
/**
|
|
32
|
+
* Update the transform of elements
|
|
33
|
+
*/
|
|
34
|
+
transform?: boolean
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Groups to update
|
|
38
|
+
*/
|
|
39
|
+
groups?: Group[]
|
|
40
|
+
/**
|
|
41
|
+
* Which aspects of the groups to update
|
|
42
|
+
*/
|
|
43
|
+
group_aspects?: {
|
|
44
|
+
/**
|
|
45
|
+
* Update the transform of elements
|
|
46
|
+
*/
|
|
47
|
+
transform?: boolean
|
|
48
|
+
/**
|
|
49
|
+
* Update visibility of elements
|
|
50
|
+
*/
|
|
51
|
+
visibility?: boolean
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Whether to update the selection (updates the selection outlines and interface)
|
|
55
|
+
*/
|
|
56
|
+
selection?: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A global namespace handling miscellaneous functionality related to the 3D preview
|
|
61
|
+
*/
|
|
62
|
+
declare namespace Canvas {
|
|
63
|
+
const gizmo_colors: Record<string, THREE.Color>
|
|
64
|
+
const materials: {
|
|
65
|
+
[uuid: UUID]: THREE.Material
|
|
66
|
+
}
|
|
67
|
+
const emptyMaterials: {
|
|
68
|
+
[uuid: UUID]: THREE.Material
|
|
69
|
+
}
|
|
70
|
+
const coloredSolidMaterials: THREE.ShaderMaterial[]
|
|
71
|
+
const meshes: {
|
|
72
|
+
[uuid: UUID]: THREE.Mesh
|
|
73
|
+
}
|
|
74
|
+
const bones: {
|
|
75
|
+
[uuid: UUID]: THREE.Object3D
|
|
76
|
+
}
|
|
77
|
+
let outlines: THREE.Object3D
|
|
78
|
+
/**
|
|
79
|
+
* Main scene, shared across all tabs
|
|
80
|
+
*/
|
|
81
|
+
const scene: THREE.Scene
|
|
82
|
+
/**
|
|
83
|
+
* List of the gizmos (control and UI elements) in the 3D scene
|
|
84
|
+
*/
|
|
85
|
+
const gizmos: THREE.Object3D[]
|
|
86
|
+
/**
|
|
87
|
+
* The material used for all selection outlines
|
|
88
|
+
*/
|
|
89
|
+
const outlineMaterial: THREE.LineBasicMaterial
|
|
90
|
+
const meshOutlineMaterial: THREE.LineBasicMaterial
|
|
91
|
+
const onionSkinEarlierMaterial: THREE.LineBasicMaterial
|
|
92
|
+
const onionSkinLaterMaterial: THREE.LineBasicMaterial
|
|
93
|
+
/**
|
|
94
|
+
* The material used for the wireframe view
|
|
95
|
+
*/
|
|
96
|
+
const wireframeMaterial: THREE.MeshBasicMaterial
|
|
97
|
+
const solidMaterial: THREE.ShaderMaterial
|
|
98
|
+
const normalHelperMaterial: THREE.ShaderMaterial
|
|
99
|
+
const uvHelperMaterial: THREE.ShaderMaterial
|
|
100
|
+
const meshVertexMaterial: THREE.PointsMaterial
|
|
101
|
+
const transparentMaterial: THREE.MeshBasicMaterial
|
|
102
|
+
/**
|
|
103
|
+
* The material used for the grids
|
|
104
|
+
*/
|
|
105
|
+
const gridMaterial: THREE.LineBasicMaterial
|
|
106
|
+
|
|
107
|
+
const pivot_marker: THREE.Object3D
|
|
108
|
+
|
|
109
|
+
const ground_plane: THREE.Mesh
|
|
110
|
+
const brush_outline: THREE.Mesh
|
|
111
|
+
|
|
112
|
+
let show_gizmos: boolean
|
|
113
|
+
let ground_animation: boolean
|
|
114
|
+
|
|
115
|
+
const global_light_color: THREE.Color
|
|
116
|
+
let global_light_side: number
|
|
117
|
+
|
|
118
|
+
const face_order: ['east', 'west', 'up', 'down', 'south', 'north']
|
|
119
|
+
|
|
120
|
+
const hover_helper_line: THREE.LineSegments
|
|
121
|
+
const hover_helper_vertex: THREE.Points
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Raycast on the currently selected preview
|
|
125
|
+
*/
|
|
126
|
+
function raycast(event: MouseEvent): any
|
|
127
|
+
/**
|
|
128
|
+
* Execute the callback function without any gizmos, grids and helpers visible
|
|
129
|
+
*/
|
|
130
|
+
function withoutGizmos(cb: () => void): void
|
|
131
|
+
/**
|
|
132
|
+
* Clear all elements from the scene
|
|
133
|
+
*/
|
|
134
|
+
function clear(): void
|
|
135
|
+
function buildGrid(): void
|
|
136
|
+
function updateShading(): void
|
|
137
|
+
function updateViewMode(): void
|
|
138
|
+
function updateCubeHighlights(hover_cube: OutlinerElement, force_off?: boolean): void
|
|
139
|
+
/**
|
|
140
|
+
* Updates selected aspects of the preview
|
|
141
|
+
* @param options
|
|
142
|
+
*/
|
|
143
|
+
function updateView(options: UpdateViewOptions): void
|
|
144
|
+
/**
|
|
145
|
+
* Regenerate all elements in the scene. Very unoptimized, use with care
|
|
146
|
+
*/
|
|
147
|
+
function updateAll(): void
|
|
148
|
+
/**
|
|
149
|
+
* Update the position and shape of all elements
|
|
150
|
+
*/
|
|
151
|
+
function updateAllPositions(): void
|
|
152
|
+
/**
|
|
153
|
+
* Update the visibility of all elements
|
|
154
|
+
*/
|
|
155
|
+
function updateVisibility(): void
|
|
156
|
+
/**
|
|
157
|
+
* Update all faces in the scene
|
|
158
|
+
* @param texture Texture filter. If specified, only faces with this texture will be updated
|
|
159
|
+
*/
|
|
160
|
+
function updateAllFaces(texture?: Texture): void
|
|
161
|
+
/**
|
|
162
|
+
* Update all UV maps in the scene
|
|
163
|
+
*/
|
|
164
|
+
function updateAllUVs(): void
|
|
165
|
+
/**
|
|
166
|
+
* Returns the three.js render sides based on the current settings and state
|
|
167
|
+
*/
|
|
168
|
+
function getRenderSide(): number
|
|
169
|
+
/**
|
|
170
|
+
* Update render sides of all materials
|
|
171
|
+
*/
|
|
172
|
+
function updateRenderSides(): void
|
|
173
|
+
/**
|
|
174
|
+
* Redraw the selected elements in the scene
|
|
175
|
+
* @param arr Optionally specify an array of elements to update
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
function updateSelected(arr: any): void
|
|
179
|
+
/**
|
|
180
|
+
* Update positions and shapes of the selected elements
|
|
181
|
+
*/
|
|
182
|
+
function updatePositions(y?: number): void
|
|
183
|
+
/**
|
|
184
|
+
* Update the faces of all selected elements (material, UV map)
|
|
185
|
+
*/
|
|
186
|
+
function updateSelectedFaces(): void
|
|
187
|
+
/**
|
|
188
|
+
* Update the UV maps of all selected elements
|
|
189
|
+
*/
|
|
190
|
+
function updateUVs(): void
|
|
191
|
+
/**
|
|
192
|
+
* Update the hierarchy and position of all bones
|
|
193
|
+
*/
|
|
194
|
+
function updateAllBones(bones?: OutlinerNode[]): void
|
|
195
|
+
/**
|
|
196
|
+
* Update the position of the origin / pivot point gizmo
|
|
197
|
+
*/
|
|
198
|
+
function updatePivotMarker(): boolean
|
|
199
|
+
/**
|
|
200
|
+
* Update the position and shape of the specified cube
|
|
201
|
+
* @param cube Cube to update
|
|
202
|
+
* @param mesh Mesh instance of the cube
|
|
203
|
+
*/
|
|
204
|
+
function adaptObjectPosition(cube: Cube, mesh?: THREE.Mesh): void
|
|
205
|
+
/**
|
|
206
|
+
* Update the geometry faces of the specified cube
|
|
207
|
+
* @param cube Cube to update
|
|
208
|
+
*/
|
|
209
|
+
function adaptObjectFaceGeo(cube: any): void
|
|
210
|
+
/**
|
|
211
|
+
* Update the faces (material) of the specified cube
|
|
212
|
+
* @param cube Cube to update
|
|
213
|
+
* @param mesh Mesh instance of the cube
|
|
214
|
+
*/
|
|
215
|
+
function adaptObjectFaces(cube: any, mesh: any): void
|
|
216
|
+
/**
|
|
217
|
+
* Update the layered or not layered material of all elements
|
|
218
|
+
*/
|
|
219
|
+
function updateLayeredTextures(): void
|
|
220
|
+
/**
|
|
221
|
+
* Update the UV map of the specified cube
|
|
222
|
+
* @param cube Cube to update
|
|
223
|
+
* @param animation Whether to display the current animated texture frame
|
|
224
|
+
*/
|
|
225
|
+
function updateUV(cube: Cube, animation?: boolean): any
|
|
226
|
+
/**
|
|
227
|
+
* Update the materials of marker colors if new colors were added
|
|
228
|
+
*/
|
|
229
|
+
function updateMarkerColorMaterials(): void
|
|
230
|
+
/**
|
|
231
|
+
* Create an additional outline around the specified cubes
|
|
232
|
+
* @param arr List of cubes to outline
|
|
233
|
+
*/
|
|
234
|
+
function outlineObjects(arr: Cube[]): void
|
|
235
|
+
/**
|
|
236
|
+
* Calculate the size of the model, in the currently displayed shape. Returns [width, height] in blockbench units
|
|
237
|
+
*/
|
|
238
|
+
function getModelSize(): [number, number]
|
|
239
|
+
function getSelectionBounds(): THREE.Box3
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Marks a specific aspect of the interface to be updated in the next tick. Useful to avoid an update function getting called multiple times in the same task.
|
|
244
|
+
*/
|
|
245
|
+
declare namespace TickUpdates {
|
|
246
|
+
private function Run(): void
|
|
247
|
+
let interface: undefined | true
|
|
248
|
+
let outliner: undefined | true
|
|
249
|
+
let selection: undefined | true
|
|
250
|
+
let main_uv: undefined | true
|
|
251
|
+
let texture_list: undefined | true
|
|
252
|
+
let keyframes: undefined | true
|
|
253
|
+
let keyframe_selection: undefined | true
|
|
254
|
+
let keybind_conflicts: undefined | true
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
interface NodePreviewControllerOptions {
|
|
258
|
+
/**
|
|
259
|
+
* NOTE: This option is just for type checking and should not be set in the options object. It should be set inside of the setup function via `this.mesh`
|
|
260
|
+
*
|
|
261
|
+
* ```
|
|
262
|
+
* setup(element) {
|
|
263
|
+
* this.mesh = new THREE.Mesh()
|
|
264
|
+
* }
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
mesh?: THREE.Object3D | THREE.Mesh
|
|
268
|
+
setup?(element: OutlinerNode): void
|
|
269
|
+
remove?(element: OutlinerNode): void
|
|
270
|
+
updateAll?(element: OutlinerNode): void
|
|
271
|
+
updateTransform?(element: OutlinerNode): void
|
|
272
|
+
updateVisibility?(element: OutlinerNode): void
|
|
273
|
+
updateSelection?(element: OutlinerNode): void
|
|
274
|
+
updateGeometry?(element: OutlinerNode): void
|
|
275
|
+
updateUV?(element: OutlinerNode): void
|
|
276
|
+
updateFaces?(element: OutlinerNode): void
|
|
277
|
+
updatePaintingGrid?(element: OutlinerNode): void
|
|
278
|
+
updateHighlight?(element: OutlinerNode, ...args: any[]): void
|
|
279
|
+
[key: string]: any
|
|
280
|
+
}
|
|
281
|
+
interface ViewportRectangleOverlapContext {
|
|
282
|
+
projectPoint: (vector: THREE.Vector3) => ArrayVector2
|
|
283
|
+
extend_selection: boolean
|
|
284
|
+
rect_start: ArrayVector2
|
|
285
|
+
rect_end: ArrayVector2
|
|
286
|
+
preview: Preview
|
|
287
|
+
}
|
|
288
|
+
declare class NodePreviewController {
|
|
289
|
+
constructor(
|
|
290
|
+
type: typeof OutlinerElement | typeof OutlinerNode,
|
|
291
|
+
options: NodePreviewControllerOptions
|
|
292
|
+
)
|
|
293
|
+
type: typeof OutlinerNode
|
|
294
|
+
events: {
|
|
295
|
+
[event_name: string]: ((data: any) => void)[]
|
|
296
|
+
}
|
|
297
|
+
mesh: THREE.Object3D | THREE.Mesh
|
|
298
|
+
dispatchEvent(event_name: string, data: Record<string, any>): void
|
|
299
|
+
/**
|
|
300
|
+
* Adds an event listener
|
|
301
|
+
*/
|
|
302
|
+
on(event_name: string, cb: (data: any) => void): void
|
|
303
|
+
/**
|
|
304
|
+
* Adds a single-use event listener
|
|
305
|
+
*/
|
|
306
|
+
once(event_name: string, cb: (data: any) => void): void
|
|
307
|
+
/**
|
|
308
|
+
* Removes an event listener
|
|
309
|
+
*/
|
|
310
|
+
removeListener(event_name: string, cb: (data: any) => void): void
|
|
311
|
+
|
|
312
|
+
setup(element: OutlinerNode): void
|
|
313
|
+
remove(element: OutlinerNode): void
|
|
314
|
+
updateAll(element: OutlinerNode): void
|
|
315
|
+
updateTransform(element: OutlinerNode): void
|
|
316
|
+
updateVisibility(element: OutlinerNode): void
|
|
317
|
+
updateSelection(element: OutlinerNode): void
|
|
318
|
+
updateGeometry(instance: OutlinerNode): void
|
|
319
|
+
updateUV(instance: OutlinerNode): void
|
|
320
|
+
updateFaces(instance: OutlinerNode): void
|
|
321
|
+
updatePaintingGrid(instance: OutlinerNode): void
|
|
322
|
+
updateHighlight(instance: OutlinerNode, ...args: any[]): void
|
|
323
|
+
viewportRectangleOverlap(element: OutlinerNode, context: ViewportRectangleOverlapContext)
|
|
324
|
+
}
|