OBJ import - Negative values for texture map options get ignored #53702

Closed
opened 2018-01-06 02:08:28 +01:00 by dandy_step · 3 comments

System Information
Windows 10 x64

Blender Version
Broken: Blender 2.79 5bd8ac9

Short description of error
Negative values for texture map options (such as scale and offset, -s and -o, respectively) are broken. I think the issue is that negative values get parsed as options (because of the b'-' check), being added to the map_options dictionary as their own key instead of as a value in the following loop:

      map_options = {}
      curr_token = []
      for token in img_data[:-1]:
          if token.startswith(b'-'):
              if curr_token:
                  map_options[curr_token[0]] = curr_token[1:]
              curr_token[:] = []
          curr_token.append(token)

Exact steps for others to reproduce the error
test_case.zip

  1. Import OBJ (note the negative values in the .mtl file)
  2. Take a look at the offset and scale values in the texture panel, as they get default value whenever there is a negative value
**System Information** Windows 10 x64 **Blender Version** Broken: Blender 2.79 5bd8ac9 **Short description of error** Negative values for texture map options (such as scale and offset, -s and -o, respectively) are broken. I think the issue is that negative values get parsed as options (because of the b'-' check), being added to the map_options dictionary as their own key instead of as a value in the following loop: ``` map_options = {} ``` ``` curr_token = [] for token in img_data[:-1]: if token.startswith(b'-'): if curr_token: map_options[curr_token[0]] = curr_token[1:] curr_token[:] = [] curr_token.append(token) ``` **Exact steps for others to reproduce the error** [test_case.zip](https://archive.blender.org/developer/F1712602/test_case.zip) 1. Import OBJ (note the negative values in the .mtl file) 2. Take a look at the offset and scale values in the texture panel, as they get default value whenever there is a negative value
Author

Added subscriber: @dandy_step

Added subscriber: @dandy_step

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by f5536e5e49

This issue was referenced by f5536e5e49c34dfc0a7b8990257cd393339e23c6
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#53702
No description provided.