Skip to content

Commit

Permalink
fixed vector handling
Browse files Browse the repository at this point in the history
  • Loading branch information
REDxEYE committed Jan 29, 2021
1 parent 3a64c66 commit b610f94
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions material_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ def write_settings(filename, props):
settings.write('}\n')


def fix_vector(str_vector: str, div_value=1):
str_vector = str_vector.strip('"\'[]{} \t')
values = [float(v) / div_value for v in str_vector.split(' ')]
def fix_vector(values: tuple, div_value=1):
values = [float(v) / div_value for v in values]
if len(values) < 3:
values.extend([0.0] * max(3 - len(values), 0))
return '"[{} {} {}]"'.format(*values)


def convert_material(material: Material, target_addon: Path):
content_manager = ContentManager()
maps = {}
relative_to_path = target_addon
mat_name, mat_path, s1_material = material
Expand Down

0 comments on commit b610f94

Please sign in to comment.