Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random_points_on_mesh_ui_fix #4001

Merged
merged 1 commit into from
Mar 30, 2021
Merged
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
15 changes: 11 additions & 4 deletions nodes/spatial/random_points_on_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,10 @@ class SvRandomPointsOnMesh(bpy.types.Node, SverchCustomTreeNode):
@throttle_and_update_node
def update_sockets(self, context):
self.outputs['Face index'].hide_safe = self.mode == 'VOLUME'
self.outputs[1].label = 'Face index' if self.mode == 'SURFACE' else 'Edge index'
self.inputs[1].label = 'Faces' if self.mode == 'SURFACE' else 'Edges'
self.inputs[2].label = 'Faces Weight' if self.mode == 'SURFACE' else 'Edges Weight'
self.inputs['Face weight'].hide_safe = self.mode == 'VOLUME'
self.outputs[1].label = 'Edge index' if self.mode == 'EDGES' else 'Face index'
self.inputs[1].label = 'Edges' if self.mode == 'EDGES' else 'Faces'
self.inputs[2].label = 'Edge Weight' if self.mode == 'EDGES' else 'Face Weight'

modes = [('SURFACE', "Surface", "Surface", 0),
('VOLUME', "Volume", "Volume", 1),
Expand Down Expand Up @@ -425,7 +426,13 @@ def rclick_menu(self, context, layout):
layout.label(text='Output Numpy')
layout.prop(self, "out_np", index=0, text='Verts')
layout.prop(self, "out_np", index=1, text='Face index')

elif self.mode == 'EDGES':
layout.prop(self, "proportional")
layout.label(text='Output Numpy')
layout.prop(self, "out_np", index=0, text='Verts')
layout.prop(self, "out_np", index=1, text='Edge index')
else:
layout.prop(self, "all_triangles")

def sv_init(self, context):
[self.inputs.new(p.socket_type, p.name) for p in INPUT_CONFIG]
Expand Down