Commit 7f733fc4 authored by JriusUru's avatar JriusUru

Import compound controller light animations. Fix looping compound

controller animations.
parent 0e28ecd8
......@@ -91,6 +91,7 @@ class AnimImporter:
y = controller.Y
z = controller.Z
frameMultiplier = bpy.context.scene.render.fps / bpy.context.scene.render.fps_base / 30
allCurves = []
for i, axisController in enumerate([x,y,z]):
if not axisController:
continue
......@@ -106,8 +107,9 @@ class AnimImporter:
# else handles are already positioned correctly
self.parent.endFrame = max(self.parent.endFrame, frame)
allCurves.append(blFCurve)
return blFCurve
return allCurves
def importQuatController(self, controller, blAction, curveName):
# Just a SimpleController with an extra channel... Unfortunately this will NOT allow us to correctly playback the animation.
......@@ -225,7 +227,7 @@ class AnimImporter:
elif isinstance(pos, (pl.plSimplePosController, pl.plLeafController)):
importedFCurves.extend(self.importSimpleController(pos, blAction, "location"))
elif isinstance(pos, (pl.plCompoundPosController, pl.plCompoundController)):
importedFCurves.append(self.importCompoundController(pos, blAction, "location"))
importedFCurves.extend(self.importCompoundController(pos, blAction, "location"))
else:
print("WARNING: animation pos controller %s not supported !" % pos.__class__.__name__)
if rot:
......@@ -239,7 +241,7 @@ class AnimImporter:
importedFCurves.extend(self.importQuatController(rot, blAction, "rotation_quaternion"))
blObj.rotation_mode = "QUATERNION"
elif isinstance(rot, (pl.plCompoundRotController, pl.plCompoundController)):
importedFCurves.append(self.importCompoundController(rot, blAction, "rotation_euler"))
importedFCurves.extend(self.importCompoundController(rot, blAction, "rotation_euler"))
else:
print("WARNING: animation rot controller %s not supported !" % rot.__class__.__name__)
if sca:
......@@ -263,8 +265,10 @@ class AnimImporter:
importedFCurves.extend(self.importSimpleController(controller.position, blAction, "color"))
elif isinstance(controller, pl.plLeafController):
importedFCurves.extend(self.importSimpleController(controller, blAction, "color"))
elif isinstance(controller, (pl.plCompoundPosController, pl.plCompoundController)):
importedFCurves.extend(self.importCompoundController(controller, blAction, "color"))
else:
print("WARNING: animation controller %s not supported !" % controller.__class__.__name__)
print("WARNING: light animation controller %s not supported !" % controller.__class__.__name__)
continue
self.setupKormanModifier(blObj, isAtc, isGlobalAnim, anim, importedFCurves)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment