Custom extensions?
See original GitHub issueHi, 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:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.