Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node: Static and dynamic output type for extended nodes #22590

Merged
merged 2 commits into from
Sep 27, 2021

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Sep 27, 2021

Description

Now NodeMaterial support static and dynamic generate output type for extended nodes, therefore is not more necessary to convert all generate snippet for a different output in an extended Node, it simplifies the code for creation of futures Nodes besides being backwards compatibly.

How a simple code design change can make a difference: Only here, we reduce more than 100 lines of code...

Usage

Static

Allow that Node class convert the default snippet generated for the requested output.

class ExtendedNode extends Node{

	// static generate ( static output format )

	generate( builder ) {

		// code...

	}

}

Dynamic

Allow that the Node find the better snippet for the requested output.

class ExtendedNode extends Node{

	// dynamic generate ( dynamic output format )

	generate( builder, output ) {

		// code...

	}

}

This contribution is funded by Google via Igalia.

@mrdoob mrdoob added this to the r133 milestone Sep 27, 2021
@mrdoob mrdoob merged commit 92d8264 into mrdoob:dev Sep 27, 2021
@mrdoob
Copy link
Owner

mrdoob commented Sep 27, 2021

Thanks!

@sunag sunag deleted the dev-generateType branch September 28, 2021 08:54
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.

2 participants