Skip to content

Commit f6bb122

Browse files
committed
Fix types with special action in python wrapper gen
1 parent 51e2c7a commit f6bb122

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

js/scripts/generate-wrappers.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ function getClassConfig(className) {
157157
classConfigs._defaults
158158
);
159159

160+
if ('type' in result.allProperties && result.allProperties.type instanceof Types.String) {
161+
if ('type' in result.properties) {
162+
result.properties.type.defaultValue = className;
163+
} else {
164+
result.properties.type = new Types.String(className);
165+
result.allProperties.type = result.properties.type;
166+
}
167+
}
168+
160169
return result;
161170
}
162171

js/scripts/three-class-config.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ module.exports = {
102102
relativePath: './cameras/CubeCamera',
103103
superClass: 'Object3D',
104104
properties: {
105-
type: new Types.String('CubeCamera'),
106105
}
107106
},
108107
OrthographicCamera: {
@@ -116,7 +115,6 @@ module.exports = {
116115
bottom: new Types.Float(),
117116
near: new Types.Float(0.1),
118117
far: new Types.Float(2000),
119-
type: new Types.String('OrthographicCamera'),
120118
},
121119
constructorArgs: [ 'left', 'right', 'top', 'bottom', 'near', 'far' ],
122120
},
@@ -133,15 +131,13 @@ module.exports = {
133131
// view: new Types.Dict(),
134132
// filmGauge: new Types.Float(35.0),
135133
// filmOffset: new Types.Float(0.0),
136-
type: new Types.String('PerspectiveCamera'),
137134
},
138135
constructorArgs: [ 'fov', 'aspect', 'near', 'far' ],
139136
},
140137
ArrayCamera: {
141138
relativePath: './cameras/ArrayCamera',
142139
superClass: 'PerspectiveCamera',
143140
properties: {
144-
type: new Types.String('ArrayCamera'),
145141
},
146142
constructorArgs: [ 'fov', 'aspect', 'near', 'far' ],
147143
},
@@ -347,7 +343,6 @@ module.exports = {
347343
attributes: new Types.ThreeTypeDict(['BufferAttribute', 'InterleavedBufferAttribute']),
348344
morphAttributes: new Types.BufferMorphAttributes(),
349345
MaxIndex: new Types.Int(65535),
350-
type: new Types.String('BufferGeometry'),
351346
// TODO: These likely require special types:
352347
//groups: new Types.GeometryGroup(),
353348
//drawRange: new Types.DrawRange(),
@@ -675,7 +670,6 @@ module.exports = {
675670
refractionRatio: new Types.Float(0.98),
676671
skinning: new Types.Bool(false),
677672
specularMap: new Types.ThreeType('Texture'),
678-
type: new Types.String('MeshBasicMaterial'),
679673
wireframe: new Types.Bool(false),
680674
wireframeLinewidth: new Types.Float(1),
681675
wireframeLinecap: new Types.String('round'), // TODO: enum?
@@ -1044,7 +1038,6 @@ module.exports = {
10441038
geometry: new Types.ThreeType(['BaseGeometry', 'BaseBufferGeometry'], {nullable: false}),
10451039
drawMode: new Types.Enum('DrawModes', 'TrianglesDrawMode'),
10461040
morphTargetInfluences: new Types.Array(),
1047-
type: new Types.String('Mesh'),
10481041
},
10491042
propsDefinedByThree: ['morphTargetInfluences'],
10501043
},
@@ -1682,7 +1675,6 @@ module.exports = {
16821675
hex: new Types.Int(0),
16831676
headLength: new Types.Float(null, {nullable: true}),
16841677
headWidth: new Types.Float(null, {nullable: true}),
1685-
type: new Types.String('ArrowHelper'),
16861678
},
16871679
},
16881680
AxesHelper: {

0 commit comments

Comments
 (0)