Skip to content

Commit

Permalink
Not counting frames when not recording
Browse files Browse the repository at this point in the history
  • Loading branch information
moraell committed Jan 30, 2019
1 parent 216c209 commit 8c33a60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/2.80/kinect_mocap.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ def updatePose(context, bone):
# calculate desired rotation
rot = Vector((0,1,0)).rotation_difference(boneV)
bone.rotation_quaternion = bone.rotation_quaternion @ rot
if context.scene.kmc_props.currentFrame == 0:
# first captured frame, initiate recording by setting the current frame to 1
context.scene.kmc_props.currentFrame += 1
if context.scene.kmc_props.record :
if context.scene.kmc_props.currentFrame == 0:
# first captured frame, initiate recording by setting the current frame to 1
context.scene.kmc_props.currentFrame += 1

bone.keyframe_insert(data_path="rotation_quaternion", frame=context.scene.kmc_props.currentFrame)

# update child bones
Expand Down Expand Up @@ -304,6 +305,7 @@ def captureFrame(context):
if(context.scene.k_sensor.update() == 1):
# update pose
updatePose(context, bpy.data.objects[context.scene.kmc_props.arma_list].pose.bones[0])
#context.scene.update()

if context.scene.kmc_props.currentFrame > 0 :
context.scene.kmc_props.currentFrame += 1
Expand Down

0 comments on commit 8c33a60

Please sign in to comment.