Skip to content

Commit

Permalink
improved error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dooly123 committed Jan 5, 2025
1 parent c001aae commit 3e8a549
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,9 @@ public void LateUpdate()
// Complete tasks and apply results
for (int Index = 0; Index < ReceiverCount; Index++)
{
try
{
if (ReceiverArray[Index] != null)
{
ReceiverArray[Index].Apply(TimeAsDouble, deltaTime);
}
}
catch (Exception ex)
if (ReceiverArray[Index] != null)
{
// Log the error and continue with the next iteration
//muting the error for now
//BasisDebug.LogError($"Error in Apply at index {Index}: {ex.Message} {ex.StackTrace}");
ReceiverArray[Index].Apply(TimeAsDouble, deltaTime);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,46 @@ public void Apply(double TimeAsDouble, float DeltaTime)
{
if (PoseHandler != null)
{
if (HasAvatarInitalized)
try
{
OutputRotation = math.slerp(First.rotation, Last.rotation, interpolationTime);
// Complete the jobs and apply the results
musclesHandle.Complete();
if (HasAvatarInitalized)
{
OutputRotation = math.slerp(First.rotation, Last.rotation, interpolationTime);
// Complete the jobs and apply the results
musclesHandle.Complete();

ApplyPoseData(NetworkedPlayer.Player.BasisAvatar.Animator, OuputVectors[1], OuputVectors[0], OutputRotation, muscles);
PoseHandler.SetHumanPose(ref HumanPose);

ApplyPoseData(NetworkedPlayer.Player.BasisAvatar.Animator, OuputVectors[1], OuputVectors[0], OutputRotation, muscles);
PoseHandler.SetHumanPose(ref HumanPose);
RemotePlayer.RemoteBoneDriver.SimulateAndApply(TimeAsDouble, DeltaTime);

RemotePlayer.RemoteBoneDriver.SimulateAndApply(TimeAsDouble, DeltaTime);
//come back to this later! RemotePlayer.Avatar.FaceVisemeMesh.transform.position = RemotePlayer.MouthControl.OutgoingWorldData.position;
}
if (interpolationTime >= 1 && PayloadQueue.TryDequeue(out AvatarBuffer result))
{
First = Last;
Last = result;

//come back to this later! RemotePlayer.Avatar.FaceVisemeMesh.transform.position = RemotePlayer.MouthControl.OutgoingWorldData.position;
TimeBeforeCompletion = Last.SecondsInterval;
TimeInThePast = TimeAsDouble;
}
}
if (interpolationTime >= 1 && PayloadQueue.TryDequeue(out AvatarBuffer result))
catch (Exception ex)
{
First = Last;
Last = result;

TimeBeforeCompletion = Last.SecondsInterval;
TimeInThePast = TimeAsDouble;
if (LogFirstError == false)
{
// Log the error and continue with the next iteration
//muting the error for now
BasisDebug.LogError($"Error in Apply : {ex.Message} {ex.StackTrace}");
}
else
{
LogFirstError = true;
}
}
}
}
public bool LogFirstError = false;
public void EnQueueAvatarBuffer(ref AvatarBuffer avatarBuffer)
{
if(avatarBuffer == null)
Expand Down

0 comments on commit 3e8a549

Please sign in to comment.