Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug: continue processing model if skeleton check fails #177

Conversation

tellypresence
Copy link

There's a problem in src/tydra/render-data.cc around line 3704. If the skeleton check fails, the model processing is aborted at that point, instead of continuing with other crucial model processing steps...

  if (skelPath.is_valid()) {
    SkelHierarchy skel;
    nonstd::optional<Animation> anim;
    if (!ConvertSkeletonImpl(env, mesh, &skel, &anim)) {
      return false; // << Early abort doesn't continue processing model
    }
    // Process skeleton
  }
  // Additional model processing from here never happens if skeleton check fails
  //
  // 6. BlendShapes
  //
...
  //
  // 7. Compute normals
  //
...
  //
  // 8. Build indices
  //

If the logic is inverted and early (aborting) return removed, the model processing is allowed to continue even if the skeleton check fails

  if (skelPath.is_valid()) {
    SkelHierarchy skel;
    nonstd::optional<Animation> anim;
    if (ConvertSkeletonImpl(env, mesh, &skel, &anim)) {
      // Process skeleton
    }
  ...
  }
  // Additional model processing happens here regardless of status of skeleton check
  //
  // 6. BlendShapes
  //
...
  //
  // 7. Compute normals
  //
...
  //
  // 8. Build indices
  //

Additional details in #176

@syoyo
Copy link
Collaborator

syoyo commented Jul 15, 2024

If Skeleton exits, but failed to parse Skeleton, it should report error at the moment.

Also you should test a scene with minimal&reproducible manner and using TinyUSDZ tool solely, not with assimp.

@syoyo syoyo closed this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants