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

KHR_node_visibility Draft Proposal #2410

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions extensions/2.0/Khronos/KHR_node_visibility/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# KHR\_node\_visibility

## Contributors

- Dwight Rodgers, Adobe
- Peter Martin, Adobe
- Emmett Lalish, Google
- Alexey Knyazev, Independent

## Status

Draft

## Dependencies

Written against the glTF 2.0 spec.

## Overview

This extension allows glTF animations and interactivity to control visibility of node hierarchies. It is intended for use in conjunction with `KHR_animation_pointer` and/or `KHR_interactivity` extensions.

## Extending Nodes

The `KHR_node_visibility` extension object is added to the objects within the `nodes` array. The extension object contains a single boolean `visible` property. This value is mutable through JSON pointers as defined in the glTF 2.0 Asset Object Model and controls visibility of the node that contains it and all its children nodes recursively. A value of `false` causes all nodes below in the hierarchy to be omitted from display, even any nodes below that have a value of `true`.

| Property | Type | Description | Required |
|-------------|-----------|----------------------------------------|---------------------|
| **visible** | `boolean` | Specifies whether the node is visible. | No, default: `true` |

In other words, a node is visible if and only if its own `visible` property is `true` and all its parents are visible. This allows a single change of a `visible` property at a high level of the hierarchy to hide or show complex (multi-node) objects.
lexaknyazev marked this conversation as resolved.
Show resolved Hide resolved

In the following example, both nodes (and therefore their meshes) are initially hidden.

```json
{
"nodes": [
{
"children": [1],
"mesh": 0,
"extensions": {
"KHR_node_visibility": {
"visible": false
}
},
},
{
"mesh": 1
}
]
}
```

## Extending glTF 2.0 Asset Object Model

The following pointer template represents the mutable property defined by this extension.

| Pointer | Type |
|----------------------------------------------------|--------|
| `/nodes/{}/extensions/KHR_node_visibility/visible` | `bool` |

## JSON Schema

- [node.KHR_node_visibility.schema.json](schema/node.KHR_node_visibility.schema.json)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "KHR_node_visibility glTF Node Extension",
"type": "object",
"description": "glTF extension that defines node's visibility.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"visible": {
"type": "boolean",
"description": "Specifies whether the node is visible.",
"default": true,
"gltf_detailedDescription": "Specifies whether the node is visible. A value of false means that the node and all its children are hidden."
lexaknyazev marked this conversation as resolved.
Show resolved Hide resolved
},
"extensions": { },
"extras": { }
}
}
Loading