Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

Debug best practices

Bug investigation best practices
Read time 2 minutesLast updated 21 hours ago

When working with Pixyz SDK, encountering bugs or crashes can be inevitable due to the complexity of 3D data processing. This document aims to provide best practices for effectively investigating and resolving these issues. Following these guidelines will help streamline the debugging process and improve communication with the Pixyz support team when necessary.

1. Common debugging techniques

  • Validate inputs: ensure that the inputs to the functions are valid and in the expected format. Invalid inputs can often lead to unexpected behavior and crashes.
  • Simplify the case: try to reduce the problem to a simpler case that still reproduces the issue. This can help in identifying whether the problem is with the specific data or a more general issue in the function.
  • Update and patch: ensure that you are using the latest version of Pixyz SDK. Check for any available patches or updates that might address the issue you are encountering.

2. General investigation steps

2.1. Reproduce the issue

To effectively troubleshoot a bug, it is crucial to reliably reproduce the issue. Follow these steps:
  • Document context: note the steps and the specific context in which the bug occurs, including the script or API calls leading up to the issue.
  • Isolate the function: try to isolate the specific function or API call causing the problem.
  • System information: record the version of the Pixyz SDK you are using, as well as relevant hardware and system information.

2.2. Use Logging and Debugging tools

Use logging to gather more information about the bug:
  • Enable SDK logging (on by default): turn on detailed logging in the Pixyz SDK to capture more granular information about the operations being performed.
  • Debug output: print variable states and intermediate results to understand the program flow and identify where things go wrong.

3. Handle crashes in your workflow

3.1. Save a .pxz file before a crash

If your workflow experiences a crash, one of the first steps you should take is to save the state of your project just before the crash occurs. This can be done using the core.save function. Steps:
  • Identify the point in your workflow where the crash occurs (see previous section).
  • Insert a core.save command immediately before this point to capture the state of the project into a .pxz file.

3.2. Inspect the saved .pxz File

After saving the .pxz file, open and inspect the file in a Pixyz viewer:
  • Open the .pxz file: load the saved file in a Pixyz viewer to visually inspect the state of the 3D model and data. Look for any anomalies or unusual data.
  • Run subsequent functions: try to execute the next function in your workflow on this .pxz file to see if the issue is reproducible.

3.3. Contact Pixyz Support

If the issue is consistently reproducible and you have isolated the problem with a .pxz file:
  • Share the .pxz file: contact Pixyz support and share the .pxz file along with a detailed description of the issue and the steps to reproduce it.
  • Provide necessary context: include relevant system information, code snippets, and logs that can help the support team understand and diagnose the problem.