def evaluate(self):
armature = self.get_parameter_value(self.armature)
bone_name = self.get_parameter_value(self.bone_name)
if armature is LogicNetworkCell.STATUS_WAITING: return
if bone_name is LogicNetworkCell.STATUS_WAITING: return
self._set_ready()
if none_or_invalid(armature): return
if not bone_name: return
channel = None
if (armature is self._prev_armature) and (bone_name == self._prev_bone):
channel = self._channel
else:
self._prev_armature = armature
self._prev_bone = bone_name
self._channel = armature.channels[bone_name]
channel = self._channel
if channel.rotation_mode is bge.logic.ROT_MODE_QUAT:
self._rot[:] = mathutils.Quaternion(channel.rotation_quaternion).to_euler()
else:
self._rot[:] = channel.rotation_euler
self._pos[:] = channel.location
self._sca[:] = channel.scale
评论列表
文章目录