MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / main

Function main

tools/cycles_reference/render.py:399–435  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

397# ---------------------------------------------------------------------------
398
399def main():
400 global CAM_POS_BLOOM, CAM_YAW, CAM_PITCH, CAM_FOVY_DEG
401 global SUN_DIR_BLOOM, SUN_COLOR, SUN_STRENGTH
402 global FILL_DIR_BLOOM, FILL_COLOR, FILL_STRENGTH
403 global ENV_INTENSITY, SCENE_GLTF, OUTDOOR_HDR, NEEDS_DDS_SANITIZE
404
405 scene, out_path, samples, device, view = parse_args()
406 s = SCENES[scene]
407 CAM_POS_BLOOM = s["cam_pos_bloom"]
408 CAM_YAW = s["cam_yaw"]
409 CAM_PITCH = s["cam_pitch"]
410 CAM_FOVY_DEG = s["cam_fovy_deg"]
411 SUN_DIR_BLOOM = s["sun_dir_bloom"]
412 SUN_COLOR = s["sun_color"]
413 SUN_STRENGTH = s["sun_strength"]
414 FILL_DIR_BLOOM = s["fill_dir_bloom"]
415 FILL_COLOR = s["fill_color"]
416 FILL_STRENGTH = s["fill_strength"]
417 ENV_INTENSITY = s["env_intensity"]
418 SCENE_GLTF = s["gltf"]
419 OUTDOOR_HDR = s["hdr"]
420 NEEDS_DDS_SANITIZE = s["needs_dds_sanitize"]
421
422 print(f"[cycles_reference] scene={scene} out={out_path} samples={samples} device={device} view={view}")
423
424 clear_scene()
425 import_scene_gltf()
426 setup_world_hdr()
427 setup_camera()
428 add_sun("Sun_Key", SUN_DIR_BLOOM, SUN_COLOR, SUN_STRENGTH)
429 add_sun("Sun_Fill", FILL_DIR_BLOOM, FILL_COLOR, FILL_STRENGTH)
430 setup_render(out_path, samples, device, view,
431 exposure_ev=s.get("exposure_ev", 0.0))
432
433 print("[cycles_reference] rendering…")
434 bpy.ops.render.render(write_still=True)
435 print(f"[cycles_reference] wrote {out_path}")
436
437
438if __name__ == "__main__":

Callers 1

render.pyFile · 0.70

Calls 9

clear_sceneFunction · 0.85
import_scene_gltfFunction · 0.85
setup_world_hdrFunction · 0.85
setup_cameraFunction · 0.85
add_sunFunction · 0.85
setup_renderFunction · 0.85
renderMethod · 0.80
parse_argsFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected