Skip to content
Snippets Groups Projects
Commit e3bb132d authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF exporter: add gather_joint_hook for user extensions

parent 448d9115
Branches
Tags
No related merge requests found
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
bl_info = { bl_info = {
'name': 'glTF 2.0 format', 'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', 'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 3, 12), "version": (1, 3, 13),
'blender': (2, 90, 0), 'blender': (2, 90, 0),
'location': 'File > Import-Export', 'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0', 'description': 'Import-Export as glTF 2.0',
...@@ -26,7 +26,6 @@ bl_info = { ...@@ -26,7 +26,6 @@ bl_info = {
'category': 'Import-Export', 'category': 'Import-Export',
} }
def get_version_string(): def get_version_string():
return str(bl_info['version'][0]) + '.' + str(bl_info['version'][1]) + '.' + str(bl_info['version'][2]) return str(bl_info['version'][0]) + '.' + str(bl_info['version'][1]) + '.' + str(bl_info['version'][2])
...@@ -569,6 +568,7 @@ class GLTF_PT_export_include(bpy.types.Panel): ...@@ -569,6 +568,7 @@ class GLTF_PT_export_include(bpy.types.Panel):
col.prop(operator, 'export_cameras') col.prop(operator, 'export_cameras')
col.prop(operator, 'export_lights') col.prop(operator, 'export_lights')
class GLTF_PT_export_transform(bpy.types.Panel): class GLTF_PT_export_transform(bpy.types.Panel):
bl_space_type = 'FILE_BROWSER' bl_space_type = 'FILE_BROWSER'
bl_region_type = 'TOOL_PROPS' bl_region_type = 'TOOL_PROPS'
......
...@@ -20,6 +20,7 @@ from io_scene_gltf2.io.com import gltf2_io ...@@ -20,6 +20,7 @@ from io_scene_gltf2.io.com import gltf2_io
from io_scene_gltf2.blender.exp import gltf2_blender_extract from io_scene_gltf2.blender.exp import gltf2_blender_extract
from io_scene_gltf2.blender.com import gltf2_blender_math from io_scene_gltf2.blender.com import gltf2_blender_math
from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins
from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions
from ..com.gltf2_blender_extras import generate_extras from ..com.gltf2_blender_extras import generate_extras
@cached @cached
...@@ -66,7 +67,7 @@ def gather_joint(blender_object, blender_bone, export_settings): ...@@ -66,7 +67,7 @@ def gather_joint(blender_object, blender_bone, export_settings):
children.append(gather_joint(blender_object, blender_bone.id_data.pose.bones[bone], export_settings)) children.append(gather_joint(blender_object, blender_bone.id_data.pose.bones[bone], export_settings))
# finally add to the joints array containing all the joints in the hierarchy # finally add to the joints array containing all the joints in the hierarchy
return gltf2_io.Node( node = gltf2_io.Node(
camera=None, camera=None,
children=children, children=children,
extensions=None, extensions=None,
...@@ -81,6 +82,10 @@ def gather_joint(blender_object, blender_bone, export_settings): ...@@ -81,6 +82,10 @@ def gather_joint(blender_object, blender_bone, export_settings):
weights=None weights=None
) )
export_user_extensions('gather_joint_hook', export_settings, node, blender_bone)
return node
def __gather_extras(blender_bone, export_settings): def __gather_extras(blender_bone, export_settings):
if export_settings['gltf_extras']: if export_settings['gltf_extras']:
return generate_extras(blender_bone.bone) return generate_extras(blender_bone.bone)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment