question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom extensions?

See original GitHub issue

Hi, this is a wonderful project, thank you!

Is there any way I can add my own glTF extensions from a client app, without modifying the library itself?

For example if I wanted a particular node to have an extension AGI_testing with a value "itWorks" : true in my exported glTF, can I do that without modifying SharpGLTF? Or what’s the smallest mod I would need to make?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
vpenadescommented, Mar 30, 2021

It’s something I have planned, but I’ve never tested it. Mostly because extensions usually imply changing things in the code… and data only extensions can easily be simulated with the extras.

Nevertherless, the way to make the library aware of an extension is by registering it here.

Notice the ExtensionsFactory class is still internal, so you’ll have to call it by reflection, or fork the library and make it public.

The extension classes are usually generated from the schemas using the builder tool in the project, but it’s also possible to write a class by hand.

About the class itself, I would suggest you to look into the KHR_materials_unlit class, which is the closest thing you can look for.

You have to remember to inherit from ExtraProperties class, add the appropiate contructor (even if it’s empty, it’s called by the deserializer), and add the appropiate read/write serialization methods.

Assuming you’ve been able to do all that, you can just call UseExtension<AGI_Testing_Extension>() on the object you want it to use the given extension.

0reactions
emackeycommented, Apr 1, 2021

This is excellent advice, thank you.

I’ve confirmed that the recent commit to master (along with the internal constructor) fixes the original issue here, so I’ll close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Chrome - Extension Manager
A beautiful Google Chrome extension manager to turn on/off other extensions quickly and easily without leaving your current tab.
Read more >
Create and publish custom Chrome apps & extensions
Create and publish custom Chrome apps & extensions · Step 1: Build the app or extension · Step 2: Test the app or...
Read more >
Custom Hair Extensions
Our custom hair extensions match your exact specifications. Get the perfect length, color & texture you want! Simply fill out the form below...
Read more >
The 7 Best Extensions You Can Use to Personalize Chrome
1. Momentum ... Momentum is one of the most versatile Chrome extensions and a true customization powerhouse. It offers a long list of ......
Read more >
How to Create Your Own Google Chrome Extension
If you are a Google Chrome user, you've probably used some extensions in the browser. Have you ever wondered how to build one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found