""" Opens the rigged doors in a background Blender before another script runs (pictures of them open); the file is not saved. The rig is build/doors.py. set DOORS_OPEN=0.6 blender -b Anchorage_Station_exterior.blend --python build/doors_pose.py --python build/bl_render.py -- ... DOORS_OPEN: 0 shut .. 1 open, for every door's own slider (the timeline stays at frame 1, where it keeps them shut). """ import os import bpy value = float(os.environ.get("DOORS_OPEN", "1.0")) n = 0 for ob in bpy.data.objects: if ob.get("anchorage_rig") == "doors" and "open" in ob.keys(): ob["open"] = value ob.update_tag() n += 1 bpy.context.scene.frame_set(1) print("[doors] %d doors set open %.2f for this run" % (n, value))