THREE.Object3D.prototype.add = function ( object ) { console.log( 'Add was invoked at ' + (new Date().toLocaleString()) + ' uuid: ' + object.uuid + '\n'); if ( arguments.length > 1 ) { for ( var i = 0; i < arguments.length; i ++ ) this.add( arguments[ i ] ); return this; } if ( object === this ) { console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); return this; } if ( ( object && object.isObject3D ) ) { if ( object.parent !== null ) { object.parent.remove( object ); } object.parent = this; object.dispatchEvent( { type: 'added' } ); this.children.push( object ); } else { console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); } return this; };