Merge pull request #2010 from E1e5en/fix-vector-quat-math
Fixed logical nodes Vector Math and Quaternion Math
This commit is contained in:
commit
64ddadab7b
|
@ -13,7 +13,7 @@ class QuaternionMathNode(ArmLogicTreeNode):
|
|||
def set_bool(self, value):
|
||||
self['property1'] = value
|
||||
if value:
|
||||
if (self.property0 == 'Module') or (self.property0 == 'DotProduct') or (self.property0 == 'ToAxisAngle'):
|
||||
if ((self.property0 == 'Module') or (self.property0 == 'DotProduct') or (self.property0 == 'ToAxisAngle')) and (len(self.outputs) > 1):
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Module/DotProduct/ToAxisAngle
|
||||
self.add_output('NodeSocketFloat', 'X') # Result X
|
||||
self.add_output('NodeSocketFloat', 'Y') # Result Y
|
||||
|
@ -26,12 +26,14 @@ class QuaternionMathNode(ArmLogicTreeNode):
|
|||
if (self.property0 == 'ToAxisAngle'):
|
||||
self.add_output('NodeSocketFloat', 'To Axis Angle') # ToAxisAngle
|
||||
else:
|
||||
if (self.property0 == 'Module') or (self.property0 == 'DotProduct') or (self.property0 == 'ToAxisAngle'):
|
||||
if ((self.property0 == 'Module') or (self.property0 == 'DotProduct') or (self.property0 == 'ToAxisAngle')) and (len(self.outputs) > 1):
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Module/DotProduct/ToAxisAngle
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Result X
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Result Y
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Result Z
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Result W
|
||||
# Remove X, Y, Z, W
|
||||
for i in range(4):
|
||||
if len(self.outputs) > 1:
|
||||
self.outputs.remove(self.outputs.values()[-1])
|
||||
else:
|
||||
break
|
||||
if (self.property0 == 'Module'):
|
||||
self.add_output('NodeSocketFloat', 'Module') # Module
|
||||
if (self.property0 == 'DotProduct'):
|
||||
|
|
|
@ -27,11 +27,14 @@ class VectorMathNode(ArmLogicTreeNode):
|
|||
if (self.property0 == 'Dot Product'):
|
||||
self.add_output('NodeSocketFloat', 'Scalar') # Scalar
|
||||
else:
|
||||
if (self.property0 == 'Length') or (self.property0 == 'Distance') or (self.property0 == 'Dot Product'):
|
||||
if ((self.property0 == 'Length') or (self.property0 == 'Distance') or (self.property0 == 'Dot Product')) and (len(self.outputs) > 1):
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Distance/Length/Scalar
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Result X
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Result Y
|
||||
self.outputs.remove(self.outputs.values()[-1]) # Result Z
|
||||
# Remove X, Y, Z
|
||||
for i in range(3):
|
||||
if len(self.outputs) > 1:
|
||||
self.outputs.remove(self.outputs.values()[-1])
|
||||
else:
|
||||
break
|
||||
if (self.property0 == 'Length'):
|
||||
self.add_output('NodeSocketFloat', 'Length') # Length
|
||||
if (self.property0 == 'Distance'):
|
||||
|
|
Loading…
Reference in a new issue