Browse Source

Merge pull request #312 from Jrius/polygon_vcol_cleaning_fix

Fix vcol cleaning bug with polygons
pull/258/head
Adam Johnson 3 years ago committed by GitHub
parent
commit
d9abf79e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      korman/exporter/etlight.py

6
korman/exporter/etlight.py

@ -242,9 +242,15 @@ class LightBaker:
# Now for the Fun Stuff(c)... First, actually get ahold of the other
# face (the one we're connected to via this edge).
other_face = next(f for f in edge.link_faces if f != face)
if not other_face.calc_area():
# Zero area face, ignore it.
continue
# Now get ahold of the loop sharing our vertex on the OTHER SIDE
# of that damnable edge...
other_loop = next(loop for loop in other_face.loops if loop.vert == vert)
if not other_loop.is_convex:
# Happens with complex polygons after edge dissolving. Ignore it.
continue
other_color = other_loop[light_vcol]
# Phew ! Good, now just pick whichever color has the highest average value
if sum(max_color) / 3 < sum(other_color) / 3:

Loading…
Cancel
Save