erge branch 'master' of http://git.nakadashi.lol/akko/diffvg
This commit is contained in:
@@ -586,13 +586,17 @@ def obj_to_scene(filename):
|
||||
"""
|
||||
Load from a obj file and convert to PyTorch tensors.
|
||||
"""
|
||||
f = open(filename)
|
||||
lines = f.readlines()
|
||||
with open(filename, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
data_lines = []
|
||||
vertices = []
|
||||
faces = []
|
||||
for line in lines:
|
||||
l=line.split()
|
||||
# Ignore empty lines
|
||||
if not l:
|
||||
continue
|
||||
#vertex
|
||||
if(l[0] == "v"):
|
||||
vertices.append(l)
|
||||
|
Reference in New Issue
Block a user