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

OscNode: Fix if timeNode is not a nodeObject() #25588

Merged
merged 1 commit into from
Mar 1, 2023
Merged
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/utils/OscNode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Node, { addNodeClass } from '../core/Node.js';
import { timerLocal } from './TimerNode.js';
import { nodeProxy } from '../shadernode/ShaderNode.js';
import { nodeObject, nodeProxy } from '../shadernode/ShaderNode.js';

class OscNode extends Node {

Expand All @@ -22,7 +22,7 @@ class OscNode extends Node {
construct() {

const method = this.method;
const timeNode = this.timeNode;
const timeNode = nodeObject( this.timeNode );
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should assume that an user always passes a node object?

Copy link
Collaborator Author

@sunag sunag Mar 1, 2023

Choose a reason for hiding this comment

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

I think better added it in construct() as default in case of user added a class based node like (non-nodeObject()):

new OscNode( OscNode.SINE, new CustomNode() );

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can instruct the user to always pass node objects? E.g. like oscSine( nodeObject( new CustomNode() ) )?

Copy link
Collaborator Author

@sunag sunag Mar 1, 2023

Choose a reason for hiding this comment

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

Maybe we can instruct the user to always pass node objects? E.g. like oscSine( nodeObject( new CustomNode() ) )?

I think the best way would still be to standardize possible non-nodeObjects in construct() to facilitate implementation.

Anyway no object would be converted twice once we have a WeakMap.


let outputNode = null;

Expand Down