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
ada8216d
Commit
ada8216d
authored
6 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
import_obj: Comment why getting an int as a float is needed
parent
22e76bba
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_scene_obj/import_obj.py
+4
-3
4 additions, 3 deletions
io_scene_obj/import_obj.py
with
4 additions
and
3 deletions
io_scene_obj/import_obj.py
+
4
−
3
View file @
ada8216d
...
...
@@ -334,7 +334,8 @@ def create_materials(filepath, relpath,
# rgb, filter color, blender has no support for this.
print
(
"
WARNING, currently unsupported
'
tf
'
filter color option, skipped.
"
)
elif
line_id
==
b
'
illum
'
:
illum
=
get_int
(
line_split
[
1
])
# Some MTL files incorrectly use a float for this value, see T60135.
illum
=
any_number_as_int
(
line_split
[
1
])
# inline comments are from the spec, v4.2
if
illum
==
0
:
...
...
@@ -835,9 +836,9 @@ def get_float_func(filepath):
return
float
def
get
_int
(
svalue
):
def
any_number_as
_int
(
svalue
):
if
b
'
,
'
in
svalue
:
return
int
(
float
(
svalue
.
replace
(
b
'
,
'
,
b
'
.
'
)
))
svalue
=
svalue
.
replace
(
b
'
,
'
,
b
'
.
'
)
return
int
(
float
(
svalue
))
...
...
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