Closed portnov closed 3 years ago
Seems very powerful, allows a not nodal behaviour in a nodal environment... also seems a bit confusing.. How did you create the "Center" item in the Center column? Anyhow we have a Dictionary Category in the menu with only two nodes so it wouldn't harm to have more... so I would say yes to bringing this functionalities to Sverchok
Columns are configured in the N panel:
When I was testing dictionaries I did not like node tree results they was too noddy. Data items
nodes would definitely improve the situation but I think it will still require too much work of creating and linking nodes. Optimal solution could be create sockets right in nodes which should process the data.
Example how this could look like.
Well, the problem I tried to address is the following. I noted that every non-trivial node tree consists of the following blocks:
In my trees, the most complex, most "noddy" parts are 1 and 2, there are a lot of links between nodes there also. So I thought maybe it is possible to place such inputs and calculations into several spreadsheets. I did not manage to develop a good workflow, how should one usually use spreadsheets to replace or simplify parts 1 or 2. It is obviously possible, but I'm not sure how to do it in the best way.
Just made an example how this could be simplified with node groups. It does not cover all functionality.
An example of what I'm talking about.
Here I marked geometry generators with green color, and "geometry modifiers" (like booleans and so on) are yellow. There are 10 input nodes framed in the left part. Collapsed nodes are instances of "scalar math", "vector in" and so on. As you can see there is a lot of them, and they create a mess of node links. If we could somehow simplify such setups it would be good.
One technology that Sverchok already has for it is "wifi nodes", they can help to make more clean layouts. I even have a draft of code somewhere that helps to create such nodes faster...
I'm quite suspicious about wifi nodes. How all output wifi nodes can be identified in a tree? If there are hundreds of nodes in a tree it will be quite difficult task.With links there is no such problem.
Also it is not necessary to place all A number
nodes in left side of the tree. It is possible to combine them in 3D panel where they can be easily organized.
Yep, it's not necessary, just looks better (imho). Btw, maybe it worth to show the same panel in the N panel of node editor? Maybe even with option: to display all input nodes or just those marked with "to_3d".
Why not but renaming should be done in this case I think. The panel should be renamed to something like Properties set
and property should be named to prop set
. But it can't be done easily because 3d panel shows properties of all trees but in N panel most likely we would like to have properties only current tree.
to 3d
is shortest and informative name. maybe to 3d panel
, but not set. set() множество. What set? What to 3d?
to 3d panel
more clear
no conditions? to formula?
do you have exec
function after compile
?
if formula and isinstance(formula, str):
result[row_name][col_name] = sv_compile(formula)
return result
It understands expressions only, not statements. You can do 5 if condition else 3
, but not if condition: statement else: ..
.
See https://docs.python.org/3/reference/expressions.html .
i see now
@vkter for now, it is in sverchok-extra addon :)
I'm not sure how exactly useful these things are, so at the moment I've put them to sverchok-extra master. These nodes do not require any dependencies; they can be easily moved to Sverchok, the only question is do we need them.
"Data Item" node.
This is similar to
dictionary Out" node, but adopted to work with nested dictionaries. In node UI you select a "path" in the nested dictionary, and the node outputs the item. For example, you can calculate something like
my_dict['Boxes']['MyBox']['Width']`.Or, for one (not more than one) of the nested keys you can say "All keys", this will be something like
my_dict[*]['Width']
ormy_dict['Box1'][*]
:"Spreadsheet" node.
This is more cumbersome. It allows you to input data in spreadsheet-like interface. Each row ("item") has user-provided name, and each column also. Columns to be used are configured in the N panel of the node. Supported types of columns are: integer, float, vector, boolean, string and formula. Most interesting is, off course,
formula
. It gives a possibility to do calculations in a way similar to LibreOffice or Excel (without aggregation functions). Python syntax is used, as usual in Sverchok. You can refer to other cells of the same spreadsheet asRowName.ColumnName
. You can refer to other columns of the same row just asColumnName
. Special input socket namedInput
is supported for nested dictionaries input (e.g. you can plug another spreadsheet here); you can refer to items of that dictionary asInput.RowName.ColumnName
. Any other variables (apart from well-known functions such assin
orpi
) will automatically become additional inputs of the Spreadsheet node.The node can output data in several ways:
Data
output for nested dictionary,Rows
output for RowName -> List of values in this row, andColumns
for ColumnName -> List of values in that column.