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

No default initialization of light and emitter in tinygltf::Node #431

Closed
dyollb opened this issue Jun 19, 2023 · 1 comment
Closed

No default initialization of light and emitter in tinygltf::Node #431

dyollb opened this issue Jun 19, 2023 · 1 comment

Comments

@dyollb
Copy link

dyollb commented Jun 19, 2023

Describe the issue

No default initialization of light and emitter in tinygltf::Node.
This causes crash in json serialization

To Reproduce

Expected behaviour

Code should initialize parameters not marked as required (or all) with something meaningful that can be tested against, e.g. -1.

Fix:

namespace tinygltf {
class Node {
 public:
  Node() = default;

  DEFAULT_METHODS(Node)

  bool operator==(const Node &) const;

  int camera = -1;  // the index of the camera referenced by this node

  std::string name;
  int skin = -1;
  int mesh = -1;
  int light = -1;  // light source index (KHR_lights_punctual)
  int emitter = -1; // audio emitter index (KHR_audio)

Screenshots

na

Additional context
na

@syoyo syoyo closed this as completed in 7a570c8 Jun 19, 2023
@syoyo
Copy link
Owner

syoyo commented Jun 19, 2023

Good catch! Thanks! Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants