"""Audit saved props, image links, contact with the floor, and camera cuts.""" from pathlib import Path import json import bpy from mathutils import Vector ROOT=Path(__file__).resolve().parents[2] bpy.ops.wm.open_mainfile(filepath=str(ROOT/'assets/cinematics/blender/eblan-workshop-v5.blend')) scene=bpy.context.scene;missing=[] for image in bpy.data.images: if image.source in {'FILE','SEQUENCE'} and not image.packed_file: if not Path(bpy.path.abspath(image.filepath)).is_file():missing.append(image.filepath) assert not missing,missing assert (scene.render.resolution_x,scene.render.resolution_y)==(1920,1080) assert scene.frame_start==1 and scene.frame_end==576 and scene.render.fps==24 cans=[o for o in scene.objects if o.name.startswith('Energy / complete')] assert len(cans)==40,len(cans) assert sum(bool(o.get('floor_litter')) for o in cans)==18 assert len([o for o in cans if o.get('crushed')])==9 assert [m.frame for m in scene.timeline_markers if m.camera]==[1,121,265,409] observed=[] for frame in [1,120,121,264,265,408,409,576]: scene.frame_set(frame);observed.append((frame,scene.camera.name)) assert scene.camera.name.startswith('01' if frame<=120 else '02' if frame<=264 else '03' if frame<=408 else '04') floor_poses=[dict(name=o.name,position=list(o.location)) for o in cans if o.get('floor_litter')] assert all(-2