blockbench-types 5.1.0-beta.3-next.2 → 5.1.0
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 +256 -256
- package/custom/animation_controller.d.ts +124 -124
- package/custom/blockbench.d.ts +73 -73
- package/custom/canvas.d.ts +307 -307
- package/custom/codec.d.ts +182 -182
- package/custom/copy_paste.d.ts +42 -42
- package/custom/cube.d.ts +151 -151
- package/custom/desktop.d.ts +73 -73
- package/custom/display_mode.d.ts +137 -137
- package/custom/edit_session.d.ts +37 -37
- package/custom/global.d.ts +168 -168
- package/custom/group.d.ts +113 -113
- package/custom/interface.d.ts +78 -78
- package/custom/io.d.ts +12 -12
- package/custom/keyframe.d.ts +94 -94
- package/custom/libs.d.ts +13 -13
- package/custom/menu.d.ts +136 -136
- package/custom/mesh.d.ts +196 -196
- package/custom/misc.d.ts +199 -199
- package/custom/molang.d.ts +159 -159
- package/custom/outliner.d.ts +158 -158
- package/custom/painter.d.ts +69 -69
- package/custom/preview.d.ts +137 -137
- package/custom/preview_scene.d.ts +120 -120
- package/custom/screencam.d.ts +71 -71
- package/custom/spline_mesh.d.ts +189 -189
- package/custom/start_screen.d.ts +14 -14
- package/custom/texture_group.d.ts +68 -68
- package/custom/texture_layers.d.ts +117 -117
- package/custom/textures.d.ts +515 -515
- package/custom/timeline.d.ts +66 -66
- package/custom/toolbars.d.ts +221 -221
- package/custom/undo.d.ts +208 -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/global_types.d.ts +47 -0
- package/generated/io/formats/bedrock.d.ts +4 -0
- package/generated/io/formats/bedrock_old.d.ts +4 -0
- package/generated/io/formats/collada.d.ts +4 -0
- package/generated/io/formats/fbx.d.ts +17 -0
- package/generated/io/formats/gltf.d.ts +6 -0
- package/generated/io/formats/java_block.d.ts +4 -0
- package/generated/io/formats/modded_entity.d.ts +139 -0
- package/generated/io/formats/obj.d.ts +12 -0
- package/generated/io/formats/optifine_jem.d.ts +3 -0
- package/generated/io/formats/optifine_jpm.d.ts +3 -0
- package/generated/io/formats/skin.d.ts +22 -0
- package/index.d.ts +2 -2
- package/package.json +39 -39
- package/tsconfig.json +19 -19
- package/type_config.json +46 -46
package/custom/mesh.d.ts
CHANGED
|
@@ -1,196 +1,196 @@
|
|
|
1
|
-
/// <reference types="./blockbench"/>
|
|
2
|
-
|
|
3
|
-
type OccupationMatrix = {
|
|
4
|
-
[x: number]: {
|
|
5
|
-
[y: number]: boolean
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
type MeshEdge = [string, string]
|
|
9
|
-
|
|
10
|
-
type MeshSeamValue = 'auto' | 'divide' | 'join'
|
|
11
|
-
interface MeshOptions {
|
|
12
|
-
name?: string
|
|
13
|
-
color?: number
|
|
14
|
-
visibility?: boolean
|
|
15
|
-
rotation?: ArrayVector3
|
|
16
|
-
origin?: ArrayVector3
|
|
17
|
-
vertices?: {
|
|
18
|
-
[vkey: string]: ArrayVector3
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface MeshFaceOptions extends FaceOptions {
|
|
23
|
-
vertices?: string[]
|
|
24
|
-
uv?: { [vkey: string]: ArrayVector2 }
|
|
25
|
-
}
|
|
26
|
-
declare class MeshFace extends Face {
|
|
27
|
-
constructor(mesh: Mesh, data: MeshFaceOptions)
|
|
28
|
-
/**
|
|
29
|
-
* The vertices that make up the face, as vertex keys. The vertices go around the face counter-clockwise when looking at the front side of the face. That also means that reversing the vertex order reverses the face direction.
|
|
30
|
-
*/
|
|
31
|
-
vertices: string[]
|
|
32
|
-
mesh: Mesh
|
|
33
|
-
uv: {
|
|
34
|
-
[vertex: string]: ArrayVector2
|
|
35
|
-
}
|
|
36
|
-
extend(data: MeshFaceOptions): this
|
|
37
|
-
/**
|
|
38
|
-
* Returns the face normal in mesh space as calculated from the vertex positions
|
|
39
|
-
* @param normalize If true, the values will be normalized.
|
|
40
|
-
* @param alt_tri On quads, if true, this will return the normal of the second tri instead of the first
|
|
41
|
-
*/
|
|
42
|
-
getNormal(normalize: boolean = false, alt_tri?: boolean): ArrayVector3
|
|
43
|
-
/**
|
|
44
|
-
* Calculates which pixels the UV face occupies, and returns them as a map
|
|
45
|
-
*/
|
|
46
|
-
getOccupationMatrix(
|
|
47
|
-
texture_space?: boolean,
|
|
48
|
-
start_offset?: ArrayVector2,
|
|
49
|
-
matrix?: OccupationMatrix
|
|
50
|
-
): OccupationMatrix
|
|
51
|
-
/**
|
|
52
|
-
* Get the keys of this face and all faces that are connected with it on the UV map
|
|
53
|
-
*/
|
|
54
|
-
getUVIsland(): string[]
|
|
55
|
-
/**
|
|
56
|
-
* Returns the angle between two faces in degrees
|
|
57
|
-
*/
|
|
58
|
-
getAngleTo(other_face: MeshFace): number
|
|
59
|
-
/**
|
|
60
|
-
* Inverts the direction of the face
|
|
61
|
-
*/
|
|
62
|
-
invert(): void
|
|
63
|
-
/**
|
|
64
|
-
* Returns whether the face is selected
|
|
65
|
-
* @param face_key Optional face key of the face, the method runs faster if this is provided
|
|
66
|
-
*/
|
|
67
|
-
isSelected(face_key?: string): boolean
|
|
68
|
-
/**
|
|
69
|
-
* Returns true if the face is concave
|
|
70
|
-
*/
|
|
71
|
-
isConcave(): boolean
|
|
72
|
-
/**
|
|
73
|
-
* Returns the vertices of a quad in an order that creates a convex quad shape if possible. If the face has less than 4 vertices, it just returns the vertices in original order.
|
|
74
|
-
*/
|
|
75
|
-
getSortedVertices(): string[]
|
|
76
|
-
/**
|
|
77
|
-
* Get the adjacent face in the specified side
|
|
78
|
-
*/
|
|
79
|
-
getAdjacentFace(
|
|
80
|
-
side_index: number
|
|
81
|
-
): { face: MeshFace; key: string; edge: MeshEdge; index: number } | null
|
|
82
|
-
/**
|
|
83
|
-
* Return all edges of the face
|
|
84
|
-
*/
|
|
85
|
-
getEdges(): [string, string][]
|
|
86
|
-
/**
|
|
87
|
-
* Returns the face key
|
|
88
|
-
*/
|
|
89
|
-
getFaceKey(): string
|
|
90
|
-
/**
|
|
91
|
-
* Takes a UV coordinate and turns it into a 3D space coordinate in local space of the mesh. On quads, the first triangle is used for calculation, so the coordinates on warped quads may be inaccurate.
|
|
92
|
-
*/
|
|
93
|
-
UVToLocal(uv: ArrayVector2): THREE.Vector3
|
|
94
|
-
/**
|
|
95
|
-
* Takes a 3D coordinate in local space of the mesh, and turns it into a coordinate on the UV map using barycentric coordinates. On quads, the first triangle is used for calculation, so the coordinates on warped quads may be inaccurate.
|
|
96
|
-
*/
|
|
97
|
-
localToUV(vector: THREE.Vector3): ArrayVector2
|
|
98
|
-
/**
|
|
99
|
-
* Get the face center by weight in local space
|
|
100
|
-
*/
|
|
101
|
-
getCenter(): ArrayVector3
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
interface MeshOptions {
|
|
105
|
-
name?: string
|
|
106
|
-
color?: number
|
|
107
|
-
visibility?: boolean
|
|
108
|
-
shading?: 'flat' | 'smooth'
|
|
109
|
-
rotation?: ArrayVector3
|
|
110
|
-
origin?: ArrayVector3
|
|
111
|
-
vertices?: {
|
|
112
|
-
[vkey: string]: ArrayVector3
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
declare class Mesh extends OutlinerElement {
|
|
116
|
-
constructor(options: Partial<MeshOptions>, uuid?: string)
|
|
117
|
-
|
|
118
|
-
shading: 'flat' | 'smooth'
|
|
119
|
-
visibility: boolean
|
|
120
|
-
color: number
|
|
121
|
-
origin: ArrayVector3
|
|
122
|
-
rotation: ArrayVector3
|
|
123
|
-
|
|
124
|
-
vertices: {
|
|
125
|
-
[vkey: string]: ArrayVector3
|
|
126
|
-
}
|
|
127
|
-
faces: {
|
|
128
|
-
[fkey: string]: MeshFace
|
|
129
|
-
}
|
|
130
|
-
seams: {
|
|
131
|
-
[vkey: string]: MeshSeamValue
|
|
132
|
-
}
|
|
133
|
-
vertice_list: ArrayVector3[]
|
|
134
|
-
armature: string
|
|
135
|
-
|
|
136
|
-
extend(options: Partial<MeshOptions>): this
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Get selected vertices as vertex keys
|
|
140
|
-
* @param can_write If true, the array can safely be modified to update the selection
|
|
141
|
-
*/
|
|
142
|
-
getSelectedVertices(can_write?: boolean): string[]
|
|
143
|
-
/**
|
|
144
|
-
* Get selected edges as vertex key pairs
|
|
145
|
-
* @param can_write If true, the array can safely be modified to update the selection
|
|
146
|
-
*/
|
|
147
|
-
getSelectedEdges(can_write?: boolean): [string, string][]
|
|
148
|
-
/**
|
|
149
|
-
* Get selected faces as face keys
|
|
150
|
-
* @param can_write If true, the array can safely be modified to update the selection
|
|
151
|
-
*/
|
|
152
|
-
getSelectedFaces(can_write?: boolean): string[]
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Get the armature if one is attached to the mesh
|
|
156
|
-
*/
|
|
157
|
-
getArmature() : Armature | undefined
|
|
158
|
-
/**
|
|
159
|
-
* Vertex lists of quads are generally in arbitrary order, the order is calculated when calling getSortedVertices() to account for dfiferent face geometries. Calling this method pre-sorts all faces to allow optimizing subsequent processing
|
|
160
|
-
*/
|
|
161
|
-
sortAllFaceVertices(): void
|
|
162
|
-
calculateNormals(): Record<string, ArrayVector3>
|
|
163
|
-
|
|
164
|
-
setSeam(edge: MeshEdge, value: any): void
|
|
165
|
-
getSeam(edge: MeshEdge): MeshSeamValue
|
|
166
|
-
getWorldCenter(ignore_mesh_selection?: boolean): THREE.Vector3
|
|
167
|
-
addVertices(...ArrayVector3: ArrayVector3[]): string[]
|
|
168
|
-
addFaces(...MeshFace: MeshFace[]): string[]
|
|
169
|
-
extend(data: MeshOptions): void
|
|
170
|
-
getUndoCopy(aspects?: any): any
|
|
171
|
-
getSelectionRotation(): THREE.Euler
|
|
172
|
-
getCenter(global: boolean): THREE.Vector3
|
|
173
|
-
forAllFaces(callback: (face: MeshFace, key: string) => void): void
|
|
174
|
-
transferOrigin(origin: ArrayVector3, update?: boolean): void
|
|
175
|
-
setColor(color: number): void
|
|
176
|
-
roll(axis: number, steps: number, origin?: ArrayVector3): void
|
|
177
|
-
flip(axis: number): void
|
|
178
|
-
moveVector(offset: ArrayVector3, axis: number, update?: boolean): void
|
|
179
|
-
resize(
|
|
180
|
-
val: number,
|
|
181
|
-
axis: number,
|
|
182
|
-
negative: boolean,
|
|
183
|
-
allow_negative: boolean,
|
|
184
|
-
bidirectional?: boolean
|
|
185
|
-
): void
|
|
186
|
-
applyTexture(texture: Texture, faces?: true | undefined | string[]): void
|
|
187
|
-
|
|
188
|
-
static all: Mesh[]
|
|
189
|
-
static selected: Mesh[]
|
|
190
|
-
/**Check if any elements of the type are in the project */
|
|
191
|
-
static hasAny: () => boolean
|
|
192
|
-
/**Check if any elements of the type are currently selected */
|
|
193
|
-
static hasSelected: () => boolean
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
interface MeshFaceOptions extends FaceOptions {}
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
|
|
3
|
+
type OccupationMatrix = {
|
|
4
|
+
[x: number]: {
|
|
5
|
+
[y: number]: boolean
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
type MeshEdge = [string, string]
|
|
9
|
+
|
|
10
|
+
type MeshSeamValue = 'auto' | 'divide' | 'join'
|
|
11
|
+
interface MeshOptions {
|
|
12
|
+
name?: string
|
|
13
|
+
color?: number
|
|
14
|
+
visibility?: boolean
|
|
15
|
+
rotation?: ArrayVector3
|
|
16
|
+
origin?: ArrayVector3
|
|
17
|
+
vertices?: {
|
|
18
|
+
[vkey: string]: ArrayVector3
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface MeshFaceOptions extends FaceOptions {
|
|
23
|
+
vertices?: string[]
|
|
24
|
+
uv?: { [vkey: string]: ArrayVector2 }
|
|
25
|
+
}
|
|
26
|
+
declare class MeshFace extends Face {
|
|
27
|
+
constructor(mesh: Mesh, data: MeshFaceOptions)
|
|
28
|
+
/**
|
|
29
|
+
* The vertices that make up the face, as vertex keys. The vertices go around the face counter-clockwise when looking at the front side of the face. That also means that reversing the vertex order reverses the face direction.
|
|
30
|
+
*/
|
|
31
|
+
vertices: string[]
|
|
32
|
+
mesh: Mesh
|
|
33
|
+
uv: {
|
|
34
|
+
[vertex: string]: ArrayVector2
|
|
35
|
+
}
|
|
36
|
+
extend(data: MeshFaceOptions): this
|
|
37
|
+
/**
|
|
38
|
+
* Returns the face normal in mesh space as calculated from the vertex positions
|
|
39
|
+
* @param normalize If true, the values will be normalized.
|
|
40
|
+
* @param alt_tri On quads, if true, this will return the normal of the second tri instead of the first
|
|
41
|
+
*/
|
|
42
|
+
getNormal(normalize: boolean = false, alt_tri?: boolean): ArrayVector3
|
|
43
|
+
/**
|
|
44
|
+
* Calculates which pixels the UV face occupies, and returns them as a map
|
|
45
|
+
*/
|
|
46
|
+
getOccupationMatrix(
|
|
47
|
+
texture_space?: boolean,
|
|
48
|
+
start_offset?: ArrayVector2,
|
|
49
|
+
matrix?: OccupationMatrix
|
|
50
|
+
): OccupationMatrix
|
|
51
|
+
/**
|
|
52
|
+
* Get the keys of this face and all faces that are connected with it on the UV map
|
|
53
|
+
*/
|
|
54
|
+
getUVIsland(): string[]
|
|
55
|
+
/**
|
|
56
|
+
* Returns the angle between two faces in degrees
|
|
57
|
+
*/
|
|
58
|
+
getAngleTo(other_face: MeshFace): number
|
|
59
|
+
/**
|
|
60
|
+
* Inverts the direction of the face
|
|
61
|
+
*/
|
|
62
|
+
invert(): void
|
|
63
|
+
/**
|
|
64
|
+
* Returns whether the face is selected
|
|
65
|
+
* @param face_key Optional face key of the face, the method runs faster if this is provided
|
|
66
|
+
*/
|
|
67
|
+
isSelected(face_key?: string): boolean
|
|
68
|
+
/**
|
|
69
|
+
* Returns true if the face is concave
|
|
70
|
+
*/
|
|
71
|
+
isConcave(): boolean
|
|
72
|
+
/**
|
|
73
|
+
* Returns the vertices of a quad in an order that creates a convex quad shape if possible. If the face has less than 4 vertices, it just returns the vertices in original order.
|
|
74
|
+
*/
|
|
75
|
+
getSortedVertices(): string[]
|
|
76
|
+
/**
|
|
77
|
+
* Get the adjacent face in the specified side
|
|
78
|
+
*/
|
|
79
|
+
getAdjacentFace(
|
|
80
|
+
side_index: number
|
|
81
|
+
): { face: MeshFace; key: string; edge: MeshEdge; index: number } | null
|
|
82
|
+
/**
|
|
83
|
+
* Return all edges of the face
|
|
84
|
+
*/
|
|
85
|
+
getEdges(): [string, string][]
|
|
86
|
+
/**
|
|
87
|
+
* Returns the face key
|
|
88
|
+
*/
|
|
89
|
+
getFaceKey(): string
|
|
90
|
+
/**
|
|
91
|
+
* Takes a UV coordinate and turns it into a 3D space coordinate in local space of the mesh. On quads, the first triangle is used for calculation, so the coordinates on warped quads may be inaccurate.
|
|
92
|
+
*/
|
|
93
|
+
UVToLocal(uv: ArrayVector2): THREE.Vector3
|
|
94
|
+
/**
|
|
95
|
+
* Takes a 3D coordinate in local space of the mesh, and turns it into a coordinate on the UV map using barycentric coordinates. On quads, the first triangle is used for calculation, so the coordinates on warped quads may be inaccurate.
|
|
96
|
+
*/
|
|
97
|
+
localToUV(vector: THREE.Vector3): ArrayVector2
|
|
98
|
+
/**
|
|
99
|
+
* Get the face center by weight in local space
|
|
100
|
+
*/
|
|
101
|
+
getCenter(): ArrayVector3
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface MeshOptions {
|
|
105
|
+
name?: string
|
|
106
|
+
color?: number
|
|
107
|
+
visibility?: boolean
|
|
108
|
+
shading?: 'flat' | 'smooth'
|
|
109
|
+
rotation?: ArrayVector3
|
|
110
|
+
origin?: ArrayVector3
|
|
111
|
+
vertices?: {
|
|
112
|
+
[vkey: string]: ArrayVector3
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
declare class Mesh extends OutlinerElement {
|
|
116
|
+
constructor(options: Partial<MeshOptions>, uuid?: string)
|
|
117
|
+
|
|
118
|
+
shading: 'flat' | 'smooth'
|
|
119
|
+
visibility: boolean
|
|
120
|
+
color: number
|
|
121
|
+
origin: ArrayVector3
|
|
122
|
+
rotation: ArrayVector3
|
|
123
|
+
|
|
124
|
+
vertices: {
|
|
125
|
+
[vkey: string]: ArrayVector3
|
|
126
|
+
}
|
|
127
|
+
faces: {
|
|
128
|
+
[fkey: string]: MeshFace
|
|
129
|
+
}
|
|
130
|
+
seams: {
|
|
131
|
+
[vkey: string]: MeshSeamValue
|
|
132
|
+
}
|
|
133
|
+
vertice_list: ArrayVector3[]
|
|
134
|
+
armature: string
|
|
135
|
+
|
|
136
|
+
extend(options: Partial<MeshOptions>): this
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Get selected vertices as vertex keys
|
|
140
|
+
* @param can_write If true, the array can safely be modified to update the selection
|
|
141
|
+
*/
|
|
142
|
+
getSelectedVertices(can_write?: boolean): string[]
|
|
143
|
+
/**
|
|
144
|
+
* Get selected edges as vertex key pairs
|
|
145
|
+
* @param can_write If true, the array can safely be modified to update the selection
|
|
146
|
+
*/
|
|
147
|
+
getSelectedEdges(can_write?: boolean): [string, string][]
|
|
148
|
+
/**
|
|
149
|
+
* Get selected faces as face keys
|
|
150
|
+
* @param can_write If true, the array can safely be modified to update the selection
|
|
151
|
+
*/
|
|
152
|
+
getSelectedFaces(can_write?: boolean): string[]
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Get the armature if one is attached to the mesh
|
|
156
|
+
*/
|
|
157
|
+
getArmature() : Armature | undefined
|
|
158
|
+
/**
|
|
159
|
+
* Vertex lists of quads are generally in arbitrary order, the order is calculated when calling getSortedVertices() to account for dfiferent face geometries. Calling this method pre-sorts all faces to allow optimizing subsequent processing
|
|
160
|
+
*/
|
|
161
|
+
sortAllFaceVertices(): void
|
|
162
|
+
calculateNormals(): Record<string, ArrayVector3>
|
|
163
|
+
|
|
164
|
+
setSeam(edge: MeshEdge, value: any): void
|
|
165
|
+
getSeam(edge: MeshEdge): MeshSeamValue
|
|
166
|
+
getWorldCenter(ignore_mesh_selection?: boolean): THREE.Vector3
|
|
167
|
+
addVertices(...ArrayVector3: ArrayVector3[]): string[]
|
|
168
|
+
addFaces(...MeshFace: MeshFace[]): string[]
|
|
169
|
+
extend(data: MeshOptions): void
|
|
170
|
+
getUndoCopy(aspects?: any): any
|
|
171
|
+
getSelectionRotation(): THREE.Euler
|
|
172
|
+
getCenter(global: boolean): THREE.Vector3
|
|
173
|
+
forAllFaces(callback: (face: MeshFace, key: string) => void): void
|
|
174
|
+
transferOrigin(origin: ArrayVector3, update?: boolean): void
|
|
175
|
+
setColor(color: number): void
|
|
176
|
+
roll(axis: number, steps: number, origin?: ArrayVector3): void
|
|
177
|
+
flip(axis: number): void
|
|
178
|
+
moveVector(offset: ArrayVector3, axis: number, update?: boolean): void
|
|
179
|
+
resize(
|
|
180
|
+
val: number,
|
|
181
|
+
axis: number,
|
|
182
|
+
negative: boolean,
|
|
183
|
+
allow_negative: boolean,
|
|
184
|
+
bidirectional?: boolean
|
|
185
|
+
): void
|
|
186
|
+
applyTexture(texture: Texture, faces?: true | undefined | string[]): void
|
|
187
|
+
|
|
188
|
+
static all: Mesh[]
|
|
189
|
+
static selected: Mesh[]
|
|
190
|
+
/**Check if any elements of the type are in the project */
|
|
191
|
+
static hasAny: () => boolean
|
|
192
|
+
/**Check if any elements of the type are currently selected */
|
|
193
|
+
static hasSelected: () => boolean
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface MeshFaceOptions extends FaceOptions {}
|