Pārlūkot izejas kodu

fix readonly TimerNode

sunag 7 gadi atpakaļ
vecāks
revīzija
18b7bcc371

+ 7 - 1
examples/js/nodes/InputNode.js

@@ -16,6 +16,12 @@ THREE.InputNode = function ( type, params ) {
 THREE.InputNode.prototype = Object.create( THREE.TempNode.prototype );
 THREE.InputNode.prototype.constructor = THREE.InputNode;
 
+THREE.InputNode.prototype.isReadonly = function ( builder ) {
+
+	return this.readonly;
+
+};
+
 THREE.InputNode.prototype.generate = function ( builder, output, uuid, type, ns, needsUpdate ) {
 
 	var material = builder.material;
@@ -24,7 +30,7 @@ THREE.InputNode.prototype.generate = function ( builder, output, uuid, type, ns,
 	type = type || this.getType( builder );
 
 	var data = material.getDataNode( uuid ),
-		readonly = this.readonly && this.generateReadonly !== undefined;
+		readonly = this.isReadonly( builder ) && this.generateReadonly !== undefined;
 
 	if ( readonly ) {
 

+ 6 - 0
examples/js/nodes/utils/TimerNode.js

@@ -21,6 +21,12 @@ THREE.TimerNode.prototype = Object.create( THREE.FloatNode.prototype );
 THREE.TimerNode.prototype.constructor = THREE.TimerNode;
 THREE.TimerNode.prototype.nodeType = "Timer";
 
+THREE.TimerNode.prototype.isReadonly = function ( builder ) {
+
+	return false;
+
+};
+
 THREE.TimerNode.prototype.isUnique = function ( builder ) {
 
 	// share TimerNode "uniform" input if is used on more time with others TimerNode