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

support referenced content extension #913

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

andrewheumann
Copy link
Member

@andrewheumann andrewheumann commented Nov 1, 2022

BACKGROUND:

  • In order to support faster function execution, we want to explore skipping GLB merge, and passing GLB urls directly to a client. To do this, we want to support an experimental custom GLTF extension which lets you mark an object as containing content from a referenced URL.

DESCRIPTION:

  • Adds support for the experimental referenced content extension. It will not be used unless Elements.Serialization.glTF.GltfExtensions.UseReferencedContentExtension = true; is on.

TESTING:

  • I created several functions using this extension and tried them with a custom branch of the hypar front-end that knew how to read the extension.

This change is Reviewable

@andrewheumann andrewheumann marked this pull request as ready for review January 12, 2023 18:25
Copy link
Member

@wynged wynged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks pretty good, I want to talk about how this could make an easy hop to supporting a glbRepresentation type, see if that desirable, and maybe change some language to support that.

Reviewed all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @andrewheumann)


Elements/src/Serialization/glTF/GltfExtensions.cs line 1223 at r1 (raw file):

                            var nodeId = NodeUtilities.CreateNodeForMesh(meshId, nodes, content.Id, transform);

                            if (contentElement != null && UseReferencedContentExtension)

contentElement != null should already be true at this point.


Elements/src/Serialization/glTF/GltfExtensions.cs line 1283 at r1 (raw file):

                    {
                        AddExtension(gltf, nodes[nodeId], "HYPAR_referenced_content", new Dictionary<string, object> {
                            {"contentUrl", contentElement.GltfLocation}

I think we should change the language here away from contentURL towards glbURL.

Copy link
Member Author

@andrewheumann andrewheumann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @wynged)


Elements/src/Serialization/glTF/GltfExtensions.cs line 1223 at r1 (raw file):

Previously, wynged (Eric Wassail) wrote…

contentElement != null should already be true at this point.

Done.


Elements/src/Serialization/glTF/GltfExtensions.cs line 1283 at r1 (raw file):

Previously, wynged (Eric Wassail) wrote…

I think we should change the language here away from contentURL towards glbURL.

I'm not sure I agree. One reason I don't want to do this is that the format for the referenced content may not always be a GLB. Because we're no longer doing any merging in the function, we can now easily do referenced content of any type threeJS can display: Rhino files, point clouds, objs, etc.

Copy link
Member

@wynged wynged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @andrewheumann)


Elements/src/Serialization/glTF/GltfExtensions.cs line 1223 at r1 (raw file):

Previously, andrewheumann wrote…

Done.

I don't see it.


Elements/src/Serialization/glTF/GltfExtensions.cs line 1283 at r1 (raw file):

Previously, andrewheumann wrote…

I'm not sure I agree. One reason I don't want to do this is that the format for the referenced content may not always be a GLB. Because we're no longer doing any merging in the function, we can now easily do referenced content of any type threeJS can display: Rhino files, point clouds, objs, etc.

yup, I buy that. ContentElements are dead long live Content!

Copy link
Member Author

@andrewheumann andrewheumann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @wynged)


Elements/src/Serialization/glTF/GltfExtensions.cs line 1223 at r1 (raw file):

Previously, wynged (Eric Wassail) wrote…

I don't see it.

forgot to push oops!

Code quote:

 if (contentElement != null && UseReferencedContentExtension)

Copy link
Member

@wynged wynged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained

Copy link
Member

@wynged wynged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@andrewheumann andrewheumann merged commit 5dd4c88 into master Jan 13, 2023
@andrewheumann andrewheumann deleted the referenced-content-extension branch January 13, 2023 16:51
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

Successfully merging this pull request may close these issues.

None yet

2 participants