From 049fa35b790a7768023a0f21d357d72c3acd3567 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Thu, 21 May 2026 10:32:32 +0200 Subject: [PATCH 1/3] VRMLLoader: Allow multi-line strings. (#33616) --- examples/jsm/loaders/VRMLLoader.js | 2 +- examples/models/vrml/multilineString.wrl | 24 ++++++++++++++++++++++++ examples/webgl_loader_vrml.html | 3 ++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 examples/models/vrml/multilineString.wrl diff --git a/examples/jsm/loaders/VRMLLoader.js b/examples/jsm/loaders/VRMLLoader.js index 61164c73e6c625..de35a700acf5d1 100644 --- a/examples/jsm/loaders/VRMLLoader.js +++ b/examples/jsm/loaders/VRMLLoader.js @@ -220,7 +220,7 @@ class VRMLLoader extends Loader { // - const StringLiteral = createToken( { name: 'StringLiteral', pattern: /"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/ } ); + const StringLiteral = createToken( { name: 'StringLiteral', pattern: /"(?:[^\\"]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/ } ); const HexLiteral = createToken( { name: 'HexLiteral', pattern: /0[xX][0-9a-fA-F]+/ } ); const NumberLiteral = createToken( { name: 'NumberLiteral', pattern: /[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/ } ); const TrueLiteral = createToken( { name: 'TrueLiteral', pattern: /TRUE/ } ); diff --git a/examples/models/vrml/multilineString.wrl b/examples/models/vrml/multilineString.wrl new file mode 100644 index 00000000000000..095a65769be4cb --- /dev/null +++ b/examples/models/vrml/multilineString.wrl @@ -0,0 +1,24 @@ +#VRML V2.0 utf8 +WorldInfo { title "Multi-line string literal test" } +NavigationInfo { type "EXAMINE" } +Background { skyColor [ 0.2 0.2 0.3 ] } + +Transform { + translation 0 0 0 + children [ + Shape { + appearance Appearance { + material Material { diffuseColor 0.2 0.8 0.4 } + } + geometry Box { size 1 1 1 } + } + ] +} + +DEF S Script { + url "javascript: +function touched(value) { + console.log('Box was touched at ' + value); +} +" +} diff --git a/examples/webgl_loader_vrml.html b/examples/webgl_loader_vrml.html index 327c293bd3be77..7bf64bc786e4c7 100644 --- a/examples/webgl_loader_vrml.html +++ b/examples/webgl_loader_vrml.html @@ -56,7 +56,8 @@ 'meshWithTexture', 'pixelTexture', 'points', - 'camera' + 'camera', + 'multilineString' ]; let vrmlScene; From f7e0cb485a9f6e28d177a3aa2172b2bdd22f738c Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Thu, 21 May 2026 12:39:22 +0200 Subject: [PATCH 2/3] AnimationAction: Fix time warping bug. (#33617) --- src/animation/AnimationAction.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/animation/AnimationAction.js b/src/animation/AnimationAction.js index c1a26f17dcb628..62ded0f4fe8dcd 100644 --- a/src/animation/AnimationAction.js +++ b/src/animation/AnimationAction.js @@ -56,6 +56,7 @@ class AnimationAction { this._byClipCacheIndex = null; // for the memory manager this._timeScaleInterpolant = null; + this._restoreTimeScale = null; this._weightInterpolant = null; /** @@ -343,6 +344,10 @@ class AnimationAction { startEndRatio = fadeOutDuration / fadeInDuration, endStartRatio = fadeInDuration / fadeOutDuration; + + fadeOutAction._restoreTimeScale = fadeOutAction.timeScale; + this._restoreTimeScale = this.timeScale; + fadeOutAction.warp( 1.0, startEndRatio, duration ); this.warp( endStartRatio, 1.0, duration ); @@ -511,6 +516,8 @@ class AnimationAction { } + this._restoreTimeScale = null; + return this; } @@ -683,8 +690,6 @@ class AnimationAction { if ( time > interpolant.parameterPositions[ 1 ] ) { - this.stopWarping(); - if ( timeScale === 0 ) { // motion has halted, pause @@ -692,11 +697,19 @@ class AnimationAction { } else { + if ( this._restoreTimeScale !== null ) { + + timeScale = this._restoreTimeScale; + + } + // warp done - apply final time scale this.timeScale = timeScale; } + this.stopWarping(); + } } From 6b719702fbc30f1fc3d6448420601d409df883f8 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Thu, 21 May 2026 13:01:46 +0200 Subject: [PATCH 3/3] Update CatmullRomCurve3.tests.js Clean up. --- test/unit/src/extras/curves/CatmullRomCurve3.tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/src/extras/curves/CatmullRomCurve3.tests.js b/test/unit/src/extras/curves/CatmullRomCurve3.tests.js index 12168610739bcc..f626a10edecf42 100644 --- a/test/unit/src/extras/curves/CatmullRomCurve3.tests.js +++ b/test/unit/src/extras/curves/CatmullRomCurve3.tests.js @@ -387,7 +387,7 @@ export default QUnit.module( 'Extras', () => { assert.deepEqual( points, expectedPoints, 'Correct points calculated' ); } ); - + QUnit.test( 'two points', ( assert ) => { const curve = new CatmullRomCurve3( [