[WIP] Sverchok, parametric nodes for architects

add-ons

(nikitron) #2161

your mesh tooooooooooo dense. try optimize it before inserting to sverchok. Anyway you can use slow case of it:
normals.blend (3.2 MB)


(kabu) #2162

Tx very much. Didn’t know about vector sort…


(kabu) #2163

Hello there
I’m trying to create a simple mute node, for selectively blocking geom data:

The rationale is to click a button in the T section and “remove” a piece of geometry from building. I’ve used a scripted node; the code is very simple, as you can see:

mute_node.py

def sv_main(mute=False,verts=[],polys=[]):

    in_sockets = [
        ['s', 'mute',  mute],
        ['v', 'verts',  verts],
        ['s', 'polys',  polys]
    ]

    from math import sin, cos, radians, pi, sqrt
    from mathutils import Vector, Euler
    import bpy
    
    print("Mute:",mute)

    if mute:
        verts=[]
        polys=[]

    out_sockets = [
        ['v', 'verts', [verts]],
        ['s', 'polys', [polys]]
    ]

    return in_sockets, out_sockets

Now when I activate it, I receive an error from mesh join:

Node Mesh Join had exception: can only concatenate tuple (not "int") to tuple
Traceback (most recent call last):
  File "/Users/max/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/core/update_system.py", line 325, in do_update_general
    node.process()
  File "/Users/max/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/nodes/modifier_change/mesh_join.py", line 47, in process
    verts_out, _, poly_edge_out = mesh_join(verts, [], poly_edge)
  File "/Users/max/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_mesh_utils.py", line 32, in mesh_join
    new_faces = [[i + offset for i in face] for face in faces]
  File "/Users/max/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_mesh_utils.py", line 32, in <listcomp>
    new_faces = [[i + offset for i in face] for face in faces]
  File "/Users/max/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_mesh_utils.py", line 32, in <listcomp>
    new_faces = [[i + offset for i in face] for face in faces]
TypeError: can only concatenate tuple (not "int") to tuple

It looks like I’m not wrapping data correctly. How can I do?
Thank you


(randum) #2164

You had gotten too much levels of nested data. Data structure of Sverchok looks so:

[object_1: 
    [vector_1: [f0,f1,f2], 
     vector_2: [f0,f1,f2], 
     vector_n...],
 object_2: 
    [vector_1: [f0,f1,f2], 
     vector_2: [f0,f1,f2], 
     vector_n...],
object_n....]

So your code can look like this:

if mute:
        verts=[[]]
        polys=[[]]

    out_sockets = [
        ['v', 'verts', verts],
        ['s', 'polys', polys]
    ]

(kabu) #2165

Thank you. I removed the list on verts and polys and now it works:

def sv_main(thru=0,verts=[],polys=[]):

    in_sockets = [
        ['s', 'thru',  thru],
        ['v', 'verts',  verts],
        ['s', 'polys',  polys]
    ]

    import bpy
    
    if not thru:
        verts=[]
        polys=[]

    out_sockets = [
        ['v', 'verts', verts],
        ['s', 'polys', polys]
    ]

    return in_sockets, out_sockets

(kabu) #2166

Hello there
I have two object I’d like to join. That is:

I’d like to join them something in the way of bridge edge loop, so that the missing geometry is created. Is that possible in Sverchok? I’ve tried this but of course it doesn’t work…

Thank you


(randum) #2167

I think it is possible to have different approaches to solve your problem. One of them is using UV Connection node but it can be a little bit complicated. Another way is using remove doubles node. In this case you have to have a meshes with equal resolution for good result.

May can you told what you are doing in general? It will be easier to find best solution.

UV bridge.blend (527.5 KB)


(kabu) #2168

Here it is.

CurveObjectsInVectorLerpPolylineViewer_LongHandle15.blend.zip (1.4 MB)

UV Connection can be a way, but that’s a convoluted way… is there a way to analyze the mesh for feature finding the tips?


(randum) #2169

What can you say about this?

handle.blend (537.7 KB)


(kabu) #2170

:smile::cat::stuck_out_tongue_closed_eyes::bowl_with_spoon::stew::chestnut::fries::fries::fries::fries::pizza::pizza::weight_lifting_woman::surfing_man::haircut_woman::massage_man::woman_cartwheeling::biking_woman::biking_woman::rhinoceros::pig::ram::dromedary_camel::cow::cow::tiger2::cat::cat2::smile::cat::stuck_out_tongue_closed_eyes::bowl_with_spoon::stew::chestnut::fries::fries::fries::fries::pizza::pizza::weight_lifting_woman::surfing_man::haircut_woman::massage_man::woman_cartwheeling::biking_woman::biking_woman::rhinoceros::pig::ram::dromedary_camel::cow::cow::tiger2::cat::cat2::smile::cat::stuck_out_tongue_closed_eyes::bowl_with_spoon::stew::chestnut::fries::fries::fries::fries::pizza::pizza::weight_lifting_woman::surfing_man::haircut_woman::massage_man::woman_cartwheeling::biking_woman::biking_woman::rhinoceros::pig::ram::dromedary_camel::cow::cow::tiger2::cat::cat2::smile::cat::stuck_out_tongue_closed_eyes::bowl_with_spoon::stew::chestnut::fries::fries::fries::fries::pizza::pizza::weight_lifting_woman::surfing_man::haircut_woman::massage_man::woman_cartwheeling::biking_woman::biking_woman::rhinoceros::pig::ram::dromedary_camel::cow::cow::tiger2::cat::cat2::smile::cat::stuck_out_tongue_closed_eyes::bowl_with_spoon::stew::chestnut::fries::fries::fries::fries::pizza::pizza::weight_lifting_woman::surfing_man::haircut_woman::massage_man::woman_cartwheeling::biking_woman::biking_woman::rhinoceros::pig::ram::dromedary_camel::cow::cow::tiger2::cat::cat2::smile::cat::stuck_out_tongue_closed_eyes::bowl_with_spoon::stew::chestnut::fries::fries::fries::fries::pizza::pizza::weight_lifting_woman::surfing_man::haircut_woman::massage_man::woman_cartwheeling::biking_woman::biking_woman::rhinoceros::pig::ram:
Yay!!!
I had to upgrade! Didn’t know about curve input!
This is exactly was I’ve been trying to achieve! Great!
By the way, what’s that draw_override_complex?


(randum) #2171

It is simple node that takes x coordinate and gives y according its curve.


(kabu) #2172

I see. Thank you


(Rence) #2173

Hi guys,

I absolutely love Sverchok. The possibilities really come down to the users imagination and creativity.
Something I have noticed is that the idea of the nodes working from left to right can get quite messy. Even with reroute nodes, the node lines get quite cluttered. Has the idea of working top to bottom, like in Nuke or Natron or Houdini been looked at? Is there a reason this approach wasn’t used? I think all of Blender’s nodes should work this way, but just thought I’d ask here about Sverchok.


(nikitron) #2174

You are right. But sverchok is just plugin for blender, blender nodes is generally constant. afraid, that nobody will remake vertical noding.
Maybe this can happened in far future if enthusiast will write that approach in code.


(Rence) #2175

One more thing :slight_smile: I posted on Github bug tracker but will post it here as well.

Problem statement

I have a node tree, with a Set Property node that is referencing the Size parameter of a Line MK2 node.
When I group the entire node tree the Set Property node doesn’t seem to communicate with the Size parameter anymore. So I jumped into the group and realised the code needed to be changed to the new node group name, but still, it doesn’t seem to be linked anymore. I even deleted the Set Property node and created a new one in the group hoping that would work, but it didn’t.

Steps to reproduce

  1. Create a Line MK2 node and connect it to a Viewer Draw node. Enable Center and Normalize on the Line MK2 node.
  2. Create a Set Property node and link it to the Size parameter. Would look something like this -
    bpy.data.node_groups[“NodeTree”].nodes[“Line MK2”].size
  3. Group the Set Property and the Line MK2 node and connect the Set Property to the Group Input node.
  4. When you go back now and try drag the parameter on the group nothing happens.
  5. Jump back into the group and change the code from [“NodeTree”] to [“Monad”] to reference the new node group.
  6. Jump back out of the group and it still doesn’t work.

Expected result

You should still be able to control the parameter.

Actual result

The link is broken and you can no longer control the property.

Sverchok version

SV 0.5.9.6 (300a895)


(kkar) #2176

Will this addon work with 2.8?


(randum) #2177

Yep


(kkar) #2178

Beast. thanks


(kkar) #2179

I am looking for a way to mesh point clouds, any good solutions inside Sverchok?


(unkerjay) #2180

I’m curious. Jacques Lucke is working on “Everything Nodes” for Blender. What will “Everything” entail?

Is Sverchok a part of that or no?