feat: layer list system
This commit is contained in:
@@ -1,31 +1,10 @@
|
||||
import bpy
|
||||
from pathlib import Path
|
||||
|
||||
from ..bioxelutils.utils import get_layer_prop_value
|
||||
from .. import __package__ as base_package
|
||||
|
||||
|
||||
def change_render_setting(context):
|
||||
preferences = get_preferences(context)
|
||||
if preferences.do_change_render_setting:
|
||||
bpy.context.scene.render.engine = 'CYCLES'
|
||||
try:
|
||||
bpy.context.scene.cycles.shading_system = True
|
||||
bpy.context.scene.cycles.volume_bounces = 12
|
||||
bpy.context.scene.cycles.transparent_max_bounces = 16
|
||||
bpy.context.scene.cycles.volume_preview_step_rate = 10
|
||||
bpy.context.scene.cycles.volume_step_rate = 10
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
bpy.context.scene.eevee.use_taa_reprojection = False
|
||||
bpy.context.scene.eevee.volumetric_tile_size = '2'
|
||||
bpy.context.scene.eevee.volumetric_shadow_samples = 128
|
||||
bpy.context.scene.eevee.volumetric_samples = 256
|
||||
bpy.context.scene.eevee.use_volumetric_shadows = True
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def select_object(target_obj):
|
||||
for obj in bpy.data.objects:
|
||||
obj.select_set(False)
|
||||
@@ -58,3 +37,24 @@ def get_cache_dir(context):
|
||||
cache_path = Path(preferences.cache_dir, 'VDBs')
|
||||
cache_path.mkdir(parents=True, exist_ok=True)
|
||||
return str(cache_path)
|
||||
|
||||
|
||||
def get_layer_item_label(context, layer_obj):
|
||||
label = get_layer_label(layer_obj)
|
||||
cache_filepath = Path(bpy.path.abspath(layer_obj.data.filepath)).resolve()
|
||||
if cache_filepath.is_file():
|
||||
cache_dirpath = Path(get_cache_dir(context))
|
||||
if cache_dirpath in cache_filepath.parents:
|
||||
label = "* " + label
|
||||
|
||||
else:
|
||||
label = "**MISSING**" + label
|
||||
|
||||
return label
|
||||
|
||||
|
||||
def get_layer_label(layer_obj):
|
||||
name = get_layer_prop_value(layer_obj, "name")
|
||||
kind = get_layer_prop_value(layer_obj, "kind")
|
||||
|
||||
return f"{name}"
|
||||
|
||||
Reference in New Issue
Block a user