add blender settings script
This commit is contained in:
parent
db14ac643e
commit
6e1a26504d
8 changed files with 135 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -99,3 +99,6 @@ ENV/
|
||||||
|
|
||||||
# mypy
|
# mypy
|
||||||
.mypy_cache/
|
.mypy_cache/
|
||||||
|
|
||||||
|
# blender backup files
|
||||||
|
*.blend1
|
||||||
|
|
22
cg/utils/README.md
Normal file
22
cg/utils/README.md
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
## blender_render_settings
|
||||||
|
Сценарий настроек редактора Blender для уменьшения времени рендеринга.
|
||||||
|
|
||||||
|
Тестовая сцена
|
||||||
|

|
||||||
|
|
||||||
|
Сценарий работает в 3х режимах оптимизации:
|
||||||
|
- small
|
||||||
|
- medium
|
||||||
|
- large
|
||||||
|
|
||||||
|
Время тестовой сцены по умолчанию - 32 сек.
|
||||||
|

|
||||||
|
|
||||||
|
Время тестовой сцены в режиме `small` - 13 сек.
|
||||||
|

|
||||||
|
|
||||||
|
Время тестовой сцены в режиме `medium` - 10 сек.
|
||||||
|

|
||||||
|
|
||||||
|
Время тестовой сцены в режиме `large` - 4 сек.
|
||||||
|

|
110
cg/utils/blender_render_settings.py
Normal file
110
cg/utils/blender_render_settings.py
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
DESCRIPTION
|
||||||
|
This script setup render settings for reduce rendertime!
|
||||||
|
"""
|
||||||
|
__version__ = "0.1"
|
||||||
|
|
||||||
|
import bpy
|
||||||
|
|
||||||
|
|
||||||
|
def settings(optimisation_level='medium'):
|
||||||
|
""" select optimisation_level:
|
||||||
|
'small',
|
||||||
|
'medium',
|
||||||
|
'large'
|
||||||
|
"""
|
||||||
|
if optimisation_level == 'small':
|
||||||
|
bpy.context.scene.render.engine = 'CYCLES'
|
||||||
|
bpy.context.scene.cycles.device = 'GPU'
|
||||||
|
bpy.context.scene.cycles.adaptive_threshold = 0.02
|
||||||
|
bpy.data.scenes["Scene"].cycles.samples = 256
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_denoising = True
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoiser = 'OPENIMAGEDENOISE'
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoising_input_passes = 'RGB_ALBEDO_NORMAL'
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoising_prefilter = 'ACCURATE'
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_fast_gi = False
|
||||||
|
bpy.data.scenes["Scene"].cycles.max_bounces = 12
|
||||||
|
bpy.data.scenes["Scene"].cycles.diffuse_bounces = 4
|
||||||
|
bpy.data.scenes["Scene"].cycles.glossy_bounces = 4
|
||||||
|
bpy.data.scenes["Scene"].cycles.transmission_bounces = 12
|
||||||
|
bpy.data.scenes["Scene"].cycles.transparent_max_bounces = 12
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_animated_seed = True
|
||||||
|
bpy.data.scenes["Scene"].cycles.sample_clamp_indirect = 10
|
||||||
|
bpy.data.scenes["Scene"].cycles.caustics_reflective = False
|
||||||
|
bpy.data.scenes["Scene"].cycles.caustics_refractive = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].render.use_motion_blur = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_auto_tile = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].view_settings.view_transform = 'Standard'
|
||||||
|
bpy.data.scenes["Scene"].view_settings.look = 'None'
|
||||||
|
|
||||||
|
bpy.data.worlds["World"].cycles.sampling_method = 'MANUAL'
|
||||||
|
bpy.data.worlds["World"].cycles.sample_map_resolution = 1024
|
||||||
|
bpy.data.worlds["World"].cycles.max_bounces = 1024
|
||||||
|
|
||||||
|
if optimisation_level == 'medium':
|
||||||
|
bpy.context.scene.render.engine = 'CYCLES'
|
||||||
|
bpy.context.scene.cycles.device = 'GPU'
|
||||||
|
bpy.data.scenes["Scene"].cycles.adaptive_threshold = 0.03
|
||||||
|
bpy.data.scenes["Scene"].cycles.samples = 256
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_denoising = True
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoiser = 'OPENIMAGEDENOISE'
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoising_input_passes = 'RGB_ALBEDO_NORMAL'
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoising_prefilter = 'ACCURATE'
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_fast_gi = False
|
||||||
|
bpy.data.scenes["Scene"].cycles.max_bounces = 8
|
||||||
|
bpy.data.scenes["Scene"].cycles.diffuse_bounces = 4
|
||||||
|
bpy.data.scenes["Scene"].cycles.glossy_bounces = 2
|
||||||
|
bpy.data.scenes["Scene"].cycles.transmission_bounces = 4
|
||||||
|
bpy.data.scenes["Scene"].cycles.transparent_max_bounces = 8
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_animated_seed = True
|
||||||
|
bpy.data.scenes["Scene"].cycles.sample_clamp_indirect = 10
|
||||||
|
bpy.data.scenes["Scene"].cycles.caustics_reflective = False
|
||||||
|
bpy.data.scenes["Scene"].cycles.caustics_refractive = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].render.use_motion_blur = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_auto_tile = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].view_settings.view_transform = 'Standard'
|
||||||
|
bpy.data.scenes["Scene"].view_settings.look = 'None'
|
||||||
|
|
||||||
|
bpy.data.worlds["World"].cycles.sampling_method = 'MANUAL'
|
||||||
|
bpy.data.worlds["World"].cycles.sample_map_resolution = 1024
|
||||||
|
bpy.data.worlds["World"].cycles.max_bounces = 1024
|
||||||
|
|
||||||
|
if optimisation_level == 'large':
|
||||||
|
bpy.context.scene.render.engine = 'CYCLES'
|
||||||
|
bpy.context.scene.cycles.device = 'GPU'
|
||||||
|
bpy.data.scenes["Scene"].cycles.adaptive_threshold = 0.05
|
||||||
|
bpy.data.scenes["Scene"].cycles.samples = 128
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_denoising = True
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoiser = 'OPTIX'
|
||||||
|
bpy.data.scenes["Scene"].cycles.denoising_input_passes = 'RGB_ALBEDO'
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_fast_gi = False
|
||||||
|
bpy.data.scenes["Scene"].cycles.max_bounces = 4
|
||||||
|
bpy.data.scenes["Scene"].cycles.diffuse_bounces = 2
|
||||||
|
bpy.data.scenes["Scene"].cycles.glossy_bounces = 2
|
||||||
|
bpy.data.scenes["Scene"].cycles.transmission_bounces = 4
|
||||||
|
bpy.data.scenes["Scene"].cycles.transparent_max_bounces = 4
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_animated_seed = True
|
||||||
|
bpy.data.scenes["Scene"].cycles.sample_clamp_indirect = 10
|
||||||
|
bpy.data.scenes["Scene"].cycles.caustics_reflective = False
|
||||||
|
bpy.data.scenes["Scene"].cycles.caustics_refractive = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].render.use_motion_blur = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].cycles.use_auto_tile = False
|
||||||
|
|
||||||
|
bpy.data.scenes["Scene"].view_settings.view_transform = 'Standard'
|
||||||
|
bpy.data.scenes["Scene"].view_settings.look = 'None'
|
||||||
|
|
||||||
|
bpy.data.worlds["World"].cycles.sampling_method = 'MANUAL'
|
||||||
|
bpy.data.worlds["World"].cycles.sample_map_resolution = 1024
|
||||||
|
bpy.data.worlds["World"].cycles.max_bounces = 1024
|
BIN
cg/utils/img/blender_render_settings_default.jpg
Normal file
BIN
cg/utils/img/blender_render_settings_default.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 215 KiB |
BIN
cg/utils/img/blender_render_settings_large.jpg
Normal file
BIN
cg/utils/img/blender_render_settings_large.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 274 KiB |
BIN
cg/utils/img/blender_render_settings_medium.jpg
Normal file
BIN
cg/utils/img/blender_render_settings_medium.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 234 KiB |
BIN
cg/utils/img/blender_render_settings_small.jpg
Normal file
BIN
cg/utils/img/blender_render_settings_small.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 273 KiB |
BIN
cg/utils/img/scene.blend
Normal file
BIN
cg/utils/img/scene.blend
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue