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

Add exporting glTF2 #34193

Merged
merged 1 commit into from
Dec 23, 2020
Merged

Conversation

fire
Copy link
Member

@fire fire commented Dec 8, 2019

Reopened due to accidental branch deletion.

Need some CICD.

Alternative to #32218 that directly uses Godot's importer to write an exporter.

Features:

Export the scene to glTF2.

Updated 2020-12-20

Todo:

  • Blend shapes are broken

Done:

  • Extra nodes on the root. Debugged.
  • Transforms on textures
  • Renamed to import mesh node and import mesh
  • Add filtering for nans in min and max accessors.
  • Checked csg again
  • Robust compatibility with blender
  • Add lights
  • Move from the the tools menu to an export menu. Use this new plugin interface to add an "export scene" option.
  • Integrate new 4.0 apis
  • Fix alpha scissors
  • Support KHR_texture_transform https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
  • Remove duplicate AnimationPlayer node
  • Remove duplicate Skeleton node
  • Ignored UV Scaling [Not part of the core gltf2 spec] https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
  • Bone attachments Updated 2020-01-01 New Years!
  • Support GLB binary gltf exports
  • Support editor created animation properties
  • Remove extra node on roundtrip.
  • Meshes
  • CSG
  • Gridmap
  • Materials
  • Bone weights
  • Bones
  • Blendshapes
  • The root node is put under the new root node.
  • Cameras
  • Debugged skins and animation skeletons
  • More debugging of meshes
  • Material caching
  • Use node index instead of bone names to do child parent relationships
  • Support all meshes instead of just array meshes
  • Debugged crash with Gridmaps
  • Removed extra node under skeleton for the skeleton
  • Bone animations
  • Blend shape animations (2019-12-05)
  • Camera crashes (2019-12-06)

Special Thanks

Fixes

Fixes: #27375

Fixes: godotengine/godot-proposals#1553

Fixes: godotengine/godot-proposals#885

Fixes: #15059

@Chaosus Chaosus added this to the 4.0 milestone Dec 8, 2019
@fire fire changed the title Create gltf module. [WIP] Create gltf module. Dec 8, 2019
@fire
Copy link
Member Author

fire commented Dec 11, 2019

Current questions:

@reduz

Round tripping Godot import and export adds nodes.

Need some advice on how to merge the 5-8 encode accessors types. The encode accessors code was mostly copy and paste.

How to add the exporter abstraction?

Another thing is creating the concept of an exporter that is lossy in the editor interface design. Like a menu?

@fire fire requested a review from reduz December 11, 2019 18:12
@fire
Copy link
Member Author

fire commented Dec 12, 2019

Due to the requirement of requiring new import and export apis, this is definitely a 4.0 feature. It's back portable, but the pull request as it is currently will be changed.

@fire fire force-pushed the scene_export_native_gltf branch 5 times, most recently from 94ce412 to e5f23cb Compare December 18, 2019 16:11
@fire fire force-pushed the scene_export_native_gltf branch 2 times, most recently from 0a9e1a2 to 00649d5 Compare December 31, 2019 00:51
@fire fire changed the title [WIP] Create gltf module. [WIP] Create gltf exporter Dec 31, 2019
@fire fire force-pushed the scene_export_native_gltf branch 8 times, most recently from 85b1f35 to 15f6269 Compare January 7, 2020 07:10
@fire fire force-pushed the scene_export_native_gltf branch 2 times, most recently from d284efa to 4082eb8 Compare December 21, 2020 23:17
@fire fire force-pushed the scene_export_native_gltf branch 8 times, most recently from f391638 to 496306a Compare December 22, 2020 02:33
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks good overall! Just added some style/code quality comments which apply to most files.

editor/editor_node.cpp Outdated Show resolved Hide resolved
editor/import/scene_importer_mesh.cpp Outdated Show resolved Hide resolved
editor/import/scene_importer_mesh.h Outdated Show resolved Hide resolved
editor/import/scene_importer_mesh.cpp Outdated Show resolved Hide resolved
editor/import/scene_importer_mesh_node_3d.h Outdated Show resolved Hide resolved
modules/gltf/editor_scene_exporter_gltf_plugin.cpp Outdated Show resolved Hide resolved
modules/gltf/gltf_animation.h Outdated Show resolved Hide resolved
modules/gltf/gltf_buffer_view.cpp Outdated Show resolved Hide resolved
modules/gltf/gltf_node.cpp Outdated Show resolved Hide resolved
modules/gltf/register_types.cpp Show resolved Hide resolved
@akien-mga
Copy link
Member

Could you also amend the commit message to be more explicit? "Import and export GLTF2." is misleading as it sounds like it's implementing glTF 2.0 import, which is already supported.

I'd suggest adding some details to the commit message's body to explain what the commit actually implements (it doesn't have to be as thorough as the PR description, just a few lines that tell a git log reader what to expect from that commit).

@fire fire force-pushed the scene_export_native_gltf branch 2 times, most recently from b744ebc to 4b4efd2 Compare December 23, 2020 00:56
* Support KHR_texture_transform.
* Support exporting glTF2
* Support exporting instanced scenes
* Extract into a gltf state and gltf document
* Add a tools menu for exporting gltf2
@akien-mga akien-mga merged commit 187be73 into godotengine:master Dec 23, 2020
@akien-mga
Copy link
Member

Thanks! Amazing work!

@AndreaCatania
Copy link
Contributor

This also fixes the mesh name import, super nice. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants