mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-26 17:54:14 +00:00
widgets can now be serialized if you set node.serialize_widgets = true
This commit is contained in:
@@ -312,7 +312,7 @@ if(global.glMatrix)
|
||||
function Math3DQuaternion()
|
||||
{
|
||||
this.addOutput("quat","quat");
|
||||
this.properties = { x:0, y:0, z:0, w: 1 };
|
||||
this.properties = { x:0, y:0, z:0, w: 1, normalize: false };
|
||||
this._value = quat.create();
|
||||
}
|
||||
|
||||
@@ -321,13 +321,19 @@ if(global.glMatrix)
|
||||
|
||||
Math3DQuaternion.prototype.onExecute = function()
|
||||
{
|
||||
this._value[0] = this.properties.x;
|
||||
this._value[1] = this.properties.y;
|
||||
this._value[2] = this.properties.z;
|
||||
this._value[3] = this.properties.w;
|
||||
this._value[0] = this.getInputOrProperty("x");
|
||||
this._value[1] = this.getInputOrProperty("y");
|
||||
this._value[2] = this.getInputOrProperty("z");
|
||||
this._value[3] = this.getInputOrProperty("w");
|
||||
if( this.properties.normalize )
|
||||
quat.normalize( this._value, this._value );
|
||||
this.setOutputData( 0, this._value );
|
||||
}
|
||||
|
||||
Math3DQuaternion.prototype.onGetInputs = function(){
|
||||
return [["x","number"],["y","number"],["z","number"],["w","number"]];
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("math3d/quaternion", Math3DQuaternion );
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user