KhronosGroup / KhronosGroup/glTF

Need a way in the Object Model to read enum values

Open
#2,492 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
HTML
Stars
7.8k
Forks
1.2k
Avg merge
17h 26m
Merged PRs (30d)
5

Description

The Object Model provides access to some objects whose specific properties are determined by an enum value. KHR_lights_punctual light objects are a good example of this. The `spot/innerConeAngle` and `spot/outerConeAngle` properties are only available if the `type` is `spot`. For KHR_interactivity, we are missing a way to have logic that is conditional on these kinds of enum values because there are no rules in the object model for how to read the enum values.

I suggest one of two options:

1. Add the ability to read string data types to the object model and expose the enum values as read-only strings.
2. Expose the enums as integer values and provide a mapping from string to integer values in the object model.

Contributor guide

Open the contributing guide

Research direction

Start with the Object Model rules and the KHR_lights_punctual and KHR_interactivity cases described in the issue. Compare the proposed string and integer enum-access approaches, then define the required object-model behavior and a way to verify conditional access to enum-dependent properties.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.