-
Notifications
You must be signed in to change notification settings - Fork 317
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
This PR adds the option to run the produced gltf export through gltfpack with various options #1945
Conversation
Added basic gltfpack options (not hooked up to anything yet)
Added the rest of the currently supported options to the gltfpack command <3
…he file xx_gltfpacked gltfpacked folder is created if not exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, Thanks for this PR
First of all, I need to check the Blender policy about calling some external tools.
(And you should rebase with main branch, as I fixed some bugs after recent changes in Blender) |
Thank you for taking a look :) |
Hello, |
export_gltfpack_vpi: EnumProperty( | ||
name='Vertex Position Attributes', | ||
description='Type to use for vertex position attributes', | ||
items=(('Integer', 'Integer', 'Use integer attributes for positions'), | ||
('Normalized', 'Normalized', 'Use normalized attributes for positions'), | ||
('Floating-point', 'Floating-point', 'Use floating-point attributes for positions')), | ||
default='Integer', | ||
) | ||
|
||
export_gltfpack_noq: BoolProperty( | ||
name='Disable Quantization', | ||
description='Disable quantization; produces much larger glTF files with no extensions', | ||
default=True, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these two defaults are in conflict. If quantization is disabled, integer vertex position attributes won't work. I think the uses of the "Vertex Position Attributes" flag in gltfpack are very limited — perhaps it would be best to remove that option from the UI, and just show an option for quantization enabled by default?
Thanks @donmccurdy to point it |
Hi there,
Juan and I thought of extending this plugin with the option to run the exported glTF through the tool gltfpack (aka meshoptimizer). The main motivation is to get ktx2 support.
By default gltfpack outputs regular .glb/.gltf files that have been optimized for GPU consumption using various cache optimizers and quantization and can also compress textures using Basis Universal format stored in a KTX2 container.
gltfpack
will output to a subfoldergltfpacked
in the folder you exported the glTF to.For the plugin to be able to run the originally exported glTF, you need to have
gltfpack
installed on your system somewhere and configure its path in the plugin preferences, thengltfpack
relevant options will also appear in the export dialog, where you can also decide if you want to make use ofgltfpack
or not, among the options you can pass through that tool.Extension in action:
Its preferences too:
Any feedback is welcome