@@ -881,7 +881,7 @@ def set_acyclic(self, mode=False):
881881 mode (bool): true to enable acyclic.
882882 """
883883 self ._model .acyclic = mode
884- self ._viewer .acyclic = mode
884+ self ._viewer .acyclic = self . _model . acyclic
885885
886886 def pipe_collision (self ):
887887 """
@@ -910,7 +910,39 @@ def set_pipe_collision(self, mode=True):
910910 mode (bool): False to disable pipe collision.
911911 """
912912 self ._model .pipe_collision = mode
913- self ._viewer .pipe_collision = mode
913+ self ._viewer .pipe_collision = self ._model .pipe_collision
914+
915+ def pipe_slicing (self ):
916+ """
917+ Returns if pipe slicing is enabled.
918+
919+ See Also:
920+ To enable/disable pipe slicer
921+ :meth:`NodeGraph.set_pipe_slicing`
922+
923+ Returns:
924+ bool: True if pipe slicing is enabled.
925+ """
926+ return self ._model .pipe_collision
927+
928+ def set_pipe_slicing (self , mode = True ):
929+ """
930+ Enable/Disable pipe slicer.
931+
932+ When set to true holding down `Alt + Shift + LMB Drag` will allow node
933+ pipe connections to be sliced.
934+
935+ .. image:: _images/slicer.png
936+ :width: 400px
937+
938+ See Also:
939+ :meth:`NodeGraph.pipe_slicing`
940+
941+ Args:
942+ mode (bool): False to disable the slicer pipe.
943+ """
944+ self ._model .pipe_slicing = mode
945+ self ._viewer .pipe_slicing = self ._model .pipe_slicing
914946
915947 def set_pipe_style (self , style = PipeLayoutEnum .CURVED .value ):
916948 """
@@ -1466,6 +1498,7 @@ def _serialize(self, nodes):
14661498 # serialize graph session.
14671499 serial_data ['graph' ]['acyclic' ] = self .acyclic ()
14681500 serial_data ['graph' ]['pipe_collision' ] = self .pipe_collision ()
1501+ serial_data ['graph' ]['pipe_slicing' ] = self .pipe_slicing ()
14691502
14701503 # serialize nodes.
14711504 for n in nodes :
@@ -1526,6 +1559,8 @@ def _deserialize(self, data, relative_pos=False, pos=None):
15261559 self .set_acyclic (attr_value )
15271560 elif attr_name == 'pipe_collision' :
15281561 self .set_pipe_collision (attr_value )
1562+ elif attr_name == 'pipe_slicing' :
1563+ self .set_pipe_slicing (attr_value )
15291564
15301565 # build the nodes.
15311566 nodes = {}
0 commit comments