custom_shelf/devshelf/Tool/test/AO_batch_test.py

30 lines
888 B
Python
Raw Normal View History

2022-03-04 12:28:53 +01:00
# coding: utf-8
import bpy
import os
from os import listdir
from os.path import join, dirname, basename, exists, isfile, isdir, splitext
import re, fnmatch, glob
from mathutils import Vector, Matrix
from math import radians, degrees
C = bpy.context
D = bpy.data
scene = C.scene
print('====')
'''
for i in range(0, 8):
ao = i * 0.25
scene.eevee.gtao_distance = ao
scene.render.filepath = join(dirname(D.filepath), f'{splitext(basename(D.filepath))[0]}-{scene.frame_current}_AO{i}-{ao}')
bpy.ops.render.render(animation=False, write_still=True)
'''
for i in range(0, 8):
fac = 1 - i * 0.1
#scene.eevee.gtao_distance = ao
scene.eevee.gtao_factor = fac
scene.render.filepath = join(dirname(D.filepath), f'{splitext(basename(D.filepath))[0]}-{scene.frame_current}_AOfac{i}-{fac}')
bpy.ops.render.render(animation=False, write_still=True)
print('done')