Skip to content

Commit 6b72d23

Browse files
committed
Add blackbox object
1 parent 068ca99 commit 6b72d23

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

js/scripts/generate-wrappers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ var CUSTOM_CLASSES = [
4040
'controls/Picker.js',
4141
'geometries/PlainGeometry.js',
4242
'objects/CloneArray.js',
43+
'objects/Blackbox.js',
4344
];
4445

4546

js/scripts/three-class-config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ module.exports = {
316316
},
317317
propsDefinedByThree: [ 'type' ]
318318
},
319+
Blackbox: {
320+
superClass: 'Object3D',
321+
relativePath: './objects/Blackbox'
322+
},
319323
Raycaster: {
320324
relativePath: './core/Raycaster',
321325
properties: {

js/src/objects/Blackbox.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var _ = require('underscore');
2+
var BlackboxAutogen = require('./Blackbox.autogen').BlackboxModel;
3+
4+
var BlackboxModel = Object3DModel.extend({
5+
6+
defaults: function() {
7+
var superdef = Object3DModel.prototype.defaults.call(this);
8+
delete superdef['children'];
9+
return superdef;
10+
},
11+
12+
13+
createPropertiesArrays: function() {
14+
15+
Object3DModel.prototype.createPropertiesArrays.call(this);
16+
delete this.three_array_properties['children'];
17+
delete this.property_converters['children'];
18+
19+
}
20+
21+
});

pythreejs/objects/Blackbox.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from .Blackbox_autogen import Blackbox as BaseBlackbox
2+
3+
4+
class Blackbox(BaseBlackbox):
5+
"""A widget with unsynced children.
6+
7+
This widget allows extension authors to expose scene control
8+
of a given three object, without attempting to sync its
9+
children. This makes it possible for a library to give
10+
access to an outer object, without exposing the full object
11+
three, and can be useful in avoiding possibly heavy sync
12+
operations.
13+
"""
14+
children = None

0 commit comments

Comments
 (0)