question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Underscores removed from node names in GLTFLoader de-duplication process

See original GitHub issue

Describe the bug

I see in (#16639) that duplicate node names are now appended with _i when using GLTFLoader. I have noticed in my application though that when i use an underscore _ in the node name string, the de-duplicated node process is removing them, which is breaking my application.

Live example The duplicated node name in the below jsfiddle is cool_box

Note that the 2nd and 3rd node names are then renamed cool box_1 & cool box_2 (first underscores removed) https://jsfiddle.net/vthyra4c/

Expected behavior

De-duplicated node names are appended with _i but the rest of the name string should remain intact.

Screenshots

image

Platform:

  • Device: Deskto
  • OS: Linux
  • Browser: Chrome
  • Three.js version: r123

PS. this is one of my first bug reports, let me know if i should have done something differently or included some other helpful info!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ryans1224commented, Dec 15, 2020

@mrdoob Yes, thanks to all

1reaction
ryans1224commented, Dec 9, 2020

@donmccurdy Tried to track it down:

/** When Object3D instances are targeted by animation, they need unique names. */
	GLTFParser.prototype.createUniqueName = function ( originalName ) {

		var name = THREE.PropertyBinding.sanitizeNodeName( originalName || '' );

		for ( var i = 1; this.nodeNamesUsed[ name ]; ++ i ) {

			name = originalName + '_' + i;

		}

		this.nodeNamesUsed[ name ] = true;

		return name;

	};

In the for loop here, should name = originalName + '_' + i; be name = name + '_' + i … otherwise the sanitized node name is thrown out and not used, which correlates to what we are seeing

Read more comments on GitHub >

github_iconTop Results From Across the Web

GLTFLoader – three.js docs
GLTFLoader. A loader for glTF 2.0 resources. glTF (GL Transmission Format) is an open format specification for efficient delivery and loading of 3D...
Read more >
Underscores between words are being removed - Support
I tried setting the style to preformatted , and using markdown syntax ''' and blocks. but it still removed the underscores and italisized...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found