10 Commits

Author SHA1 Message Date
Ma Nan
d4bc355d94 Merge pull request #51 from OmooLab/feature/dev
Feature/dev
2024-11-01 11:58:31 +08:00
4e9dc1ce67 Merge branch 'main' of https://github.com/OmooLab/BioxelNodes into feature/dev 2024-11-01 11:57:41 +08:00
dc7d9382d6 fix: slice viewer change all 3d viewports
fix: eevee env light effect cycles render
feat: add gamma prop to correct color from non-linear image
feat: add "copy transform" node
2024-11-01 11:57:29 +08:00
Ma Nan
66aafb41bd Merge pull request #50 from OmooLab/feature/dev
Feature/dev
2024-10-30 13:32:19 +08:00
2c844c01ec Merge branch 'main' of https://github.com/OmooLab/BioxelNodes into feature/dev 2024-10-30 13:30:50 +08:00
e5be3ad5db feat: better shader in eevee
feat: add more control to transform node
feat: add env light to reduse volume shadow in eevee
2024-10-30 13:29:53 +08:00
Ma Nan
29b302531b Merge pull request #49 from OmooLab/feature/dev
feat: improve eevee render
2024-10-29 15:15:14 +08:00
3ca7c2ac5a feat: improve eevee render 2024-10-29 15:14:31 +08:00
Ma Nan
32138c1da6 Merge pull request #48 from OmooLab/feature/dev
feat: add help menu
2024-10-10 12:56:44 +08:00
86fc18ab69 feat: add help menu
feat: better surface topo
fix: cutter node invert not work
2024-10-10 12:54:51 +08:00
10 changed files with 103 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
schema_version = "1.0.0"
id = "bioxelnodes"
version = "1.0.3"
version = "1.0.7"
name = "Bioxel Nodes"
tagline = "For scientific volumetric data visualization in Blender"
maintainer = "Ma Nan <icrdr2010@outlook.com>"

View File

@@ -1,6 +1,6 @@
from pathlib import Path
VERSIONS = [{"label": "Latest", "node_version": (1, 0, 3)},
VERSIONS = [{"label": "Latest", "node_version": (1, 0, 7)},
{"label": "v0.3.x", "node_version": (0, 3, 3)},
{"label": "v0.2.x", "node_version": (0, 2, 9)}]
@@ -8,7 +8,7 @@ NODE_LIB_DIRPATH = Path(Path(__file__).parent,
"assets/Nodes").resolve()
LATEST_NODE_LIB_PATH = lib_path = Path(NODE_LIB_DIRPATH,
"BioxelNodes_latest.blend").resolve()
"BioxelNodes_latest.blend").resolve()
COMPONENT_OUTPUT_NODES = [
"CutoutByThreshold",
@@ -166,6 +166,12 @@ MENU_ITEMS = [
'name': 'ReCenter',
'description': ''
},
{
'label': 'Copy Transform',
'icon': 'EMPTY_AXIS',
'name': 'CopyTransform',
'description': ''
},
{
'label': 'Extract Transform',
'icon': 'EMPTY_AXIS',

View File

@@ -19,7 +19,7 @@ from .operators.container import (AddLocator, AddSlicer, ContainerProps,
ExtractNodeMesh, ExtractNodeBboxWire, ExtractNodeShapeWire)
from .operators.io import (ImportAsLabel, ImportAsScalar, ImportAsColor)
from .operators.misc import (CleanTemp,
from .operators.misc import (AddEeveeEnv, CleanTemp, Help,
ReLinkNodeLib, RemoveAllMissingLayers,
RenderSettingPreset, SaveAllLayersCache,
SaveNodeLib, SliceViewer)
@@ -57,6 +57,10 @@ class IncompatibleMenu(bpy.types.Menu):
layout.separator()
layout.menu(RenderSettingMenu.bl_idname)
layout.separator()
layout.operator(Help.bl_idname,
icon=Help.bl_icon)
class FetchLayerMenu(bpy.types.Menu):
bl_idname = "BIOXELNODES_MT_ADD_LAYER"
@@ -208,8 +212,13 @@ class BioxelNodesTopbarMenu(bpy.types.Menu):
layout.menu(DangerZoneMenu.bl_idname)
layout.separator()
layout.operator(AddEeveeEnv.bl_idname)
layout.menu(RenderSettingMenu.bl_idname)
layout.separator()
layout.operator(Help.bl_idname,
icon=Help.bl_icon)
def TOPBAR(self, context):
layout = self.layout

View File

@@ -541,6 +541,7 @@ class ContainerProps(bpy.types.Operator):
bl_label = "Change Container Properties"
bl_description = "Change current ontainer properties"
bl_icon = "FILE_TICK"
bl_options = {'UNDO'}
scene_scale: bpy.props.FloatProperty(name="Scene Scale",
soft_min=0.0001, soft_max=10.0,

View File

@@ -664,6 +664,9 @@ class ImportVolumetricDataDialog(bpy.types.Operator):
else:
data = data.astype(np.float32)
# Gamma Correct
# data = data ** 2.2
name = self.layer_name or "Color"
if data.shape[4] == 1:
data = np.repeat(data, repeats=3, axis=4)
@@ -854,6 +857,7 @@ class ImportVolumetricDataDialog(bpy.types.Operator):
bpy.ops.bioxelnodes.render_setting_preset('EXEC_DEFAULT',
preset="balance")
bpy.context.scene.render.engine = 'CYCLES'
bpy.ops.bioxelnodes.slice_viewer('EXEC_DEFAULT')
self.report({"INFO"}, "Successfully Imported")
return {'FINISHED'}

View File

@@ -1,3 +1,4 @@
import webbrowser
import bpy
from pathlib import Path
import shutil
@@ -145,7 +146,7 @@ class RenderSettingPreset(bpy.types.Operator):
def execute(self, context):
if self.preset == "performance":
# EEVEE
bpy.context.scene.eevee.use_taa_reprojection = False
# bpy.context.scene.eevee.use_taa_reprojection = False
bpy.context.scene.eevee.volumetric_tile_size = '2'
bpy.context.scene.eevee.volumetric_shadow_samples = 32
bpy.context.scene.eevee.volumetric_samples = 64
@@ -161,7 +162,7 @@ class RenderSettingPreset(bpy.types.Operator):
elif self.preset == "balance":
# EEVEE
bpy.context.scene.eevee.use_taa_reprojection = False
# bpy.context.scene.eevee.use_taa_reprojection = False
bpy.context.scene.eevee.volumetric_tile_size = '2'
bpy.context.scene.eevee.volumetric_shadow_samples = 64
bpy.context.scene.eevee.volumetric_samples = 128
@@ -177,7 +178,7 @@ class RenderSettingPreset(bpy.types.Operator):
elif self.preset == "quality":
# EEVEE
bpy.context.scene.eevee.use_taa_reprojection = False
# 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
@@ -201,20 +202,29 @@ class SliceViewer(bpy.types.Operator):
bl_icon = "FILE_VOLUME"
def execute(self, context):
bpy.context.scene.eevee.use_taa_reprojection = False
# 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 = 128
bpy.context.scene.eevee.volumetric_ray_depth = 1
bpy.context.scene.eevee.use_shadows = False
bpy.context.scene.eevee.use_volumetric_shadows = False
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
area.spaces[0].shading.type = 'MATERIAL'
area.spaces[0].shading.studio_light = 'studio.exr'
area.spaces[0].shading.studiolight_intensity = 2.5
area.spaces[0].shading.use_scene_lights = False
area.spaces[0].shading.use_scene_world = False
view_3d = None
if context.area.type == 'VIEW_3D':
view_3d = context.area
else:
for area in context.screen.areas:
if area.type == 'VIEW_3D':
view_3d = area
break
if view_3d:
view_3d.spaces[0].shading.type = 'MATERIAL'
view_3d.spaces[0].shading.studio_light = 'studio.exr'
view_3d.spaces[0].shading.studiolight_intensity = 1.5
view_3d.spaces[0].shading.use_scene_lights = False
view_3d.spaces[0].shading.use_scene_world = False
return {'FINISHED'}
@@ -260,3 +270,56 @@ class RemoveAllMissingLayers(bpy.types.Operator, RemoveLayers):
event,
message=f"Are you sure to remove all **Missing** layers?")
return {'RUNNING_MODAL'}
class Help(bpy.types.Operator):
bl_idname = "bioxelnodes.help"
bl_label = "Need Help?"
bl_description = "Online Manual for Beginner"
bl_icon = "HELP"
def execute(self, context):
webbrowser.open(
'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.wm.append(
directory=f"{str(LATEST_NODE_LIB_PATH)}/Object",
filename="EeveeEnv"
)
# 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_shadows = True
bpy.context.scene.eevee.use_volumetric_shadows = True
return {'FINISHED'}

View File

@@ -1,4 +1,4 @@
# Q & A
# FAQ
## Nothing in the scene when rendering?

View File

@@ -14,7 +14,7 @@ nav:
- Advanced Usage: advanced_usage.md
- Support Format: support_format.md
- Improve Performance: improve_performance.md
- Q & A: qa.md
- FAQ: faq.md
- Tutorials:
- SARS-Cov-2: SARS-Cov-2.md

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "bioxelnodes"
version = "1.0.3"
version = "1.0.7"
description = ""
authors = ["Ma Nan <icrdr2010@outlook.com>"]
license = "MIT"