Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 60 additions & 30 deletions build/three.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,36 @@ function log( ...params ) {

}

/**
* Enhances log/warn/error messages related to TSL.
*
* @param {Array<any>} params - The original message parameters.
* @returns {Array<any>} The filtered and enhanced message parameters.
*/
function enhanceLogMessage( params ) {

const message = params[ 0 ];

if ( typeof message === 'string' && message.startsWith( 'TSL:' ) ) {

const stackTrace = params[ 1 ];

if ( stackTrace && stackTrace.isStackTrace ) {

params[ 0 ] += ' ' + stackTrace.getLocation();

} else {

params[ 1 ] = 'Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.';

}

}

return params;

}

/**
* Logs a warning message with the 'THREE.' prefix.
*
Expand All @@ -1960,6 +1990,8 @@ function log( ...params ) {
*/
function warn( ...params ) {

params = enhanceLogMessage( params );

const message = 'THREE.' + params.shift();

if ( _setConsoleFunction ) {
Expand All @@ -1968,7 +2000,17 @@ function warn( ...params ) {

} else {

console.warn( message, ...params );
const stackTrace = params[ 0 ];

if ( stackTrace && stackTrace.isStackTrace ) {

console.warn( stackTrace.getError( message ) );

} else {

console.warn( message, ...params );

}

}

Expand All @@ -1986,6 +2028,8 @@ function warn( ...params ) {
*/
function error( ...params ) {

params = enhanceLogMessage( params );

const message = 'THREE.' + params.shift();

if ( _setConsoleFunction ) {
Expand All @@ -1994,7 +2038,17 @@ function error( ...params ) {

} else {

console.error( message, ...params );
const stackTrace = params[ 0 ];

if ( stackTrace && stackTrace.isStackTrace ) {

console.error( stackTrace.getError( message ) );

} else {

console.error( message, ...params );

}

}

Expand Down Expand Up @@ -51465,31 +51519,31 @@ class PropertyMixer {
this._addIndex = 4;

/**
* TODO
* Accumulated weight of the property binding.
*
* @type {number}
* @default 0
*/
this.cumulativeWeight = 0;

/**
* TODO
* Accumulated additive weight of the property binding.
*
* @type {number}
* @default 0
*/
this.cumulativeWeightAdditive = 0;

/**
* TODO
* Number of active keyframe tracks currently using this property binding.
*
* @type {number}
* @default 0
*/
this.useCount = 0;

/**
* TODO
* Number of keyframe tracks referencing this property binding.
*
* @type {number}
* @default 0
Expand Down Expand Up @@ -57159,30 +57213,6 @@ class PointLightHelper extends Mesh {

this.update();


/*
// TODO: delete this comment?
const distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );
const distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );

this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );
this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );

const d = light.distance;

if ( d === 0.0 ) {

this.lightDistance.visible = false;

} else {

this.lightDistance.scale.set( d, d, d );

}

this.add( this.lightDistance );
*/

}

/**
Expand Down
90 changes: 60 additions & 30 deletions build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1946,6 +1946,36 @@ function log( ...params ) {

}

/**
* Enhances log/warn/error messages related to TSL.
*
* @param {Array<any>} params - The original message parameters.
* @returns {Array<any>} The filtered and enhanced message parameters.
*/
function enhanceLogMessage( params ) {

const message = params[ 0 ];

if ( typeof message === 'string' && message.startsWith( 'TSL:' ) ) {

const stackTrace = params[ 1 ];

if ( stackTrace && stackTrace.isStackTrace ) {

params[ 0 ] += ' ' + stackTrace.getLocation();

} else {

params[ 1 ] = 'Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.';

}

}

return params;

}

/**
* Logs a warning message with the 'THREE.' prefix.
*
Expand All @@ -1958,6 +1988,8 @@ function log( ...params ) {
*/
function warn( ...params ) {

params = enhanceLogMessage( params );

const message = 'THREE.' + params.shift();

if ( _setConsoleFunction ) {
Expand All @@ -1966,7 +1998,17 @@ function warn( ...params ) {

} else {

console.warn( message, ...params );
const stackTrace = params[ 0 ];

if ( stackTrace && stackTrace.isStackTrace ) {

console.warn( stackTrace.getError( message ) );

} else {

console.warn( message, ...params );

}

}

Expand All @@ -1984,6 +2026,8 @@ function warn( ...params ) {
*/
function error( ...params ) {

params = enhanceLogMessage( params );

const message = 'THREE.' + params.shift();

if ( _setConsoleFunction ) {
Expand All @@ -1992,7 +2036,17 @@ function error( ...params ) {

} else {

console.error( message, ...params );
const stackTrace = params[ 0 ];

if ( stackTrace && stackTrace.isStackTrace ) {

console.error( stackTrace.getError( message ) );

} else {

console.error( message, ...params );

}

}

Expand Down Expand Up @@ -51463,31 +51517,31 @@ class PropertyMixer {
this._addIndex = 4;

/**
* TODO
* Accumulated weight of the property binding.
*
* @type {number}
* @default 0
*/
this.cumulativeWeight = 0;

/**
* TODO
* Accumulated additive weight of the property binding.
*
* @type {number}
* @default 0
*/
this.cumulativeWeightAdditive = 0;

/**
* TODO
* Number of active keyframe tracks currently using this property binding.
*
* @type {number}
* @default 0
*/
this.useCount = 0;

/**
* TODO
* Number of keyframe tracks referencing this property binding.
*
* @type {number}
* @default 0
Expand Down Expand Up @@ -57157,30 +57211,6 @@ class PointLightHelper extends Mesh {

this.update();


/*
// TODO: delete this comment?
const distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );
const distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );

this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );
this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );

const d = light.distance;

if ( d === 0.0 ) {

this.lightDistance.visible = false;

} else {

this.lightDistance.scale.set( d, d, d );

}

this.add( this.lightDistance );
*/

}

/**
Expand Down
2 changes: 1 addition & 1 deletion build/three.core.min.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions build/three.tsl.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.tsl.min.js

Large diffs are not rendered by default.

Loading
Loading