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
4c1df0f5
Commit
4c1df0f5
authored
3 years ago
by
Julien Duroure
Browse files
Options
Downloads
Patches
Plain Diff
glTF exporter: Fix transmission export
parent
564fdcdf
No related branches found
No related tags found
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_materials.py
+9
-4
9 additions, 4 deletions
io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
with
10 additions
and
5 deletions
io_scene_gltf2/__init__.py
+
1
−
1
View file @
4c1df0f5
...
...
@@ -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
,
2
,
1
7
),
"
version
"
:
(
3
,
2
,
1
8
),
'
blender
'
:
(
3
,
1
,
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_materials.py
+
9
−
4
View file @
4c1df0f5
...
...
@@ -248,9 +248,10 @@ def __gather_extensions(blender_material, export_settings):
# KHR_materials_transmission
transmission_extension
=
__gather_transmission_extension
(
blender_material
,
export_settings
)
transmission_extension
,
use_actives_uvmap_transmission
=
__gather_transmission_extension
(
blender_material
,
export_settings
)
if
transmission_extension
:
extensions
[
"
KHR_materials_transmission
"
]
=
transmission_extension
actives_uvmaps
.
extend
(
use_actives_uvmap_transmission
)
return
extensions
,
actives_uvmaps
if
extensions
else
None
...
...
@@ -429,17 +430,19 @@ def __gather_transmission_extension(blender_material, export_settings):
transmission_extension
[
'
transmissionFactor
'
]
=
transmission_socket
.
default_value
transmission_enabled
=
transmission_extension
[
'
transmissionFactor
'
]
>
0
elif
__has_image_node_from_socket
(
transmission_socket
):
transmission_extension
[
'
transmissionFactor
'
]
=
1
transmission_extension
[
'
transmissionFactor
'
]
=
1
.0
has_transmission_texture
=
True
transmission_enabled
=
True
if
not
transmission_enabled
:
return
None
return
None
,
None
# Pack transmission channel (R).
if
has_transmission_texture
:
transmission_slots
=
(
transmission_socket
,)
use_actives_uvmaps
=
[]
if
len
(
transmission_slots
)
>
0
:
combined_texture
,
use_active_uvmap
=
gltf2_blender_gather_texture_info
.
gather_texture_info
(
transmission_socket
,
...
...
@@ -448,8 +451,10 @@ def __gather_transmission_extension(blender_material, export_settings):
)
if
has_transmission_texture
:
transmission_extension
[
'
transmissionTexture
'
]
=
combined_texture
if
use_active_uvmap
:
use_actives_uvmaps
.
append
(
"
transmissionTexture
"
)
return
Extension
(
'
KHR_materials_transmission
'
,
transmission_extension
,
False
),
[
"
transmissionTexture
"
]
if
use_active_uvmap
else
[]
return
Extension
(
'
KHR_materials_transmission
'
,
transmission_extension
,
False
),
use_active
s
_uvmap
s
def
__gather_material_unlit
(
blender_material
,
active_uvmap_index
,
export_settings
):
...
...
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