mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-18 22:09:38 +08:00
vertex colors
This commit is contained in:
parent
faeb47b3c8
commit
391eacf9f0
@ -305,7 +305,7 @@ def fill_holes_fn(vertices, faces, max_perimeter=0.03):
|
|||||||
def make_double_sided(vertices, faces, colors=None):
|
def make_double_sided(vertices, faces, colors=None):
|
||||||
"""
|
"""
|
||||||
Creates a double-sided mesh by duplicating vertices, faces, and colors.
|
Creates a double-sided mesh by duplicating vertices, faces, and colors.
|
||||||
Duplicating vertices prevents opposite faces from sharing the same index,
|
Duplicating vertices prevents opposite faces from sharing the same index,
|
||||||
which stops the rendering engine from cancelling out the normals to [0,0,0].
|
which stops the rendering engine from cancelling out the normals to [0,0,0].
|
||||||
"""
|
"""
|
||||||
is_batched = vertices.ndim == 3
|
is_batched = vertices.ndim == 3
|
||||||
@ -852,8 +852,8 @@ class PostProcessMesh(IO.ComfyNode):
|
|||||||
|
|
||||||
# Safely grab colors if they exist
|
# Safely grab colors if they exist
|
||||||
c_i = None
|
c_i = None
|
||||||
if hasattr(mesh, 'colors') and mesh.colors is not None:
|
if hasattr(mesh, 'vertex_colors') and mesh.vertex_colors is not None:
|
||||||
c_i = mesh.colors[i] if (isinstance(mesh.colors, list) or mesh.colors.ndim == 3) else mesh.colors
|
c_i = mesh.vertex_colors[i] if (isinstance(mesh.vertex_colors, list) or mesh.vertex_colors.ndim == 3) else mesh.vertex_colors
|
||||||
|
|
||||||
v_i, f_i, c_i = process_single(v_i, f_i, c_i, bar)
|
v_i, f_i, c_i = process_single(v_i, f_i, c_i, bar)
|
||||||
|
|
||||||
@ -877,7 +877,7 @@ class PostProcessMesh(IO.ComfyNode):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# Single Unbatched Mesh[V, 3]
|
# Single Unbatched Mesh[V, 3]
|
||||||
c = mesh.colors if hasattr(mesh, 'colors') and mesh.colors is not None else None
|
c = mesh.vertex_colors if hasattr(mesh, 'vertex_colors') and mesh.vertex_colors is not None else None
|
||||||
v, f, c = process_single(mesh.vertices, mesh.faces, c)
|
v, f, c = process_single(mesh.vertices, mesh.faces, c)
|
||||||
mesh.vertices = v
|
mesh.vertices = v
|
||||||
mesh.faces = f
|
mesh.faces = f
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user