Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
temp/
.vscode/
objmc_mod/
temp/
models/
history.txt
out.png
potion.json
Expand Down
12 changes: 7 additions & 5 deletions objmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,24 +298,26 @@ def indexvert(o, vert):

# index obj
def indexobj(o, frame, nframes, nfaces):
for face in range(0, len(o["faces"])):
if face % 1000 == 0:
for faceid in range(0, len(o["faces"])):
if faceid % 1000 == 0:
print(
"\Reading obj ",
frame + 1,
" of ",
nframes,
"...",
"{:>15.2f}".format((frame * nfaces + face) * 100 / (nframes * nfaces)),
"{:>15.2f}".format((frame * nfaces + faceid) * 100 / (nframes * nfaces)),
"%\033[K",
sep="",
end="\r",
)
face = o["faces"][face]
for vert in face:
face = o["faces"][faceid]
for vert in face[:4]:
indexvert(o, vert)
if len(face) == 3:
indexvert(o, face[1])
if len(face) > 4:
print(col.warn + "Found N-Gon" + col.end)


# unique pixel uv per face with color pointing to topleft
Expand Down
Loading