Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Operators/INTACT_Registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,7 @@ class INTACT_OT_MultiTreshSegment(bpy.types.Operator):
def ImportMeshStl(self, Segment, SegmentStlPath, SegmentColor):

# import stl to blender scene :
if bpy.app.version >= (4, 0, 0):
bpy.ops.wm.stl_import(filepath=SegmentStlPath)
else:
bpy.ops.import_mesh.stl(filepath=SegmentStlPath)

bpy.ops.wm.stl_import(filepath=SegmentStlPath)
obj = bpy.context.object
obj.name = f"{self.Prefix}_{Segment}_SEGMENTATION"
obj.data.name = f"{self.Prefix}_{Segment}_mesh"
Expand Down
11 changes: 6 additions & 5 deletions Operators/INTACT_ScanLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ def save_blend_file(user_project_dir):
ProjectName = Split[-1] or Split[-2]
BlendFile = f"{ProjectName}_CT-SCAN.blend"
Blendpath = join(user_project_dir, BlendFile)
bpy.ops.wm.save_as_mainfile(filepath=Blendpath)

if not exists(Blendpath) or bpy.context.blend_data.filepath == Blendpath:
bpy.ops.wm.save_as_mainfile(filepath=Blendpath)
else:
bpy.ops.wm.save_mainfile()


def read_dicom_image(user_dcm_dir):
Expand Down Expand Up @@ -528,10 +532,7 @@ def execute(self, context):
print("Voxel Rendering START...")
utils.VolumeRender(ImageInfo, GpShader, ShadersBlendFile)
scn = bpy.context.scene
if bpy.app.version >= (4, 2, 0):
scn.render.engine = "BLENDER_EEVEE_NEXT"
else:
scn.render.engine = "BLENDER_EEVEE"
scn.render.engine = "BLENDER_EEVEE_NEXT"
INTACT_Props.GroupNodeName = GpShader
INTACT_Props.ThresholdGroupNodeName = GpThreshold

Expand Down
Loading