kopia lustrzana https://github.com/torrinworx/Blend_My_NFTs
Fixing camera not switching
rodzic
ad9f8cd3d3
commit
9b2114bdb1
|
@ -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:
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue