def run(self):
reset = self.getInputValue("Reset")
if reset:
self.lastValue = Quaternion((1.0, 0.0, 0.0, 0.0))
self.outputs["Quaternion"].default_value = Quaternion((1.0, 0.0, 0.0, 0.0))
accumulate = self.getInputValue("Accumulate")
if accumulate and not self.accumulate:
self.lastValue = self.getInputValue("Quaternion").inverted()
self.outputs["Accumulating"].default_value = True
self.accumulate = True
elif not accumulate and self.accumulate:
self.outputs["Accumulating"].default_value = False
self.accumulate = False
elif accumulate:
value = self.getInputValue("Quaternion") # No need to copy we're not using directly
self.outputs["Quaternion"].default_value *= self.lastValue * value
self.lastValue = value.inverted()
QuaternionDeltaAccumulatorNode.py 文件源码
python
阅读 15
收藏 0
点赞 0
评论 0
评论列表
文章目录