diff --git a/__init__.py b/__init__.py index 7cb5cb0..8811a85 100644 --- a/__init__.py +++ b/__init__.py @@ -1,14 +1,14 @@ bl_info = { "name": "Aperture JSON tracking import", "author": "Christian F. (known as Chryfi)", - "version": (1, 2), + "version": (1, 3), "blender": (2, 80, 0), "location": "File > Import", "description": "Import tracking data from a json file generated by the Aperture Mod.", "warning": "", "category": "Import" } -version_no = 120 +version_no = 130 import bpy import json @@ -174,15 +174,19 @@ def execute(self, context): if frame == 0: startFrame = int(int(frameData["frame"]) // ignoreFrame) + keyframePos = blenderFrame+frameOffset+startFrame + #obj.delta_rotation_euler = Euler((math.radians(90), 0, 0), 'ZXY') #obj.rotation_euler = Euler((math.radians(frameData["rotation"][1]), math.radians(frameData["rotation"][0] - 90), math.radians(90 - frameData["rotation"][2])), 'ZXY') obj.rotation_mode = 'ZYX' obj.rotation_euler = (math.radians(frameData["rotation"][0]+90), math.radians(frameData["rotation"][1]), math.radians(frameData["rotation"][2])) obj.location = (frameData["position"][0], -frameData["position"][2], frameData["position"][1]) + obj.scale = (frameData["scale"][0], frameData["scale"][1], frameData["scale"][2]) - obj.keyframe_insert(data_path="rotation_euler", frame=blenderFrame+frameOffset+startFrame) - obj.keyframe_insert(data_path="location", frame=blenderFrame+frameOffset+startFrame) + obj.keyframe_insert(data_path="rotation_euler", frame=keyframePos) + obj.keyframe_insert(data_path="location", frame=keyframePos) + obj.keyframe_insert(data_path="scale", frame=keyframePos) except: traceback.print_exc()