Skip to content

TSL: fix string and arrayBuffer#2124

Open
linbingquan wants to merge 1 commit intothree-types:masterfrom
linbingquan:dev-tsl
Open

TSL: fix string and arrayBuffer#2124
linbingquan wants to merge 1 commit intothree-types:masterfrom
linbingquan:dev-tsl

Conversation

@linbingquan
Copy link
Copy Markdown
Contributor

string and arrayBuffer can work in r183

export const string: (value?: string) => Node<"string">;
export const arrayBuffer: (value: ArrayBuffer) => Node<"ArrayBuffer">;

string and arrayBuffer can not work in r184

export const string: unknown;
export const arrayBuffer: unknown;

Change PR: #2058

Copilot AI review requested due to automatic review settings April 17, 2026 09:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Methuselah96
Copy link
Copy Markdown
Contributor

Methuselah96 commented Apr 18, 2026

Thanks, I'm trying to write a test for this, but I get the following error:

THREE.TSL: Error: NodeBuilder: Type 'string' not found in generate constant attempt. "WGSLNodeBuilder.generateConst()" at "chunk-DTNUIGMS.js:56143"
    at WGSLNodeBuilder.generateConst (chunk-DTNUIGMS.js:56143:11)
    at ConstNode.generateConst (chunk-DTNUIGMS.js:33393:20)
    at ConstNode.generate (chunk-DTNUIGMS.js:33400:32)
    at ConstNode.build (chunk-DTNUIGMS.js:32812:23)
    at DebugNode.generate (chunk-DTNUIGMS.js:36564:31)
    at DebugNode.build (chunk-DTNUIGMS.js:32801:27)
    at DebugNode.build (chunk-DTNUIGMS.js:33063:18)
    at ConvertNode.generate (chunk-DTNUIGMS.js:33020:26)
    at ConvertNode.build (chunk-DTNUIGMS.js:32812:23)
    at VarNode.build (chunk-DTNUIGMS.js:35521:26)

Can you provide some examples of how you're using the string and arrayBuffer methods? I couldn't find any usages of them in the three.js repository.

@linbingquan
Copy link
Copy Markdown
Contributor Author

Can you provide some examples of how you're using the string and arrayBuffer methods? I couldn't find any usages of them in the three.js repository.

Thank you for your reply. This is indeed a good question. TBH, I make an node-editor app just warp string method with UI, like: string(value). I have not been warp arrayBuffer method.

It might be necessary for the author to explain how these two methods should be applied.

Sorry, there was an error during the integration test. I only looked at the implementation of these two methods...

// three.js/src/nodes/tsl/TSLCore.js#L1195-L1196
export const string = ( value = '' ) => new ConstNode( value, 'string' );
export const arrayBuffer = ( value ) => new ConstNode( value, 'ArrayBuffer' );

This PR might contain something I'm not aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants