Skip to content

Commit

Permalink
Blend Surface: adjust parameters.
Browse files Browse the repository at this point in the history
hide "absolute bulge" flag for now. Use it for G1 mode for
compatibility.
  • Loading branch information
portnov committed Aug 31, 2024
1 parent 3cb3c32 commit 44e75d0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions nodes/surface/blend_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def update_sockets(self, context):
ortho_mode : EnumProperty(
name = "Ortho mode",
items = ortho_modes,
default = '3D',
default = '3D', # default for pre-existing nodes
update = updateNode)

def draw_buttons(self, context, layout):
Expand All @@ -126,12 +126,12 @@ def draw_buttons(self, context, layout):
box = layout.row(align=True)
box.prop(self, 'curve2_mode', text='')
box.prop(self, 'flip2', toggle=True, text='Flip')
layout.prop(self, 'ortho_mode')
layout.prop(self, 'use_nurbs')

def draw_buttons_ext(self, context, layout):
self.draw_buttons(context, layout)
layout.prop(self, 'absolute_bulge')
layout.prop(self, 'ortho_mode')
#layout.prop(self, 'absolute_bulge')

def sv_init(self, context):
self.inputs.new('SvSurfaceSocket', 'Surface1')
Expand All @@ -142,6 +142,7 @@ def sv_init(self, context):
self.inputs.new('SvStringsSocket', 'Bulge2').prop_name = 'bulge2'
self.inputs.new('SvStringsSocket', 'Samples').prop_name = 'samples'
self.outputs.new('SvSurfaceSocket', 'Surface')
self.ortho_mode = 'UV' # default for new nodes
self.update_sockets(context)

def make_uv_curve(self, surface, mode, flip):
Expand Down Expand Up @@ -193,6 +194,8 @@ def process(self):
bulge2_s = ensure_nesting_level(bulge2_s, 2)
samples_s = ensure_nesting_level(samples_s, 2)

absolute_bulge = (self.tangency_mode == SvBlendSurface.G1)

surfaces_out = []
for params in zip_long_repeat(surface1_s, uv_curve1_s, bulge1_s, surface2_s, uv_curve2_s, bulge2_s, samples_s):
new_surfaces = []
Expand All @@ -208,13 +211,13 @@ def process(self):

if self.use_nurbs:
surface = nurbs_blend_surfaces(surface1, surface2, curve1, curve2, bulge1, bulge2, 3, samples,
absolute_bulge = self.absolute_bulge,
absolute_bulge = absolute_bulge,
tangency = self.tangency_mode,
ortho_mode = self.ortho_mode,
logger = self.get_logger())
else:
surface = SvBlendSurface(surface1, surface2, curve1, curve2, bulge1, bulge2,
absolute_bulge = self.absolute_bulge,
absolute_bulge = absolute_bulge,
tangency = self.tangency_mode,
ortho_mode = self.ortho_mode)
new_surfaces.append(surface)
Expand Down

0 comments on commit 44e75d0

Please sign in to comment.