From e5be3ad5db4f221d1b108f3b94636ad6962f4a81 Mon Sep 17 00:00:00 2001 From: Ma Nan Date: Wed, 30 Oct 2024 13:29:53 +0800 Subject: [PATCH] feat: better shader in eevee feat: add more control to transform node feat: add env light to reduse volume shadow in eevee --- .../assets/Nodes/BioxelNodes_latest.blend | 4 +-- bioxelnodes/blender_manifest.toml | 2 +- bioxelnodes/constants.py | 2 +- bioxelnodes/menus.py | 3 +- bioxelnodes/operators/misc.py | 34 +++++++++++++++++++ pyproject.toml | 2 +- 6 files changed, 41 insertions(+), 6 deletions(-) diff --git a/bioxelnodes/assets/Nodes/BioxelNodes_latest.blend b/bioxelnodes/assets/Nodes/BioxelNodes_latest.blend index bda89c5..74d16d7 100644 --- a/bioxelnodes/assets/Nodes/BioxelNodes_latest.blend +++ b/bioxelnodes/assets/Nodes/BioxelNodes_latest.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79dc46259b1a3f248fc647fc1f73e5a8591e53c0af3b830e5360ddff981372cf -size 9275918 +oid sha256:1dca450cc325919624cf53467378ed8a0ca74cc1704c8f98c415a4215761f2ae +size 9323007 diff --git a/bioxelnodes/blender_manifest.toml b/bioxelnodes/blender_manifest.toml index 11e1a17..6fac40b 100644 --- a/bioxelnodes/blender_manifest.toml +++ b/bioxelnodes/blender_manifest.toml @@ -1,7 +1,7 @@ schema_version = "1.0.0" id = "bioxelnodes" -version = "1.0.5" +version = "1.0.6" name = "Bioxel Nodes" tagline = "For scientific volumetric data visualization in Blender" maintainer = "Ma Nan " diff --git a/bioxelnodes/constants.py b/bioxelnodes/constants.py index 7d63d18..82d1897 100644 --- a/bioxelnodes/constants.py +++ b/bioxelnodes/constants.py @@ -1,6 +1,6 @@ from pathlib import Path -VERSIONS = [{"label": "Latest", "node_version": (1, 0, 5)}, +VERSIONS = [{"label": "Latest", "node_version": (1, 0, 6)}, {"label": "v0.3.x", "node_version": (0, 3, 3)}, {"label": "v0.2.x", "node_version": (0, 2, 9)}] diff --git a/bioxelnodes/menus.py b/bioxelnodes/menus.py index 1c9cb5f..da21be1 100644 --- a/bioxelnodes/menus.py +++ b/bioxelnodes/menus.py @@ -19,7 +19,7 @@ ExtractNodeMesh, ExtractNodeBboxWire, ExtractNodeShapeWire) from .operators.io import (ImportAsLabel, ImportAsScalar, ImportAsColor) -from .operators.misc import (CleanTemp, Help, +from .operators.misc import (AddEeveeEnv, CleanTemp, Help, ReLinkNodeLib, RemoveAllMissingLayers, RenderSettingPreset, SaveAllLayersCache, SaveNodeLib, SliceViewer) @@ -212,6 +212,7 @@ def draw(self, context): layout.menu(DangerZoneMenu.bl_idname) layout.separator() + layout.operator(AddEeveeEnv.bl_idname) layout.menu(RenderSettingMenu.bl_idname) layout.separator() diff --git a/bioxelnodes/operators/misc.py b/bioxelnodes/operators/misc.py index 037683b..621d488 100644 --- a/bioxelnodes/operators/misc.py +++ b/bioxelnodes/operators/misc.py @@ -274,3 +274,37 @@ def execute(self, context): 'https://omoolab.github.io/BioxelNodes/latest/', new=2) return {'FINISHED'} + + +class AddEeveeEnv(bpy.types.Operator): + bl_idname = "bioxelnodes.add_eevee_env" + bl_label = "Add EEVEE Env Light" + bl_description = "To make volume shadow less dark" + + def execute(self, context): + bpy.ops.object.light_add( + type='POINT', align='WORLD', location=(0, 0, 0), scale=(1, 1, 1)) + light_obj = bpy.context.active_object + light_obj.name = "EeveeEnv" + light_obj.data.shadow_soft_size = 100 + light_obj.data.energy = 1e+06 + light_obj.data.color = (0.1, 0.1, 0.1) + light_obj.data.use_shadow = False + light_obj.data.diffuse_factor = 0 + light_obj.data.specular_factor = 0 + light_obj.data.transmission_factor = 0 + + light_obj.hide_select = True + light_obj.lock_location[0] = True + light_obj.lock_location[1] = True + light_obj.lock_location[2] = True + light_obj.lock_rotation[0] = True + light_obj.lock_rotation[1] = True + light_obj.lock_rotation[2] = True + light_obj.lock_scale[0] = True + light_obj.lock_scale[1] = True + light_obj.lock_scale[2] = True + + bpy.context.scene.eevee.use_volumetric_shadows = True + + return {'FINISHED'} diff --git a/pyproject.toml b/pyproject.toml index 2a99d8a..fd165cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bioxelnodes" -version = "1.0.5" +version = "1.0.6" description = "" authors = ["Ma Nan "] license = "MIT"