Skip to content

Commit d4bc355

Browse files
authored
Merge pull request #51 from OmooLab/feature/dev
Feature/dev
2 parents 66aafb4 + 4e9dc1c commit d4bc355

File tree

7 files changed

+60
-35
lines changed

7 files changed

+60
-35
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:1dca450cc325919624cf53467378ed8a0ca74cc1704c8f98c415a4215761f2ae
3-
size 9323007
2+
oid sha256:0cce8196479019bb1696092c9d489c8de61b61b7c2b7731d35fa4b7757ac314e
3+
size 9307196

bioxelnodes/blender_manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schema_version = "1.0.0"
22

33
id = "bioxelnodes"
4-
version = "1.0.6"
4+
version = "1.0.7"
55
name = "Bioxel Nodes"
66
tagline = "For scientific volumetric data visualization in Blender"
77
maintainer = "Ma Nan <[email protected]>"

bioxelnodes/constants.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from pathlib import Path
22

3-
VERSIONS = [{"label": "Latest", "node_version": (1, 0, 6)},
3+
VERSIONS = [{"label": "Latest", "node_version": (1, 0, 7)},
44
{"label": "v0.3.x", "node_version": (0, 3, 3)},
55
{"label": "v0.2.x", "node_version": (0, 2, 9)}]
66

77
NODE_LIB_DIRPATH = Path(Path(__file__).parent,
88
"assets/Nodes").resolve()
99

1010
LATEST_NODE_LIB_PATH = lib_path = Path(NODE_LIB_DIRPATH,
11-
"BioxelNodes_latest.blend").resolve()
11+
"BioxelNodes_latest.blend").resolve()
1212

1313
COMPONENT_OUTPUT_NODES = [
1414
"CutoutByThreshold",
@@ -166,6 +166,12 @@
166166
'name': 'ReCenter',
167167
'description': ''
168168
},
169+
{
170+
'label': 'Copy Transform',
171+
'icon': 'EMPTY_AXIS',
172+
'name': 'CopyTransform',
173+
'description': ''
174+
},
169175
{
170176
'label': 'Extract Transform',
171177
'icon': 'EMPTY_AXIS',

bioxelnodes/operators/container.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ class ContainerProps(bpy.types.Operator):
541541
bl_label = "Change Container Properties"
542542
bl_description = "Change current ontainer properties"
543543
bl_icon = "FILE_TICK"
544+
bl_options = {'UNDO'}
544545

545546
scene_scale: bpy.props.FloatProperty(name="Scene Scale",
546547
soft_min=0.0001, soft_max=10.0,

bioxelnodes/operators/io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,9 @@ def progress_callback(frame, total):
664664
else:
665665
data = data.astype(np.float32)
666666

667+
# Gamma Correct
668+
# data = data ** 2.2
669+
667670
name = self.layer_name or "Color"
668671
if data.shape[4] == 1:
669672
data = np.repeat(data, repeats=3, axis=4)

bioxelnodes/operators/misc.py

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,24 @@ def execute(self, context):
207207
bpy.context.scene.eevee.volumetric_shadow_samples = 128
208208
bpy.context.scene.eevee.volumetric_samples = 128
209209
bpy.context.scene.eevee.volumetric_ray_depth = 1
210+
211+
bpy.context.scene.eevee.use_shadows = False
210212
bpy.context.scene.eevee.use_volumetric_shadows = False
211213

212-
for area in bpy.context.screen.areas:
213-
if area.type == 'VIEW_3D':
214-
area.spaces[0].shading.type = 'MATERIAL'
215-
area.spaces[0].shading.studio_light = 'studio.exr'
216-
area.spaces[0].shading.studiolight_intensity = 2.5
217-
area.spaces[0].shading.use_scene_lights = False
218-
area.spaces[0].shading.use_scene_world = False
214+
view_3d = None
215+
if context.area.type == 'VIEW_3D':
216+
view_3d = context.area
217+
else:
218+
for area in context.screen.areas:
219+
if area.type == 'VIEW_3D':
220+
view_3d = area
221+
break
222+
if view_3d:
223+
view_3d.spaces[0].shading.type = 'MATERIAL'
224+
view_3d.spaces[0].shading.studio_light = 'studio.exr'
225+
view_3d.spaces[0].shading.studiolight_intensity = 1.5
226+
view_3d.spaces[0].shading.use_scene_lights = False
227+
view_3d.spaces[0].shading.use_scene_world = False
219228

220229
return {'FINISHED'}
221230

@@ -282,29 +291,35 @@ class AddEeveeEnv(bpy.types.Operator):
282291
bl_description = "To make volume shadow less dark"
283292

284293
def execute(self, context):
285-
bpy.ops.object.light_add(
286-
type='POINT', align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
287-
light_obj = bpy.context.active_object
288-
light_obj.name = "EeveeEnv"
289-
light_obj.data.shadow_soft_size = 100
290-
light_obj.data.energy = 1e+06
291-
light_obj.data.color = (0.1, 0.1, 0.1)
292-
light_obj.data.use_shadow = False
293-
light_obj.data.diffuse_factor = 0
294-
light_obj.data.specular_factor = 0
295-
light_obj.data.transmission_factor = 0
296-
297-
light_obj.hide_select = True
298-
light_obj.lock_location[0] = True
299-
light_obj.lock_location[1] = True
300-
light_obj.lock_location[2] = True
301-
light_obj.lock_rotation[0] = True
302-
light_obj.lock_rotation[1] = True
303-
light_obj.lock_rotation[2] = True
304-
light_obj.lock_scale[0] = True
305-
light_obj.lock_scale[1] = True
306-
light_obj.lock_scale[2] = True
307294

295+
bpy.ops.wm.append(
296+
directory=f"{str(LATEST_NODE_LIB_PATH)}/Object",
297+
filename="EeveeEnv"
298+
)
299+
# bpy.ops.object.light_add(
300+
# type='POINT', align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
301+
# light_obj = bpy.context.active_object
302+
# light_obj.name = "EeveeEnv"
303+
# light_obj.data.shadow_soft_size = 100
304+
# light_obj.data.energy = 1e+06
305+
# light_obj.data.color = (0.1, 0.1, 0.1)
306+
# light_obj.data.use_shadow = False
307+
# light_obj.data.diffuse_factor = 0
308+
# light_obj.data.specular_factor = 0
309+
# light_obj.data.transmission_factor = 0
310+
311+
# light_obj.hide_select = True
312+
# light_obj.lock_location[0] = True
313+
# light_obj.lock_location[1] = True
314+
# light_obj.lock_location[2] = True
315+
# light_obj.lock_rotation[0] = True
316+
# light_obj.lock_rotation[1] = True
317+
# light_obj.lock_rotation[2] = True
318+
# light_obj.lock_scale[0] = True
319+
# light_obj.lock_scale[1] = True
320+
# light_obj.lock_scale[2] = True
321+
322+
bpy.context.scene.eevee.use_shadows = True
308323
bpy.context.scene.eevee.use_volumetric_shadows = True
309324

310325
return {'FINISHED'}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "bioxelnodes"
3-
version = "1.0.6"
3+
version = "1.0.7"
44
description = ""
55
authors = ["Ma Nan <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)