Update render_mesh.py
This commit is contained in:
@@ -266,8 +266,7 @@ def render_from_smpl(thetas, yfov, move_x, move_y, move_z, x_rot, y_rot, z_rot,
|
||||
#Build the scene
|
||||
camera = pyrender.PerspectiveCamera(yfov)
|
||||
bg_color = [1, 1, 1, 0.8]
|
||||
scene = pyrender.Scene(bg_color=bg_color, ambient_light=(0.4, 0.4, 0.4))
|
||||
scene.add(camera, pose=camera_pose)
|
||||
|
||||
if draw_platform:
|
||||
scene.add(polygon_render, pose=platform_pose)
|
||||
if not normals:
|
||||
@@ -280,6 +279,8 @@ def render_from_smpl(thetas, yfov, move_x, move_y, move_z, x_rot, y_rot, z_rot,
|
||||
print("Rendering SMPL human mesh...")
|
||||
pbar = comfy.utils.ProgressBar(frames)
|
||||
for i in tqdm(range(frames)):
|
||||
scene = pyrender.Scene(bg_color=bg_color, ambient_light=(0.4, 0.4, 0.4))
|
||||
scene.add(camera, pose=camera_pose)
|
||||
mesh = Trimesh(vertices=vertices[0, :, :, i].squeeze().tolist(), faces=faces)
|
||||
mesh = pyrender.Mesh.from_trimesh(mesh, material=material)
|
||||
scene.add(mesh)
|
||||
|
||||
Reference in New Issue
Block a user