Skip to content

Instantly share code, notes, and snippets.

Created October 20, 2016 09:04
Show Gist options
  • Save anonymous/7509dbe6293ad4ebb996f02b7237c1d0 to your computer and use it in GitHub Desktop.
Save anonymous/7509dbe6293ad4ebb996f02b7237c1d0 to your computer and use it in GitHub Desktop.
to do later?
{
"export_version": "0.062",
"framed_nodes": {},
"groups": {},
"nodes": {
"Centers polygons 3": {
"bl_idname": "CentersPolsNodeMK3",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-528.9349365234375,
-363.8227844238281
],
"params": {
"Separate": 1
},
"width": 140.0
},
"Float": {
"bl_idname": "FloatNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-359.5070495605469,
-75.77921295166016
],
"params": {
"float_": 0.3399999737739563
},
"width": 140.0
},
"Float.001": {
"bl_idname": "FloatNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-396.69354248046875,
-754.9983520507812
],
"params": {
"float_": 0.3399999737739563
},
"width": 140.0
},
"List Join": {
"bl_idname": "ListJoinNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
160.65223693847656,
-43.90440368652344
],
"params": {
"JoinLevel": 1,
"mix_check": 0,
"wrap_check": 0
},
"width": 140.0
},
"List Join.001": {
"bl_idname": "ListJoinNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
233.35394287109375,
-514.2053833007812
],
"params": {
"JoinLevel": 1,
"mix_check": 0,
"wrap_check": 0
},
"width": 140.0
},
"Objects in": {
"bl_idname": "ObjectsNode",
"color": [
0.0,
0.5,
0.20000000298023224
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-763.812744140625,
-351.8772888183594
],
"params": {},
"width": 140.0
},
"Scripted Node": {
"bl_idname": "SvScriptNode",
"color": [
0.0,
0.800000011920929,
0.949999988079071
],
"height": 100.0,
"hide": false,
"label": "some_fixik.py",
"location": [
-591.569580078125,
-176.814453125
],
"params": {
"button_names": "",
"files_popup": "sv_lang_template.sn",
"has_buttons": 0,
"script_name": "some_fixik.py",
"script_str": "def obtain_normal3(p1, p2, p3):\n return [\n ((p2[1]-p1[1])*(p3[2]-p1[2]))-((p2[2]-p1[2])*(p3[1]-p1[1])),\n ((p2[2]-p1[2])*(p3[0]-p1[0]))-((p2[0]-p1[0])*(p3[2]-p1[2])),\n ((p2[0]-p1[0])*(p3[1]-p1[1]))-((p2[1]-p1[1])*(p3[0]-p1[0]))\n ]\n\ndef sv_main(verts=[[]], polys=[[]]):\n norm_out = []\n edges_out = []\n\n in_sockets = [['v', 'verts_in', verts], ['s', 'polys_in', polys]]\n\n ready = False\n if verts and verts[0]:\n if polys and polys[0]:\n ready=True\n\n if ready:\n print('wtf')\n for idx, poly_list in enumerate(polys):\n norms = []\n vert_list = verts[idx]\n for p in poly_list:\n n = obtain_normal3(*[vert_list[i] for i in p[:3]])\n norms.append(n)\n norm_out.append(norms)\n\n out_sockets = [\n ['v', 'normals', norm_out]\n ]\n\n return in_sockets, out_sockets\n"
},
"width": 140.0
},
"UV Connection": {
"bl_idname": "LineConnectNodeMK2",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
331.1501159667969,
79.08441162109375
],
"params": {
"cicl_check_V": 0,
"cup_V": 0,
"dir_check": "V_dir",
"polygons": "Edges",
"slice_check": 0
},
"width": 140.0
},
"UV Connection.001": {
"bl_idname": "LineConnectNodeMK2",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
409.2537841796875,
-427.23828125
],
"params": {
"cicl_check_V": 0,
"cup_V": 0,
"dir_check": "V_dir",
"polygons": "Edges",
"slice_check": 0
},
"width": 140.0
},
"Vector Math": {
"bl_idname": "VectorMathNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "ADD",
"location": [
-8.235284805297852,
-1.74371337890625
],
"params": {
"items_": "ADD",
"scalar_output_socket": 0
},
"width": 140.0
},
"Vector Math.001": {
"bl_idname": "VectorMathNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "SCALAR",
"location": [
-180.93521118164062,
42.07994842529297
],
"params": {
"items_": "SCALAR",
"scalar_output_socket": 0
},
"width": 140.0
},
"Vector Math.002": {
"bl_idname": "VectorMathNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "NORMALIZE",
"location": [
-357.15478515625,
110.85528564453125
],
"params": {
"items_": "NORMALIZE",
"scalar_output_socket": 0
},
"width": 140.0
},
"Vector Math.003": {
"bl_idname": "VectorMathNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "ADD",
"location": [
53.01666259765625,
-463.5323181152344
],
"params": {
"items_": "ADD",
"scalar_output_socket": 0
},
"width": 140.0
},
"Vector Math.004": {
"bl_idname": "VectorMathNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "NORMALIZE",
"location": [
-321.8916015625,
-582.2446899414062
],
"params": {
"items_": "NORMALIZE",
"scalar_output_socket": 0
},
"width": 140.0
},
"Vector Math.005": {
"bl_idname": "VectorMathNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "SCALAR",
"location": [
-143.29409790039062,
-567.3021240234375
],
"params": {
"items_": "SCALAR",
"scalar_output_socket": 0
},
"width": 140.0
},
"Viewer Draw": {
"bl_idname": "ViewerNode2",
"color": [
1.0,
0.30000001192092896,
0.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
505.8108215332031,
105.43441772460938
],
"params": {},
"width": 140.0
},
"Viewer Draw.001": {
"bl_idname": "ViewerNode2",
"color": [
1.0,
0.30000001192092896,
0.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
588.77734375,
-353.8000183105469
],
"params": {
"edge_colors": [
0.8989997506141663,
0.16868144273757935,
0.029648784548044205
]
},
"width": 140.0
}
},
"update_lists": [
[
"Objects in",
"Vertices",
"Scripted Node",
"verts_in"
],
[
"Objects in",
"Polygons",
"Scripted Node",
"polys_in"
],
[
"Scripted Node",
"normals",
"Vector Math.002",
"U"
],
[
"Objects in",
"Vertices",
"Centers polygons 3",
"Vertices"
],
[
"Objects in",
"Polygons",
"Centers polygons 3",
"Polygons"
],
[
"Centers polygons 3",
"Normals",
"Vector Math.004",
"U"
],
[
"Vector Math.004",
"W",
"Vector Math.005",
"U"
],
[
"Float.001",
"Float",
"Vector Math.005",
"S"
],
[
"Centers polygons 3",
"Origins",
"Vector Math.003",
"U"
],
[
"Vector Math.005",
"W",
"Vector Math.003",
"V"
],
[
"Vector Math.003",
"W",
"List Join.001",
"data"
],
[
"Centers polygons 3",
"Origins",
"List Join.001",
"data 1"
],
[
"List Join.001",
"data",
"UV Connection.001",
"vertices"
],
[
"UV Connection.001",
"vertices",
"Viewer Draw.001",
"vertices"
],
[
"UV Connection.001",
"data",
"Viewer Draw.001",
"edg_pol"
],
[
"Vector Math.002",
"W",
"Vector Math.001",
"U"
],
[
"Float",
"Float",
"Vector Math.001",
"S"
],
[
"Vector Math.001",
"W",
"Vector Math",
"U"
],
[
"Centers polygons 3",
"Origins",
"Vector Math",
"V"
],
[
"Centers polygons 3",
"Origins",
"List Join",
"data"
],
[
"Vector Math",
"W",
"List Join",
"data 1"
],
[
"List Join",
"data",
"UV Connection",
"vertices"
],
[
"UV Connection",
"vertices",
"Viewer Draw",
"vertices"
],
[
"UV Connection",
"data",
"Viewer Draw",
"edg_pol"
]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment