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

NodeMaterial: Accessing modules from Node lib #22554

Merged
merged 4 commits into from
Sep 20, 2021
Merged

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Sep 19, 2021

Description

It can simplify the NodeMaterial creation by reducing the number of imports needs.

Usage:

import * as Nodes from './jsm/renderers/nodes/Nodes.js';

const material = new Nodes.MeshStandardNodeMaterial();
material.colorNode = new Nodes.ColorNode( new THREE.Color( 0x0000FF ) );

This contribution is funded by Google via Igalia.

@mrdoob mrdoob requested a review from Mugen87 September 20, 2021 09:46
@mrdoob mrdoob added this to the r133 milestone Sep 20, 2021
Copy link
Collaborator

@Mugen87 Mugen87 left a comment

Choose a reason for hiding this comment

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

The change looks good! It's nice to have the possibility to import the node classes via a single import.

I just wonder if we should updated the examples. I know it's matter of personal preference but I like the direct imports a bit more than using the Nodes. prefix.

@mrdoob How do you feel about this?

@mrdoob
Copy link
Owner

mrdoob commented Sep 20, 2021

I prefer the Nodes prefix. Makes the examples simpler.

@mrdoob mrdoob merged commit ddc6997 into mrdoob:dev Sep 20, 2021
@mrdoob
Copy link
Owner

mrdoob commented Sep 20, 2021

Thanks!

@sunag sunag deleted the dev-nodes-lib branch September 28, 2021 09:06
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