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

Branch update json_examples/** node names #4620

Merged
merged 9 commits into from
Aug 29, 2022
Merged

Branch update json_examples/** node names #4620

merged 9 commits into from
Aug 29, 2022

Conversation

satabol
Copy link
Collaborator

@satabol satabol commented Aug 24, 2022

Addressed problem description

  1. Update nodes names:
    Make monotone -> Make Monotone
    Delaunay 2D Cdt (Random points on mesh) -> Delaunay 2D Cdt // This is a triangulation
    Align mesh by mesh -> Align Mesh by Mesh

  2. Update Node Names and Tests of json_examples. Some examples has errors. I don't know - is it old examples or my mistakes? I think that error nodes are too old but may be I'm wrong. Please check me?

== Advanced ==============================

sverchok\json_examples\Advanced\Candy.json - good
sverchok\json_examples\Advanced\Circle_fitting_physics.json - good
sverchok\json_examples\Advanced\Genetic_algorithm_scripted_node.json - good
sverchok\json_examples\Advanced\Genetic_algorithm_simple.json - good
sverchok\json_examples\Advanced\Grain.json - good

sverchok\json_examples\Advanced\Open4d_mesh.json - errors
Looking for GlslTexture
2022-08-24 17:45:54,832 [WARNING] sverchok.utils.sv_json_import 317: During import next fails has happened:
FAIL: Init node (main tree) - 10
FAIL: Build link (main tree) - 18
2022-08-24 17:45:54,835 [ERROR] sverchok.core.update_system 399: 'NodeSocket' object has no attribute 'sv_forget'

sverchok\json_examples\Advanced\Petri_Spiral_Voronoi.json - good
sverchok\json_examples\Advanced\PointsONmeshINlines.json - good
sverchok\json_examples\Advanced\Pineapple.zip.json - good

================================================================

sverchok\json_examples\Architecture\BIM_ArchiCAD24_import.json - errors
[ERROR] sverchok.nodes.script.script1_lite:491 : No module named 'archicad'
(I have no archicad)

sverchok\json_examples\Architecture\BIM_FreeCAD_import.json - errors
Looking for GlslTexture
2022-08-24 17:49:18,689 [INFO] sverchok.utils.sv_json_import 320: Import done with no fails
2022-08-24 17:49:18,691 [INFO] sverchok.nodes.exchange.FCStd_read 230: FCStd read error
2022-08-24 17:49:18,691 [ERROR] sverchok.nodes.exchange.FCStd_read:233 : local variable 'doc' referenced before assignment
(I do not undestand what it means? I have freeCad library installed and have a menu too)

sverchok\json_examples\Architecture\BIM_truss_joint.json - errors
FAIL: Setting advance node properties - 3
2022-08-24 17:50:18,313 [INFO] sverchok.nodes.script.script1_lite 361 (SN: shader2): hash invalidated
2022-08-24 17:50:18,314 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader2): (None, None, None, None), 0, was unparsable
2022-08-24 17:50:18,316 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader2): failed to load sockets for inputs
2022-08-24 17:50:18,317 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader2): (None, None, None, None), 0, was unparsable
2022-08-24 17:50:18,319 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader2): failed to load sockets for inputs
2022-08-24 17:50:18,319 [ERROR] sverchok.nodes.script.script1_lite:367 : 'NoneType' object is not subscriptable
2022-08-24 17:50:18,322 [INFO] sverchok.nodes.script.script1_lite 361 (SN: shader3): hash invalidated
2022-08-24 17:50:18,323 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader3): (None, None, None, None), 0, was unparsable
2022-08-24 17:50:18,325 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader3): failed to load sockets for inputs
2022-08-24 17:50:18,326 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader3): (None, None, None, None), 0, was unparsable
2022-08-24 17:50:18,327 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader3): failed to load sockets for inputs
2022-08-24 17:50:18,328 [ERROR] sverchok.nodes.script.script1_lite:367 : 'NoneType' object is not subscriptable
2022-08-24 17:50:18,329 [INFO] sverchok.nodes.script.script1_lite 361 (SN: shader): hash invalidated
2022-08-24 17:50:18,330 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader): (None, None, None, None), 0, was unparsable
2022-08-24 17:50:18,332 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader): failed to load sockets for inputs
2022-08-24 17:50:18,333 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader): (None, None, None, None), 0, was unparsable
2022-08-24 17:50:18,334 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader): failed to load sockets for inputs
2022-08-24 17:50:18,335 [ERROR] sverchok.nodes.script.script1_lite:367 : 'NoneType' object is not subscriptable
(I try to correct Shaders but unsuccessfully)

sverchok\json_examples\Architecture\Coliseum.json - good
sverchok\json_examples\Architecture\Curved_Hexagonal_Truss.json - good
sverchok\json_examples\Architecture\Fasade_Complicated.json - good

sverchok\json_examples\Architecture\Power_transmission_tower.json - errors
Looking for GlslTexture
2022-08-24 17:54:02,098 [INFO] sverchok.utils.sv_json_import 320: Import done with no fails
2022-08-24 17:54:02,350 [ERROR] sverchok.utils.sv_bmesh_utils:108 : edges.get(...): found the same (BMVert) used multiple times
(I try understand exception but unsuccessfully)

sverchok\json_examples\Architecture\ProfileBuilding.json - good
sverchok\json_examples\Architecture\Tensile_Cover.json - good

== CNC ========================

sverchok\json_examples\CNC\CNC_Bench.json - good
sverchok\json_examples\CNC\CNC_CUTHOLES_RESIZE.json - good
sverchok\json_examples\CNC\CNC_GCODE.json - good
sverchok\json_examples\CNC\CNC_K40Whisperer_Laser.json - good
sverchok\json_examples\CNC\CNC_PANNO.json - good
sverchok\json_examples\CNC\CNC_SVG_A4.json - good
sverchok\json_examples\CNC\CNC_Waffle.json - good

== Design =============================

sverchok\json_examples\Design\Adaptive_per_face.json - good
sverchok\json_examples\Design\Adaptive_Voronoi_panel.json - good
sverchok\json_examples\Design\Color_Lights.json - good
sverchok\json_examples\Design\Inset_Hexagonal_Grid.json - good
sverchok\json_examples\Design\KDT_short_path.json - good
sverchok\json_examples\Design\rigid_origami.json - good
sverchok\json_examples\Design\Twisted_square_origami.json - good
sverchok\json_examples\Design\Twisted_square_origami.json - good
sverchok\json_examples\Design\Water_bomb_origami_tessellation_namako.json - good
sverchok\json_examples\Design\Water_bomb_origami_tessellation_square.json - good

== Fields ===================================

sverchok\json_examples\Fields\Mesh_Attractor.json - good
sverchok\json_examples\Fields\Noise_by_Attractor.json - good
sverchok\json_examples\Fields\Projection_Decomposition.json - good
sverchok\json_examples\Fields\Random_Voronoi.json - good
sverchok\json_examples\Fields\RBF_lines.json - good

== Introduction ====================================

sverchok\json_examples\Introduction\ABCnaming.json - good
sverchok\json_examples\Introduction\Adaptive_Spread.json - good
sverchok\json_examples\Introduction\BentTorus.json - good
sverchok\json_examples\Introduction\Circle_Generator.json - good
sverchok\json_examples\Introduction\Donut_by_hands.json - good
sverchok\json_examples\Introduction\Interpolations.json - good
sverchok\json_examples\Introduction\List_multymasking.json - good
sverchok\json_examples\Introduction\Orientation_matrix_track_to.json - good
sverchok\json_examples\Introduction\Polar_coordinates_curve.json - good
sverchok\json_examples\Introduction\Voronoi_Trick.json - good

== Shapes =====================================

sverchok\json_examples\Shapes\Bend_bricks_grid_to_sphere.json - good
sverchok\json_examples\Shapes\Blender_logo.json - good
sverchok\json_examples\Shapes\Buddha_Lotus.json - good
sverchok\json_examples\Shapes\Concave_sverchok.json - good
sverchok\json_examples\Shapes\Donut.json - good
sverchok\json_examples\Shapes\Holes_in_cone.json - good
sverchok\json_examples\Shapes\InsetDodecahedron.json - good

sverchok\json_examples\Shapes\Keyboard_key_profile.json - errors
[ERROR] sverchok.utils.modules.polygon_utils:206 : index 2 is out of bounds for axis 1 with size 2

sverchok\json_examples\Shapes\Petal.json - good

sverchok\json_examples\Shapes\Sofa_Pillow.json - errors
[ERROR] sverchok.nodes.vector.attractor:114 : 'inverse_cubic'

sverchok\json_examples\Shapes\Sphere_stripes.json - good
sverchok\json_examples\Shapes\Spherical_Sverchok_in_vacuum.json - good
sverchok\json_examples\Shapes\SverchokLogo.json - good
sverchok\json_examples\Shapes\Tie_revange_2020.json - good

== Surfaces ================================================

sverchok\json_examples\Surfaces\Spiral.json - good
sverchok\json_examples\Surfaces\Tower.json - good

Solution description

Many nodes are good but some nodes contains errors.

Are some errors are expected?

    Make monotone -> Make Monotone
    Delaunay 2D Cdt (Random points on mesh) -> Delaunay 2D Cdt  // This is a triangulation
    Align mesh by mesh -> Align Mesh by Mesh

- Tests of json_examples

== Advanced ==============================

sverchok\json_examples\Advanced\Candy.json - good
sverchok\json_examples\Advanced\Circle_fitting_physics.json - good
sverchok\json_examples\Advanced\Genetic_algorithm_scripted_node.json - good
sverchok\json_examples\Advanced\Genetic_algorithm_simple.json - good
sverchok\json_examples\Advanced\Grain.json - good

sverchok\json_examples\Advanced\Open4d_mesh.json - errors
		Looking for GlslTexture
		2022-08-24 17:45:54,832 [WARNING] sverchok.utils.sv_json_import 317: During import next fails has happened:
		FAIL: Init node (main tree) - 10
		FAIL: Build link (main tree) - 18
		2022-08-24 17:45:54,835 [ERROR] sverchok.core.update_system 399: 'NodeSocket' object has no attribute 'sv_forget'

sverchok\json_examples\Advanced\Petri_Spiral_Voronoi.json - good
sverchok\json_examples\Advanced\PointsONmeshINlines.json - good
sverchok\json_examples\Advanced\Pineapple.zip.json - good

================================================================

sverchok\json_examples\Architecture\BIM_ArchiCAD24_import.json - errors
		[ERROR] sverchok.nodes.script.script1_lite:491 : No module named 'archicad'

sverchok\json_examples\Architecture\BIM_FreeCAD_import.json - errors
		Looking for GlslTexture
		2022-08-24 17:49:18,689 [INFO] sverchok.utils.sv_json_import 320: Import done with no fails
		2022-08-24 17:49:18,691 [INFO] sverchok.nodes.exchange.FCStd_read 230: FCStd read error
		2022-08-24 17:49:18,691 [ERROR] sverchok.nodes.exchange.FCStd_read:233 : local variable 'doc' referenced before assignment

sverchok\json_examples\Architecture\BIM_truss_joint.json - errors
		FAIL: Setting advance node properties - 3
		2022-08-24 17:50:18,313 [INFO] sverchok.nodes.script.script1_lite 361 (SN: shader2): hash invalidated
		2022-08-24 17:50:18,314 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader2): (None, None, None, None), 0, was unparsable
		2022-08-24 17:50:18,316 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader2): failed to load sockets for inputs
		2022-08-24 17:50:18,317 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader2): (None, None, None, None), 0, was unparsable
		2022-08-24 17:50:18,319 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader2): failed to load sockets for inputs
		2022-08-24 17:50:18,319 [ERROR] sverchok.nodes.script.script1_lite:367 : 'NoneType' object is not subscriptable
		2022-08-24 17:50:18,322 [INFO] sverchok.nodes.script.script1_lite 361 (SN: shader3): hash invalidated
		2022-08-24 17:50:18,323 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader3): (None, None, None, None), 0, was unparsable
		2022-08-24 17:50:18,325 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader3): failed to load sockets for inputs
		2022-08-24 17:50:18,326 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader3): (None, None, None, None), 0, was unparsable
		2022-08-24 17:50:18,327 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader3): failed to load sockets for inputs
		2022-08-24 17:50:18,328 [ERROR] sverchok.nodes.script.script1_lite:367 : 'NoneType' object is not subscriptable
		2022-08-24 17:50:18,329 [INFO] sverchok.nodes.script.script1_lite 361 (SN: shader): hash invalidated
		2022-08-24 17:50:18,330 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader): (None, None, None, None), 0, was unparsable
		2022-08-24 17:50:18,332 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader): failed to load sockets for inputs
		2022-08-24 17:50:18,333 [INFO] sverchok.nodes.script.script1_lite 244 (SN: shader): (None, None, None, None), 0, was unparsable
		2022-08-24 17:50:18,334 [INFO] sverchok.nodes.script.script1_lite 303 (SN: shader): failed to load sockets for inputs
		2022-08-24 17:50:18,335 [ERROR] sverchok.nodes.script.script1_lite:367 : 'NoneType' object is not subscriptable

sverchok\json_examples\Architecture\Coliseum.json - good
sverchok\json_examples\Architecture\Curved_Hexagonal_Truss.json - good
sverchok\json_examples\Architecture\Fasade_Complicated.json - good

sverchok\json_examples\Architecture\Power_transmission_tower.json - errors
		Looking for GlslTexture
		2022-08-24 17:54:02,098 [INFO] sverchok.utils.sv_json_import 320: Import done with no fails
		2022-08-24 17:54:02,350 [ERROR] sverchok.utils.sv_bmesh_utils:108 : edges.get(...): found the same (BMVert) used multiple times

sverchok\json_examples\Architecture\ProfileBuilding.json - good
sverchok\json_examples\Architecture\Tensile_Cover.json - good

== CNC ========================

sverchok\json_examples\CNC\CNC_Bench.json - good
sverchok\json_examples\CNC\CNC_CUTHOLES_RESIZE.json - good
sverchok\json_examples\CNC\CNC_GCODE.json - good
sverchok\json_examples\CNC\CNC_K40Whisperer_Laser.json - good
sverchok\json_examples\CNC\CNC_PANNO.json - good
sverchok\json_examples\CNC\CNC_SVG_A4.json - good
sverchok\json_examples\CNC\CNC_Waffle.json - good

== Design =============================

sverchok\json_examples\Design\Adaptive_per_face.json - good
sverchok\json_examples\Design\Adaptive_Voronoi_panel.json - good
sverchok\json_examples\Design\Color_Lights.json - good
sverchok\json_examples\Design\Inset_Hexagonal_Grid.json - good
sverchok\json_examples\Design\KDT_short_path.json - good
sverchok\json_examples\Design\rigid_origami.json - good
sverchok\json_examples\Design\Twisted_square_origami.json - good
sverchok\json_examples\Design\Twisted_square_origami.json - good
sverchok\json_examples\Design\Water_bomb_origami_tessellation_namako.json - good
sverchok\json_examples\Design\Water_bomb_origami_tessellation_square.json - good

== Fields ===================================

sverchok\json_examples\Fields\Mesh_Attractor.json - good
sverchok\json_examples\Fields\Noise_by_Attractor.json - good
sverchok\json_examples\Fields\Projection_Decomposition.json - good
sverchok\json_examples\Fields\Random_Voronoi.json - good
sverchok\json_examples\Fields\RBF_lines.json - good

== Introduction ====================================

sverchok\json_examples\Introduction\ABCnaming.json - good
sverchok\json_examples\Introduction\Adaptive_Spread.json - good
sverchok\json_examples\Introduction\BentTorus.json - good
sverchok\json_examples\Introduction\Circle_Generator.json - good
sverchok\json_examples\Introduction\Donut_by_hands.json - good
sverchok\json_examples\Introduction\Interpolations.json - good
sverchok\json_examples\Introduction\List_multymasking.json - good
sverchok\json_examples\Introduction\Orientation_matrix_track_to.json - good
sverchok\json_examples\Introduction\Polar_coordinates_curve.json - good
sverchok\json_examples\Introduction\Voronoi_Trick.json - good

== Shapes =====================================

sverchok\json_examples\Shapes\Bend_bricks_grid_to_sphere.json - good
sverchok\json_examples\Shapes\Blender_logo.json - good
sverchok\json_examples\Shapes\Buddha_Lotus.json - good
sverchok\json_examples\Shapes\Concave_sverchok.json - good
sverchok\json_examples\Shapes\Donut.json - good
sverchok\json_examples\Shapes\Holes_in_cone.json - good
sverchok\json_examples\Shapes\InsetDodecahedron.json - good

sverchok\json_examples\Shapes\Keyboard_key_profile.json - errors
	[ERROR] sverchok.utils.modules.polygon_utils:206 : index 2 is out of bounds for axis 1 with size 2

sverchok\json_examples\Shapes\Petal.json - good

sverchok\json_examples\Shapes\Sofa_Pillow.json - errors
	[ERROR] sverchok.nodes.vector.attractor:114 : 'inverse_cubic'

sverchok\json_examples\Shapes\Sphere_stripes.json - good
sverchok\json_examples\Shapes\Spherical_Sverchok_in_vacuum.json - good
sverchok\json_examples\Shapes\SverchokLogo.json - good
sverchok\json_examples\Shapes\Tie_revange_2020.json - good

== Surfaces ================================================

sverchok\json_examples\Surfaces\Spiral.json - good
sverchok\json_examples\Surfaces\Tower.json - good
@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

some .json are excluded from our tests for a variety of reasons. (dependencies, and Blender datablocks not being cleared in-between tests). Generally the examples will load fine for the user in non-test real world sane circumstances.

do what you can with the least resistance, and then maybe make a short list of the ones you had problems with. i'll have a look at those (if you want..)

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

The test-suite should be able to clear previously loaded blender data in-between each .json it loads. Doing this has not been a priority.

@satabol
Copy link
Collaborator Author

satabol commented Aug 25, 2022

do what you can with the least resistance, and then maybe make a short list of the ones you had problems with. i'll have a look at those (if you want..)

I try next tests with a “new file” in blender and got errors.

sverchok\json_examples\Advanced\Open4d_mesh.json - errors
sverchok\json_examples\Architecture\BIM_ArchiCAD24_import.json - errors good
sverchok\json_examples\Architecture\BIM_FreeCAD_import.json - errors good. Open file in [freecad root folder]\data\examples\ArchDetail.FCStd
sverchok\json_examples\Architecture\BIM_truss_joint.json - errors
sverchok\json_examples\Architecture\Power_transmission_tower.json - errors fixed
sverchok\json_examples\Shapes\Keyboard_key_profile.json - errors fixed
sverchok\json_examples\Shapes\Sofa_Pillow.json - errors fixed

@zeffii, Can you look at those tests?

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

@satabol sure. But I may not feel compelled to stick much time into this in the short term. I'll keep adding responses when I find time.

Advanced\Open4d_mesh.json

2022-08-25 17:07:41,185 [ERROR] sverchok.core.update_system 399: 'NodeSocket' object has no attribute 'sv_forget'
2022-08-25 17:09:08,468 [ERROR] sverchok.core.socket_data:196 : No data passed into socket 'Vertices'
2022-08-25 17:09:08,566 [ERROR] sverchok.nodes.list_struct.item:76 : 'NodeSocket' object has no attribute 'sv_set'
2022-08-25 17:09:10,377 [ERROR] sverchok.core.socket_data:196 : No data passed into socket 'Vertices'
2022-08-25 17:09:10,378 [ERROR] sverchok.nodes.list_struct.item:76 : 'NodeSocket' object has no attribute 'sv_set'
2022-08-25 17:09:12,360 [ERROR] sverchok.core.socket_data:196 : No data passed into socket 'Vertices'
2022-08-25 17:09:12,361 [ERROR] sverchok.nodes.list_struct.item:76 : 'NodeSocket' object has no attribute 'sv_set'
2022-08-25 17:09:46,834 [ERROR] sverchok.core.socket_data:196 : No data passed into socket 'Vertices'
2022-08-25 17:09:46,834 [ERROR] sverchok.nodes.list_struct.item:76 : 'NodeSocket' object has no attribute 'sv_set'

it seems to be a problem with the List Item node. The Tree does partially load when you click into the 3dview.
image

When a node doesn't fully load, and in this case the Node Sockets being loaded aren't registered as sverchok sockets, then certain properties won't be present. here sv_forget and sv_set would be present if the socket was valid. Why is the socket not valid?

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

now if you do a search for List Item in that json, you will see "outputs": {"Item": {"bl_idname": "SvO3TriangleMeshSocket", and that kind of socket is not a standard socket, and will only be available with open3d dependency installed. https://github.com/vicdoval/sverchok-open3d/blob/master/sockets.py

i don't know why the .json has open4d in the name :)

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

as for these..

sverchok\json_examples\Architecture\BIM_ArchiCAD24_import.json - errors
sverchok\json_examples\Architecture\BIM_FreeCAD_import.json - errors
sverchok\json_examples\Architecture\BIM_truss_joint.json - errors

BIM_ArchiCAD24_import.json

without archicad24 dependency installed here, i'm not able to test this, and this is why I added it to the skip list.. the demographic for that json is not big. It's in the dir because @nortikin has interest in its demonstrational value.

BIM_FreeCAD_import.json

i imagine that is looking for a specific freecad file. (not the dependency but an .FCStd , let's see.
image
as expected, without that file, the next node will fail.. This file is not included in that directory. I would consider this file merely an aid for users who want to quickly import an .FCStd using a predefined layout (it saves you from having to manually add those nodes, but you still kind of have to know what buttons to press . etc.)

BIM_truss_joint.json

is a true mammoth.
image

There are three Script nodes (Shader, Shader2, Shader3) . i'll have a look at their scripts, it might be something stupid.
because they are not loading, downstream nodes will throw errors that only happen if the upstream nodes aren't outputting the data that they should be outputting. Not sure what shader nodes are doing. will look.

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

a while back i wrote a tool that reads the json and can output the scripts used in SNlite nodes, for easier inspecting when things go wrong. #2811

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

it looks like the Script nodes are being used to store a fragment/vertex or geometry Shader. This is not strictly what SNLite is supposed to be used for. This is also why the node spits out a bunch of errors during initialization. Over time i've added features to snlite that warn the user if their script isn't correctly 'describing' the desired sockets - the errors are the result of these additions.

The scripts stored by SNLite do not have directives, just two variables. It seems the errors resolve after the last node is loaded, again clicking into the nodeview does snap Blender into putting the NodeFrames where they should be (not our problem..)

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

Architecture\Power_transmission_tower.json

image

the main error here is a bmesh error in the Framework node..

sverchok.utils.sv_bmesh_utils:108 : edges.get(...): found the same (BMVert) used multiple times

not sure why it's throwing that error, the input mesh doesn't have duplicate edges, so internally in the node there must be geometry generated which is duplicate.

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

Shapes\Keyboard_key_profile.json

image

the UV connection node may be in an "old" state, but these settings do work and squash the viewerdraw error.

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

Shapes\Sofa_Pillow.json

the import is OK, it's the node throwing the error

2022-08-25 20:53:23,652 [INFO] sverchok.utils.sv_json_import 320: Import done with no fails
2022-08-25 20:53:23,690 [ERROR] sverchok.nodes.vector.attractor:114 : 'inverse_cubic'    <--------- line 114. see below

image

looks like an internal change to the code of that node. the json references

    "falloff_type": "inverse_cubic"

line 114 reads

        func = globals()[self.falloff_type]

and... i'm a little disturbed to see the use of globals() there.. hahaha :) it appears that inverse_cubic is not in globals() at that point in the runtime. So.. let's look at the history of the node changes. at some point something changed here..

at some point this line was removed, ( 9002fd4 )

from sverchok.utils.math import inverse, inverse_square, inverse_cubic, inverse_exp, gauss

(probably because of some code-linter type code anaylzer didn't understand that these imports are used indirectly when the code does a lookup using globals(). We will need to re-import those functions somehow. we have options..
maybe

import sverchok.utils.math as falloff_functions

...
# line 114
func = getattr(falloff_functions, self.falloff_type)

@zeffii
Copy link
Collaborator

zeffii commented Aug 25, 2022

attractor node is fixed now #4621

@satabol
Copy link
Collaborator Author

satabol commented Aug 25, 2022

now if you do a search for List Item in that json, you will see "outputs": {"Item": {"bl_idname": "SvO3TriangleMeshSocket", and that kind of socket is not a standard socket, and will only be available with open3d dependency installed. https://github.com/vicdoval/sverchok-open3d/blob/master/sockets.py

i don't know why the .json has open4d in the name :)

Thank you @zeffii. I tried install open3d unsuccessfully by 2 ways: in the blender and in the cmd console.
2022-08-25_235045

Then I try to install the development version of open3d as wrote on site

http://www.open3d.org/docs/latest/getting_started.html#development-version-pip :

F:\install\blender\blender-3.2.2-windows-x64.sv\3.2\python\bin\python.exe -m pip install --pre https://storage.googleapis.com/open3d-releases-master/python-wheels/open3d-0.15.2+0c7a413-cp310-cp310-win_amd64.whl

installation is ok, but... but blender cannot start at all. ))) so... I removed open3d.

If is it hard to correct json_examples can I do task number 1 "Update nodes names" in another PR ? (I do not found that nodes in json_examples)

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

ok..if memory serves me right the sverchok-open3d add-on was not updated to the current state of Blender API. Only small changes are required to nudge that along. A separate issue is if the open3d library itself is not available, it's 3rd party so we must acknowledge that. I will get back to you about that..

If is it hard to correct json_examples can I do task number 1 "Update nodes names" in another PR ? (I do not found that nodes in json_examples)

not sure what you mean

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

not sure if you'd seen this, we maintain a list of json examples which are tricky to run through the test suite.

UNITTEST_SKIPLIST = [
"GreacePencil_injection.json",
"pointsONface_gather_lines.json",
"Generative_Art_Lsystem.json",
# "Genetic_algorithm.blend.json", # looks like script node is trying to update via import_from_json method
"Genetic_algorithm_scripted_node.json",
"Elfnor_topology_nodes.json",
"l-systems.json",
"ABCnaming.json",
"ArchiCAD24import.json",
"CNC_CUTHOLES_RESIZE.json",
"Open4d_mesh.json",
"BIM_ArchiCAD24_import.json",
"BIM_FreeCAD_import.json",
"BIM_truss_joint.json",
"SverchokLogo.json" # Blender 2.90 has a crash in delaunay_2d_cdt on this file :/
]

@satabol
Copy link
Collaborator Author

satabol commented Aug 26, 2022

If is it hard to correct json_examples can I do task number 1 "Update nodes names" in another PR ? (I do not found that nodes in json_examples)

not sure what you mean

@zeffii, Sorry for bad English. ) It is wrong way to merge 2 PR in 1 PR. My suggestion is to split this PR with 2 parts:

  1. Update nodes names
  2. fix json_examples/**

I check json_examples and found that nodes in 1. is absent in 2.

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

close the PR if you wish. Making PR's "stand-alone / topic specific" is the preferred way to do things. It allows you to have a better overview of the changes (especially lateron)

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

this discussion has been good already, we managed to track down a bug and fix it :)

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

in the power transmission json , set the NGON node paramter to "rad_": 3.94,

@satabol satabol closed this Aug 26, 2022
@satabol satabol reopened this Aug 26, 2022
@satabol
Copy link
Collaborator Author

satabol commented Aug 26, 2022

If is it hard to correct json_examples can I do task number 1 "Update nodes names" in another PR ? (I do not found that nodes in json_examples)

not sure what you mean

(Sorry for reopen PR. ))) I wrote comment on iPad and press wrong button)

I mean: “If correct json_examples is hard then…”. Is it make sense?

@satabol
Copy link
Collaborator Author

satabol commented Aug 26, 2022

\json_examples\Architecture\BIM_FreeCAD_import.json - good if open file [freecad root folder]\data\examples\ArchDetail.FCStd
2022-08-26_142350

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

right, the issue with passing a hardcoded location of .FCStd is going to be; it will be a different location for almost all users. Unless we can query the freecad module somehow..

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

import FreeCAD as F
F.getResourceDir()
>>> 'C:/Users/zeffi/fc_env/Library/data/'

-> 'C:/Users/zeffi/fc_env/Library/data/examples/ArchDetail.FCStd'

@nortikin
Copy link
Owner

BIM_ArchiCAD24_import.json

without archicad24 dependency installed here, i'm not able to test this, and this is why I added it to the skip list.. the demographic for that json is not big. It's in the dir because @nortikin has interest in its demonstrational value.

image
it is OK

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

Hi @nortikin , hope you are well.

@nortikin
Copy link
Owner

nortikin commented Aug 26, 2022

There are three Script nodes (Shader, Shader2, Shader3) . i'll have a look at their scripts, it might be something stupid. because they are not loading, downstream nodes will throw errors that only happen if the upstream nodes aren't outputting the data that they should be outputting. Not sure what shader nodes are doing. will look.

How to store shaders?

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

@nortikin probably by making dummy sockets..

"""
>in aux s
"""

vertex_shader = '''
'''

etc..

the > would prevent the node from executing anything other than making the socket.

@nortikin
Copy link
Owner

nortikin commented Aug 26, 2022

Hi @nortikin , hope you are well.

I'm ok. Riding bike (bicycle) and enjoy life.

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

i think.. i have not tried it.. but that's what the > is for. It prevents computation until the node-socket is connected

@zeffii
Copy link
Collaborator

zeffii commented Aug 26, 2022

import FreeCAD as F
F.getResourceDir()
>>> 'C:/Users/zeffi/fc_env/Library/data/'

-> 'C:/Users/zeffi/fc_env/Library/data/examples/ArchDetail.FCStd'

so.. with this we can go several ways.. a script node or an exec node , either can output the Filepath of the locally found .FCStd

like (for script node lite)

"""
in aux s
out filepath FP
"""

import os
import FreeCAD as F

datapath = F.getResourceDir()
resource_path = os.path.join(datapath, 'examples', 'ArchDetail.FCStd')
filepath.append([resource_path]) 

this does expose a small issue with snlite, apparently i accidentally modified it to force an input socket. most of the time I would use input sockets and not encounter the issue, but i'll fix that. it should allow no inputs, but a dummy output may be necessary.
you can now drop the compulsory input socket, that's fixed.

here's a solution for exec node

import os
import FreeCAD as F

datapath = F.getResourceDir()
resource_path = os.path.join(datapath, 'examples', 'ArchDetail.FCStd')
append([resource_path]) 

@satabol
Copy link
Collaborator Author

satabol commented Aug 27, 2022

Hi @zeffii . I found https://community.osarch.org/discussion/22/sverchok-experiments/p2 with a visualization of examples for

json_examples\Architecture\BIM_truss_joint.json
json_examples\Advanced\Open4d_mesh.json

I do not see SNLite for shader/2/3:

2022-08-28_001331

May be it is right to remove SNLine for shader/2/3? They has a "Fake user" setting and will not deleted.

Or may be it is good to revert that 2 json examples and fix them in the future ? (after fix open 3d).

@zeffii
Copy link
Collaborator

zeffii commented Aug 28, 2022

i'm not sure i understand the reference to "fake user" - that's a setting using by blender text datablocks in relation to a .blend. Here we are talking about .json files which (forgive me if you already understand this) are in essence our attempt at converting the most important parts of a .blend file into a text representation of it stored as a .json . where the Text file has fake_users will have no influence on whether the text file is stored in the .json. As far as I know only SNLite node currently has a way to store text files and add them back to a new empty .blend session.

@zeffii
Copy link
Collaborator

zeffii commented Aug 28, 2022

let's not forget that storing these examples as .json is not a goal, ideally we would be able to but it is sometimes more sane to store examples as proper .blends

@satabol
Copy link
Collaborator Author

satabol commented Aug 28, 2022

i'm not sure i understand the reference to "fake user" - that's a setting using by blender text datablocks

@zeffii , What with my memory??? I forgot that I am working with json! )))

ideally we would be able to but it is sometimes more sane to store examples as proper .blends

I can do all examples as .blend files (except archicad). Should I do it?

But what about last two files - open4d_mesh.json and BIM_truss_joint.json ?

@zeffii
Copy link
Collaborator

zeffii commented Aug 28, 2022

We try to keep a variety of .json examples to test that mechanism, but if there are serious problems with a json and the example is desirable to keep, then converting it to a .blend is worth considering.

those last two files, forgive me again, but these are not so close to my heart so how they should end up is really not a decision i wish to dominate.

@nortikin
Copy link
Owner

remove open3d please, and later we will get it back when ready.

@satabol satabol merged commit bd493aa into nortikin:master Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants