Skip to content

Commit

Permalink
fix cannot extract wire
Browse files Browse the repository at this point in the history
  • Loading branch information
icrdr committed Sep 13, 2024
1 parent c22ab2c commit 0ebc6da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
6 changes: 2 additions & 4 deletions bioxelnodes/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
SaveContainer, LoadContainer,
AddPieCutter, AddPlaneCutter,
AddCylinderCutter, AddCubeCutter, AddSphereCutter,
ExtractBboxWire, ExtractMesh, ExtractVolume, ExtractShapeWire,
ExtractNodeMesh, ExtractNodeBboxWire, ExtractNodeVolume, ExtractNodeShapeWire)
ExtractBboxWire, ExtractMesh, ExtractShapeWire,
ExtractNodeMesh, ExtractNodeBboxWire, ExtractNodeShapeWire)

from .operators.io import (ImportAsLabel, ImportAsScalar, ImportAsColor)
from .operators.misc import (CleanTemp,
Expand Down Expand Up @@ -80,7 +80,6 @@ class ExtractFromContainerMenu(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.operator(ExtractMesh.bl_idname)
layout.operator(ExtractVolume.bl_idname)
layout.operator(ExtractShapeWire.bl_idname)
layout.operator(ExtractBboxWire.bl_idname)

Expand Down Expand Up @@ -261,7 +260,6 @@ class NodeContextMenu(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.operator(ExtractNodeMesh.bl_idname)
layout.operator(ExtractNodeVolume.bl_idname)
layout.operator(ExtractNodeShapeWire.bl_idname)
layout.operator(ExtractNodeBboxWire.bl_idname)

Expand Down
28 changes: 11 additions & 17 deletions bioxelnodes/operators/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,6 @@ class ExtractNodeMesh(bpy.types.Operator, ExtractNodeObject):
object_type = "Mesh"


class ExtractNodeVolume(bpy.types.Operator, ExtractNodeObject):
bl_idname = "bioxelnodes.extract_node_volume"
bl_label = "Extract Volume"
bl_description = "Extract Volume"
bl_icon = "OUTLINER_OB_VOLUME"
object_type = "Volume"


class ExtractNodeShapeWire(bpy.types.Operator, ExtractNodeObject):
bl_idname = "bioxelnodes.extract_node_shape_wire"
bl_label = "Extract Shape Wire"
Expand Down Expand Up @@ -204,7 +196,17 @@ def execute(self, context):
use_link=get_use_link())

fetch_mesh_node.inputs[0].default_value = container_obj
node_group.links.new(fetch_mesh_node.outputs[0], output_node.inputs[0])

if self.object_type == "Mesh":
node_group.links.new(
fetch_mesh_node.outputs[0], output_node.inputs[0])
else:
curve_to_mesh_node = node_group.nodes.new(
"GeometryNodeCurveToMesh")
node_group.links.new(
fetch_mesh_node.outputs[0], curve_to_mesh_node.inputs[0])
node_group.links.new(
curve_to_mesh_node.outputs[0], output_node.inputs[0])

for modifier in obj.modifiers:
bpy.ops.object.modifier_apply(modifier=modifier.name)
Expand All @@ -226,14 +228,6 @@ class ExtractMesh(bpy.types.Operator, ExtractObject):
object_type = "Mesh"


class ExtractVolume(bpy.types.Operator, ExtractObject):
bl_idname = "bioxelnodes.extract_volume"
bl_label = "Extract Volume"
bl_description = "Extract Volume"
bl_icon = "OUTLINER_OB_VOLUME"
object_type = "Volume"


class ExtractShapeWire(bpy.types.Operator, ExtractObject):
bl_idname = "bioxelnodes.extract_shape_wire"
bl_label = "Extract Shape Wire"
Expand Down

0 comments on commit 0ebc6da

Please sign in to comment.