Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender_nif_plugin
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
Grant Kim
blender_nif_plugin
Commits
9a52ea70
Commit
9a52ea70
authored
3 years ago
by
Candoran2
Committed by
neomonkeus
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Pulled out method for setting colors as per PR review.
parent
d830447d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_scene_niftools/modules/nif_export/property/shader/__init__.py
+11
-17
11 additions, 17 deletions
...e_niftools/modules/nif_export/property/shader/__init__.py
with
11 additions
and
17 deletions
io_scene_niftools/modules/nif_export/property/shader/__init__.py
+
11
−
17
View file @
9a52ea70
...
...
@@ -80,9 +80,7 @@ class BSShaderProperty:
# bsshader.alpha = (1 - b_mat.alpha)
# Emissive
bsshader
.
emissive_color
.
r
=
b_mat
.
niftools
.
emissive_color
.
r
bsshader
.
emissive_color
.
g
=
b_mat
.
niftools
.
emissive_color
.
g
bsshader
.
emissive_color
.
b
=
b_mat
.
niftools
.
emissive_color
.
b
BSShaderProperty
.
set_color3_property
(
bsshader
.
emissive_color
,
b_mat
.
niftools
.
emissive_color
)
bsshader
.
emissive_color
.
a
=
b_mat
.
niftools
.
emissive_alpha
.
v
# TODO [shader] Expose a emission multiplier value
# bsshader.emissive_multiple = b_mat.emit
...
...
@@ -103,13 +101,9 @@ class BSShaderProperty:
d
=
b_mat
.
diffuse_color
if
b_s_type
==
NifFormat
.
BSLightingShaderPropertyShaderType
[
"
Skin Tint
"
]:
bsshader
.
skin_tint_color
.
r
=
d
[
0
]
bsshader
.
skin_tint_color
.
g
=
d
[
1
]
bsshader
.
skin_tint_color
.
b
=
d
[
2
]
BSShaderProperty
.
set_color3_property
(
bsshader
.
skin_tint_color
,
d
)
elif
b_s_type
==
NifFormat
.
BSLightingShaderPropertyShaderType
[
"
Hair Tint
"
]:
bsshader
.
hair_tint_color
.
r
=
d
[
0
]
bsshader
.
hair_tint_color
.
g
=
d
[
1
]
bsshader
.
hair_tint_color
.
b
=
d
[
2
]
BSShaderProperty
.
set_color3_property
(
bsshader
.
hair_tint_color
,
d
)
# TODO [shader] expose intensity value
# b_mat.diffuse_intensity = 1.0
...
...
@@ -117,10 +111,7 @@ class BSShaderProperty:
bsshader
.
lighting_effect_2
=
b_mat
.
niftools
.
lightingeffect2
# Emissive
e
=
b_mat
.
niftools
.
emissive_color
bsshader
.
emissive_color
.
r
=
e
[
0
]
bsshader
.
emissive_color
.
g
=
e
[
1
]
bsshader
.
emissive_color
.
b
=
e
[
2
]
BSShaderProperty
.
set_color3_property
(
bsshader
.
emissive_color
,
b_mat
.
niftools
.
emissive_color
)
# TODO [shader] Expose a emission multiplier value
# bsshader.emissive_multiple = b_mat.emit
...
...
@@ -128,10 +119,7 @@ class BSShaderProperty:
bsshader
.
glossiness
=
1
/
b_mat
.
roughness
-
1
if
b_mat
.
roughness
!=
0
else
FLOAT_MAX
# Specular color
s
=
b_mat
.
specular_color
bsshader
.
specular_color
.
r
=
s
[
0
]
bsshader
.
specular_color
.
g
=
s
[
1
]
bsshader
.
specular_color
.
b
=
s
[
2
]
BSShaderProperty
.
set_color3_property
(
bsshader
.
specular_color
,
b_mat
.
specular_color
)
bsshader
.
specular_strength
=
b_mat
.
specular_intensity
# Alpha
...
...
@@ -181,3 +169,9 @@ class BSShaderProperty:
if
b_flag
:
sf_flag_index
=
flags
.
_names
.
index
(
sf_flag
)
flags
.
_items
[
sf_flag_index
].
_value
=
1
@staticmethod
def
set_color3_property
(
n_property
,
b_color
):
n_property
.
r
=
b_color
[
0
]
n_property
.
g
=
b_color
[
1
]
n_property
.
b
=
b_color
[
2
]
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