添加关照、全局等高线、修改图层问题
This commit is contained in:
29
static/sdk/three/jsm/nodes/accessors/UserDataNode.js
Normal file
29
static/sdk/three/jsm/nodes/accessors/UserDataNode.js
Normal file
@ -0,0 +1,29 @@
|
||||
import ReferenceNode from './ReferenceNode.js';
|
||||
import { addNodeClass } from '../core/Node.js';
|
||||
import { nodeObject } from '../shadernode/ShaderNode.js';
|
||||
|
||||
class UserDataNode extends ReferenceNode {
|
||||
|
||||
constructor( property, inputType, userData = null ) {
|
||||
|
||||
super( property, inputType, userData );
|
||||
|
||||
this.userData = userData;
|
||||
|
||||
}
|
||||
|
||||
update( frame ) {
|
||||
|
||||
this.reference = this.userData !== null ? this.userData : frame.object.userData;
|
||||
|
||||
super.update( frame );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default UserDataNode;
|
||||
|
||||
export const userData = ( name, inputType, userData ) => nodeObject( new UserDataNode( name, inputType, userData ) );
|
||||
|
||||
addNodeClass( 'UserDataNode', UserDataNode );
|
Reference in New Issue
Block a user