Fixing camera not switching

pull/161/head
duckz 2023-05-09 13:57:44 +08:00
rodzic ad9f8cd3d3
commit 9b2114bdb1
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -299,12 +299,18 @@ def render_and_save_nfts(input):
log.info(f"\nDNA Code:{full_single_dna}")
active_camera = False
for c in dna_dictionary:
collection = dna_dictionary[c]
if collection != '0':
bpy.data.collections[collection].hide_render = False
bpy.data.collections[collection].hide_viewport = False
# Detect camera in collection
for ob in bpy.data.collections[collection].objects:
if ob.type == 'CAMERA':
active_camera = ob
time_start_2 = time.time()
# Main paths for batch sub-folders:
@ -332,6 +338,10 @@ def render_and_save_nfts(input):
if os.path.exists(file_path):
os.remove(file_path)
# Switching Camera
if active_camera:
bpy.context.scene.camera = active_camera
# Generation/Rendering:
if input.enable_images: