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
a0e769ee
Commit
a0e769ee
authored
6 years ago
by
Philipp Oeser
Browse files
Options
Downloads
Patches
Plain Diff
OBJ import: Fix spec
parent
b424215f
Branches
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_obj/import_obj.py
+3
-2
3 additions, 2 deletions
io_scene_obj/import_obj.py
with
3 additions
and
2 deletions
io_scene_obj/import_obj.py
+
3
−
2
View file @
a0e769ee
...
...
@@ -227,7 +227,7 @@ def create_materials(filepath, relpath,
# TODO: Find a way to guesstimate best value from diffuse color...
# IDEA: Use standard deviation of both spec and diff colors (i.e. how far away they are
# from some grey), and apply the the proportion between those two as tint factor?
spec
=
sum
(
spec_color
)
/
3.0
spec
=
sum
(
spec_color
s
)
/
3.0
# ~ spec_var = math.sqrt(sum((c - spec) ** 2 for c in spec_color) / 3.0)
# ~ diff = sum(context_mat_wrap.base_color) / 3.0
# ~ diff_var = math.sqrt(sum((c - diff) ** 2 for c in context_mat_wrap.base_color) / 3.0)
...
...
@@ -297,7 +297,8 @@ def create_materials(filepath, relpath,
col
=
(
float_func
(
line_split
[
1
]),
float_func
(
line_split
[
2
]),
float_func
(
line_split
[
3
]))
context_mat_wrap
.
base_color
=
col
elif
line_id
==
b
'
ks
'
:
spec_color
=
(
float_func
(
line_split
[
1
])
+
float_func
(
line_split
[
2
])
+
float_func
(
line_split
[
3
]))
spec_colors
[:]
=
[
float_func
(
line_split
[
1
]),
float_func
(
line_split
[
2
]),
float_func
(
line_split
[
3
])]
context_material_vars
.
add
(
"
specular
"
)
elif
line_id
==
b
'
ke
'
:
# We cannot set context_material.emit right now, we need final diffuse color as well for this.
...
...
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