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

Fix addLightNode in case of anonymizing classes #26858

Merged
merged 9 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/jsm/nodes/lighting/AmbientLightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class AmbientLightNode extends AnalyticLightNode {

export default AmbientLightNode;

addLightNode( AmbientLight, AmbientLightNode );

addNodeClass( 'AmbientLightNode', AmbientLightNode );

addLightNode( AmbientLight, AmbientLightNode );
4 changes: 2 additions & 2 deletions examples/jsm/nodes/lighting/DirectionalLightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ class DirectionalLightNode extends AnalyticLightNode {

export default DirectionalLightNode;

addLightNode( DirectionalLight, DirectionalLightNode );

addNodeClass( 'DirectionalLightNode', DirectionalLightNode );

addLightNode( DirectionalLight, DirectionalLightNode );
4 changes: 2 additions & 2 deletions examples/jsm/nodes/lighting/HemisphereLightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ class HemisphereLightNode extends AnalyticLightNode {

export default HemisphereLightNode;

addLightNode( HemisphereLight, HemisphereLightNode );

addNodeClass( 'HemisphereLightNode', HemisphereLightNode );

addLightNode( HemisphereLight, HemisphereLightNode );
4 changes: 2 additions & 2 deletions examples/jsm/nodes/lighting/IESSpotLightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ class IESSpotLightNode extends SpotLightNode {

export default IESSpotLightNode;

addLightNode( IESSpotLight, IESSpotLightNode );

addNodeClass( 'IESSpotLightNode', IESSpotLightNode );

addLightNode( IESSpotLight, IESSpotLightNode );
6 changes: 3 additions & 3 deletions examples/jsm/nodes/lighting/LightsNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ export const lightsWithoutWrap = nodeProxy( LightsNode );

export function addLightNode( lightClass, lightNodeClass ) {

if ( LightNodes.has( lightClass ) ) throw new Error( `Redefinition of light node ${ lightNodeClass.name }` );
if ( typeof lightClass !== 'function' || ! lightClass.name ) throw new Error( `Light ${ lightClass.name } is not a class` );
if ( typeof lightNodeClass !== 'function' || ! lightNodeClass.name ) throw new Error( `Light node ${ lightNodeClass.name } is not a class` );
if ( LightNodes.has( lightClass ) ) throw new Error( `Redefinition of light node ${ lightNodeClass.type }` );
if ( typeof lightClass !== 'function' ) throw new Error( `Light ${ lightClass.name } is not a class` );
if ( typeof lightNodeClass !== 'function' || ! lightNodeClass.type ) throw new Error( `Light node ${ lightNodeClass.type } is not a class` );

LightNodes.set( lightClass, lightNodeClass );

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/nodes/lighting/PointLightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ class PointLightNode extends AnalyticLightNode {

export default PointLightNode;

addLightNode( PointLight, PointLightNode );

addNodeClass( 'PointLightNode', PointLightNode );

addLightNode( PointLight, PointLightNode );
4 changes: 2 additions & 2 deletions examples/jsm/nodes/lighting/SpotLightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ class SpotLightNode extends AnalyticLightNode {

export default SpotLightNode;

addLightNode( SpotLight, SpotLightNode );

addNodeClass( 'SpotLightNode', SpotLightNode );

addLightNode( SpotLight, SpotLightNode );