Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
83290c67
Commit
83290c67
authored
2 years ago
by
Julien Duroure
Browse files
Options
Downloads
Patches
Plain Diff
glTF exporter: Fix TRS when parent is skined
parent
c61b0758
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io_scene_gltf2/__init__.py
+1
-1
1 addition, 1 deletion
io_scene_gltf2/__init__.py
io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
+12
-6
12 additions, 6 deletions
io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
with
13 additions
and
7 deletions
io_scene_gltf2/__init__.py
+
1
−
1
View file @
83290c67
...
...
@@ -4,7 +4,7 @@
bl_info
=
{
'
name
'
:
'
glTF 2.0 format
'
,
'
author
'
:
'
Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors
'
,
"
version
"
:
(
3
,
4
,
3
3
),
"
version
"
:
(
3
,
4
,
3
4
),
'
blender
'
:
(
3
,
3
,
0
),
'
location
'
:
'
File > Import-Export
'
,
'
description
'
:
'
Import-Export as glTF 2.0
'
,
...
...
This diff is collapsed.
Click to expand it.
io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
+
12
−
6
View file @
83290c67
...
...
@@ -26,6 +26,9 @@ def gather_node(vnode, export_settings):
blender_object
=
vnode
.
blender_object
skin
=
gather_skin
(
vnode
.
uuid
,
export_settings
)
if
skin
is
not
None
:
vnode
.
skin
=
skin
node
=
gltf2_io
.
Node
(
camera
=
__gather_camera
(
blender_object
,
export_settings
),
children
=
__gather_children
(
vnode
,
blender_object
,
export_settings
),
...
...
@@ -50,9 +53,6 @@ def gather_node(vnode, export_settings):
vnode
.
node
=
node
if
node
.
skin
is
not
None
:
vnode
.
skin
=
skin
return
node
...
...
@@ -314,9 +314,15 @@ def __gather_trans_rot_scale(vnode, export_settings):
trans
,
rot
,
sca
=
vnode
.
matrix_world
.
decompose
()
else
:
# calculate local matrix
trans
,
rot
,
sca
=
(
export_settings
[
'
vtree
'
].
nodes
[
vnode
.
parent_uuid
].
matrix_world
.
inverted_safe
()
@
vnode
.
matrix_world
).
decompose
()
if
export_settings
[
'
vtree
'
].
nodes
[
vnode
.
parent_uuid
].
skin
is
None
:
trans
,
rot
,
sca
=
(
export_settings
[
'
vtree
'
].
nodes
[
vnode
.
parent_uuid
].
matrix_world
.
inverted_safe
()
@
vnode
.
matrix_world
).
decompose
()
else
:
# But ... if parent has skin, the parent TRS are not taken into account, so don't get local from parent, but from armature
# It also depens if skined mesh is parented to armature or not
if
export_settings
[
'
vtree
'
].
nodes
[
vnode
.
parent_uuid
].
parent_uuid
is
not
None
and
export_settings
[
'
vtree
'
].
nodes
[
export_settings
[
'
vtree
'
].
nodes
[
vnode
.
parent_uuid
].
parent_uuid
].
blender_type
==
VExportNode
.
ARMATURE
:
trans
,
rot
,
sca
=
(
export_settings
[
'
vtree
'
].
nodes
[
export_settings
[
'
vtree
'
].
nodes
[
vnode
.
parent_uuid
].
armature
].
matrix_world
.
inverted_safe
()
@
vnode
.
matrix_world
).
decompose
()
else
:
trans
,
rot
,
sca
=
vnode
.
matrix_world
.
decompose
()
# make sure the rotation is normalized
rot
.
normalize
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment