Skip to content

Commit

Permalink
allow vertex properties with one element
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed Dec 6, 2019
1 parent 5ef414b commit 85042d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions trimesh/exchange/load.py
Expand Up @@ -575,6 +575,7 @@ def parse_file_args(file_obj,
# if we still have no resolver try using file_obj name
if (resolver is None and
hasattr(file_obj, 'name') and
file_obj.name is not None and
len(file_obj.name) > 0):
resolver = visual.resolvers.FilePathResolver(file_obj.name)

Expand Down
2 changes: 1 addition & 1 deletion trimesh/exchange/obj.py
Expand Up @@ -510,7 +510,7 @@ def _parse_vertices(text):
for k, v in starts.items() if v >= 0}

# count the number of data values per row on a sample row
per_row = {k: len(v[1].split()) for k, v in data.items()}
per_row = {k: len(v[0].split()) for k, v in data.items()}

# convert data values into numpy arrays
result = collections.defaultdict(lambda: None)
Expand Down
6 changes: 3 additions & 3 deletions trimesh/path/path.py
Expand Up @@ -102,11 +102,10 @@ def __repr__(self):
"""
Print a quick summary of the number of vertices and entities.
"""
r = '<trimesh.{}(vertices.shape={}, len(entities)={})>'.format(
return '<trimesh.{}(vertices.shape={}, len(entities)={})>'.format(
type(self).__name__,
self.vertices.shape,
len(self.entities))
return r

def process(self):
"""
Expand All @@ -124,7 +123,8 @@ def vertices(self):

@vertices.setter
def vertices(self, values):
self._vertices = caching.tracked_array(values, dtype=np.float64)
self._vertices = caching.tracked_array(
values, dtype=np.float64)

@property
def entities(self):
Expand Down

0 comments on commit 85042d0

Please sign in to comment.