From 3aa692ee44df29670b4a03e29ab1f546b3b0c553 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 15 Oct 2018 09:58:40 +0200 Subject: Fix T57113: OBJ material import int conversion --- io_scene_obj/import_obj.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index c47e6638..a8e945cd 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -426,7 +426,7 @@ def create_materials(filepath, relpath, # rgb, filter color, blender has no support for this. pass elif line_id == b'illum': - illum = int(line_split[1]) + illum = get_int(line_split[1]) # inline comments are from the spec, v4.2 if illum == 0: @@ -957,6 +957,12 @@ def get_float_func(filepath): return float +def get_int(svalue): + if b',' in svalue: + return int(float(svalue.replace(b',', b'.'))) + return int(float(svalue)) + + def load(context, filepath, *, -- cgit v1.2.3