Skip to content

Instantly share code, notes, and snippets.

@portnov
Created October 26, 2019 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save portnov/8fcae2f26522155c1df92d9bb8f036ca to your computer and use it in GitHub Desktop.
Save portnov/8fcae2f26522155c1df92d9bb8f036ca to your computer and use it in GitHub Desktop.
to do later? 2018
{
"export_version": "0.079",
"framed_nodes": {},
"groups": {},
"nodes": {
"Bevel a Curve": {
"bl_idname": "SvBevelCurveNode",
"height": 100.0,
"hide": false,
"label": "",
"location": [
-7.16333532333374,
273.0508117675781
],
"params": {
"algorithm": "track",
"steps": 50,
"up_axis": "Y"
},
"width": 140.0
},
"Objects in mk3": {
"bl_idname": "SvObjectsNodeMK3",
"color": [
0.0,
0.5,
0.20000000298023224
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-1003.3096313476562,
204.43099975585938
],
"object_names": [
"Plane"
],
"params": {},
"use_custom_color": true,
"width": 140.0
},
"Objects in mk3.001": {
"bl_idname": "SvObjectsNodeMK3",
"color": [
0.0,
0.5,
0.20000000298023224
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-1024.4425048828125,
-131.2576446533203
],
"object_names": [
"Plane.001"
],
"params": {},
"use_custom_color": true,
"width": 140.0
},
"Scripted Node Lite": {
"bl_idname": "SvScriptNodeLite",
"color": [
0.0,
0.800000011920929,
0.949999988079071
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-572.0396728515625,
279.6266174316406
],
"params": {
"inject_params": 0,
"injected_state": 0,
"script_name": "nurbs.py",
"script_str": "\"\"\"\nin verts_in v\nout verts_out v\nout edges_out s\n\"\"\"\n\nfrom geomdl import NURBS\nfrom geomdl import utilities\n\n\n# Create a 3-dimensional B-spline Curve\ncurve = NURBS.Curve()\n\n# Set degree\ncurve.degree = 3\n\n# Set control points (weights vector will be 1 by default)\n# Use curve.ctrlptsw is if you are using homogeneous points as Pw\ncurve.ctrlpts = verts_in[0]\n\n# Set knot vector\n#curve.knotvector = [0, 0, 0, 0, 1, 1, 1, 1]\ncurve.knotvector = utilities.generate_knot_vector(curve.degree, len(curve.ctrlpts))\n\n# Set evaluation delta (controls the number of curve points)\ncurve.delta = 0.02\n\n# Get curve points (the curve will be automatically evaluated)\nverts_out = [curve.evalpts]\nedges_out = [[(i,i+1) for i in range(len(verts_out[0])-1)]]"
},
"snlite_ui": [],
"use_custom_color": true,
"width": 140.0
},
"Scripted Node Lite.001": {
"bl_idname": "SvScriptNodeLite",
"color": [
0.0,
0.800000011920929,
0.949999988079071
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-791.3040771484375,
192.07835388183594
],
"params": {
"inject_params": 0,
"injected_state": 0,
"script_name": "topo_sort_for_profile.py",
"script_str": "\"\"\"\nin in_verts v\nin in_edges s\nout vout v\nout eout s\n\"\"\"\n\nfrom collections import defaultdict\n\nif in_verts:\n \n edges_per_vert = defaultdict(list)\n vert_idxs = []\n edges = in_edges[0]\n for edge in edges:\n i, j = edge\n edges_per_vert[i].append(edge)\n edges_per_vert[j].append(edge)\n \n def other(v, edge):\n i, j = edge\n if i == v:\n return j\n else:\n return i\n \n edge0 = left_vertex, right_vertex = edges[0]\n vert_idxs = [left_vertex, right_vertex]\n if edge0 in edges_per_vert[left_vertex]:\n edges_per_vert[left_vertex].remove(edge0)\n if edge0 in edges_per_vert[right_vertex]:\n edges_per_vert[right_vertex].remove(edge0)\n\n while True:\n good_edges = edges_per_vert[right_vertex]\n print(f\"{right_vertex} => {good_edges}\")\n if not good_edges:\n break\n i, j = edge = good_edges[0]\n if edge in edges_per_vert[i]:\n edges_per_vert[i].remove(edge)\n if edge in edges_per_vert[j]:\n edges_per_vert[j].remove(edge) \n right_vertex = other(right_vertex, edge)\n vert_idxs.append(right_vertex)\n \n while True:\n good_edges = edges_per_vert[left_vertex]\n if not good_edges:\n break\n i, j = edge = good_edges[0]\n if edge in edges_per_vert[i]:\n edges_per_vert[i].remove(edge)\n if edge in edges_per_vert[j]:\n edges_per_vert[j].remove(edge) \n left_vertex = other(left_vertex, edge)\n vert_idxs.insert(0, left_vertex) \n \n \n verts_o = [in_verts[0][i] for i in vert_idxs]\n vout = [verts_o]\n eout = [[k,k+1] for k in range(len(verts_o)-1)]\n"
},
"snlite_ui": [],
"use_custom_color": true,
"width": 140.0
},
"Scripted Node Lite.002": {
"bl_idname": "SvScriptNodeLite",
"color": [
0.0,
0.800000011920929,
0.949999988079071
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-825.8704833984375,
-97.04598999023438
],
"params": {
"inject_params": 0,
"injected_state": 0,
"script_name": "topo_sort_for_profile.py",
"script_str": "\"\"\"\nin in_verts v\nin in_edges s\nout vout v\nout eout s\n\"\"\"\n\nfrom collections import defaultdict\n\nif in_verts:\n \n edges_per_vert = defaultdict(list)\n vert_idxs = []\n edges = in_edges[0]\n for edge in edges:\n i, j = edge\n edges_per_vert[i].append(edge)\n edges_per_vert[j].append(edge)\n \n def other(v, edge):\n i, j = edge\n if i == v:\n return j\n else:\n return i\n \n edge0 = left_vertex, right_vertex = edges[0]\n vert_idxs = [left_vertex, right_vertex]\n if edge0 in edges_per_vert[left_vertex]:\n edges_per_vert[left_vertex].remove(edge0)\n if edge0 in edges_per_vert[right_vertex]:\n edges_per_vert[right_vertex].remove(edge0)\n\n while True:\n good_edges = edges_per_vert[right_vertex]\n print(f\"{right_vertex} => {good_edges}\")\n if not good_edges:\n break\n i, j = edge = good_edges[0]\n if edge in edges_per_vert[i]:\n edges_per_vert[i].remove(edge)\n if edge in edges_per_vert[j]:\n edges_per_vert[j].remove(edge) \n right_vertex = other(right_vertex, edge)\n vert_idxs.append(right_vertex)\n \n while True:\n good_edges = edges_per_vert[left_vertex]\n if not good_edges:\n break\n i, j = edge = good_edges[0]\n if edge in edges_per_vert[i]:\n edges_per_vert[i].remove(edge)\n if edge in edges_per_vert[j]:\n edges_per_vert[j].remove(edge) \n left_vertex = other(left_vertex, edge)\n vert_idxs.insert(0, left_vertex) \n \n \n verts_o = [in_verts[0][i] for i in vert_idxs]\n vout = [verts_o]\n eout = [[k,k+1] for k in range(len(verts_o)-1)]\n"
},
"snlite_ui": [],
"use_custom_color": true,
"width": 140.0
},
"Scripted Node Lite.003": {
"bl_idname": "SvScriptNodeLite",
"color": [
0.0,
0.800000011920929,
0.949999988079071
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-535.2431640625,
-128.9429931640625
],
"params": {
"inject_params": 0,
"injected_state": 0,
"script_name": "nurbs.py",
"script_str": "\"\"\"\nin verts_in v\nout verts_out v\nout edges_out s\n\"\"\"\n\nfrom geomdl import NURBS\nfrom geomdl import utilities\n\n\n# Create a 3-dimensional B-spline Curve\ncurve = NURBS.Curve()\n\n# Set degree\ncurve.degree = 3\n\n# Set control points (weights vector will be 1 by default)\n# Use curve.ctrlptsw is if you are using homogeneous points as Pw\ncurve.ctrlpts = verts_in[0]\n\n# Set knot vector\n#curve.knotvector = [0, 0, 0, 0, 1, 1, 1, 1]\ncurve.knotvector = utilities.generate_knot_vector(curve.degree, len(curve.ctrlpts))\n\n# Set evaluation delta (controls the number of curve points)\ncurve.delta = 0.02\n\n# Get curve points (the curve will be automatically evaluated)\nverts_out = [curve.evalpts]\nedges_out = [[(i,i+1) for i in range(len(verts_out[0])-1)]]"
},
"snlite_ui": [],
"use_custom_color": true,
"width": 140.0
},
"VD Experimental": {
"bl_idname": "SvVDExperimental",
"color": [
1.0,
0.30000001192092896,
0.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-260.2042541503906,
269.00244140625
],
"params": {
"activate": 0
},
"use_custom_color": true,
"width": 140.0
},
"VD Experimental.001": {
"bl_idname": "SvVDExperimental",
"color": [
1.0,
0.30000001192092896,
0.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-286.9653625488281,
-5.610000133514404
],
"params": {
"activate": 0
},
"use_custom_color": true,
"width": 140.0
},
"VD Experimental.002": {
"bl_idname": "SvVDExperimental",
"color": [
1.0,
0.30000001192092896,
0.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
192.836669921875,
273.0508117675781
],
"params": {
"activate": 1,
"draw_gl_polygonoffset": 1,
"draw_gl_wireframe": 0,
"selected_draw_mode": "facet"
},
"use_custom_color": true,
"width": 140.0
},
"Viewer Index+": {
"bl_idname": "SvIDXViewer28",
"color": [
1.0,
0.30000001192092896,
0.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-585.5580444335938,
110.88764953613281
],
"params": {
"activate": 0
},
"use_custom_color": true,
"width": 140.0
}
},
"update_lists": [
[
"Objects in mk3.001",
0,
"Scripted Node Lite.002",
0
],
[
"Objects in mk3.001",
1,
"Scripted Node Lite.002",
1
],
[
"Scripted Node Lite.002",
0,
"Scripted Node Lite.003",
0
],
[
"Objects in mk3",
0,
"Scripted Node Lite.001",
0
],
[
"Objects in mk3",
1,
"Scripted Node Lite.001",
1
],
[
"Scripted Node Lite.001",
0,
"Scripted Node Lite",
0
],
[
"Scripted Node Lite.003",
0,
"Bevel a Curve",
0
],
[
"Scripted Node Lite",
0,
"Bevel a Curve",
1
],
[
"Scripted Node Lite",
1,
"Bevel a Curve",
2
],
[
"Bevel a Curve",
0,
"VD Experimental.002",
0
],
[
"Bevel a Curve",
1,
"VD Experimental.002",
1
],
[
"Bevel a Curve",
2,
"VD Experimental.002",
2
],
[
"Scripted Node Lite",
0,
"VD Experimental",
0
],
[
"Scripted Node Lite",
1,
"VD Experimental",
1
],
[
"Scripted Node Lite.001",
0,
"Viewer Index+",
0
],
[
"Scripted Node Lite.003",
0,
"VD Experimental.001",
0
],
[
"Scripted Node Lite.003",
1,
"VD Experimental.001",
1
]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment