Ship the WeChat hot-update catalogs and the camp, TideWhale T2, UI atlas, and animation-lab work.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
"""Render identical poses/cameras for SOMA baseline and hand-only trial."""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import bpy
|
||||
from mathutils import Vector
|
||||
|
||||
folder = Path(sys.argv[sys.argv.index('--')+1]).resolve()
|
||||
for label, path in [('baseline', folder/'kimodo/Walk/baked.glb'), ('hand_cleanup', folder/'audit/hand_cleanup/Walk.glb')]:
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.ops.import_scene.gltf(filepath=str(path))
|
||||
scene = bpy.context.scene
|
||||
# glTF seconds are imported at Blender's current 24 fps; frame 24 = 1 second.
|
||||
scene.frame_set(24)
|
||||
scene.render.engine = 'CYCLES'
|
||||
scene.cycles.samples = 12
|
||||
scene.render.resolution_x, scene.render.resolution_y = 512, 640
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.view_settings.view_transform = 'AgX'
|
||||
world = bpy.data.worlds.new('AuditWorld')
|
||||
world.use_nodes = True
|
||||
world.node_tree.nodes['Background'].inputs[0].default_value = (.35, .38, .42, 1)
|
||||
world.node_tree.nodes['Background'].inputs[1].default_value = .7
|
||||
scene.world = world
|
||||
center = Vector((0, 0, .56))
|
||||
cam = bpy.data.objects.new('AuditCamera', bpy.data.cameras.new('AuditCamera'))
|
||||
scene.collection.objects.link(cam)
|
||||
scene.camera = cam
|
||||
cam.data.type = 'ORTHO'
|
||||
cam.data.ortho_scale = 1.43
|
||||
for direction, power in [((2, 3, 4), 180), ((-3, -1, 2), 120)]:
|
||||
light = bpy.data.objects.new('AuditLight', bpy.data.lights.new('AuditLight', 'AREA'))
|
||||
scene.collection.objects.link(light)
|
||||
light.location = center + Vector(direction)
|
||||
light.rotation_euler = (center-light.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
light.data.energy, light.data.size = power, 3
|
||||
for view, direction in [('side', (3, 0, .1)), ('back', (0, -3, .1))]:
|
||||
cam.location = center + Vector(direction)
|
||||
cam.rotation_euler = (center-cam.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
scene.render.filepath = str(folder/'audit'/f'{label}_{view}.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
Reference in New Issue
Block a user