Skip to content

Commit e24403c

Browse files
committed
Minor fixes
1 parent 9a7b145 commit e24403c

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

js/scripts/prop-types.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ _.extend(Bool.prototype, BaseType.prototype, {
162162
var nullableStr = this.nullable ? 'True' : 'False';
163163
return `Bool(${this.getPythonDefaultValue()}, allow_none=${nullableStr}).tag(sync=True)`;
164164
},
165+
getPropertyConverterFn: function() {
166+
return 'convertBool';
167+
},
165168
});
166169

167170
function Int(defaultValue, nullable) {

js/scripts/three-class-config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ module.exports = {
194194
relativePath: './core/BufferAttribute',
195195
properties: {
196196
array: new Types.ArrayBuffer(),
197-
count: new Types.Int(0),
197+
// count: new Types.Int(0), // inferred from array
198198
dynamic: new Types.Bool(false),
199-
//itemSize: new Types.Int(1), // Item size is inferred from array
199+
//itemSize: new Types.Int(1), // inferred from array
200200
needsUpdate: new Types.Bool(false),
201201
normalized: new Types.Bool(true),
202202
version: new Types.Int(-1),
203203
},
204204
constructorArgs: [ 'array', 'normalized' ],
205-
propsDefinedByThree: [ 'count', 'version' ]
205+
propsDefinedByThree: [ 'version' ]
206206
},
207207
BufferGeometry: {
208208
relativePath: './core/BufferGeometry',

js/src/_base/Three.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,16 @@ var ThreeModel = widgets.WidgetModel.extend({
482482
return v;
483483
},
484484

485+
// Bool
486+
convertBoolModelToThree: function(v, propName) {
487+
return v;
488+
},
489+
490+
convertBoolThreeToModel: function(v, propName) {
491+
// Coerce falsy/truthy:
492+
return !!v;
493+
},
494+
485495
// Enum
486496
convertEnumModelToThree: function(e, propName) {
487497
return THREE[e];

js/src/geometries/PlainGeometry.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var PlainGeometryModel = AutogenPlainGeometryModel.extend({
2020
[
2121
'name', 'colors', 'faces', 'vertices', 'faceVertexUvs', 'morphTargets',
2222
'morphNormals', 'skinWeights', 'skinIndices', 'lineDistances',
23-
'boundingBox', 'boundingSphere'
2423
].forEach(key => {
2524
this.props_created_by_three[key] = true;
2625
});

0 commit comments

Comments
 (0)