Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2017 14:38
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 anonymous/8cba469a1eb1c8ae2a295dc27e5fbc89 to your computer and use it in GitHub Desktop.
Save anonymous/8cba469a1eb1c8ae2a295dc27e5fbc89 to your computer and use it in GitHub Desktop.
to do later?
{
"export_version": "0.065",
"framed_nodes": {},
"groups": {},
"nodes": {
"A Number": {
"bl_idname": "SvNumberNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-433.5395812988281,
86.84391784667969
],
"params": {
"float_": 0.0,
"int_": 236,
"selected_mode": "int"
},
"width": 140.0
},
"Mesh Join": {
"bl_idname": "SvMeshJoinNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
324.9725341796875,
136.35537719726562
],
"params": {},
"width": 140.0
},
"Random Num Gen": {
"bl_idname": "SvRndNumGen",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": true,
"label": "",
"location": [
-245.45379638671875,
126.39283752441406
],
"params": {
"low_f": -1.0,
"type_selected_mode": "Float"
},
"width": 140.0
},
"Random Num Gen.001": {
"bl_idname": "SvRndNumGen",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": true,
"label": "",
"location": [
-248.70574951171875,
73.70933532714844
],
"params": {
"low_f": -1.0,
"seed": 17,
"type_selected_mode": "Float"
},
"width": 140.0
},
"Random Num Gen.002": {
"bl_idname": "SvRndNumGen",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": true,
"label": "",
"location": [
-252.80641174316406,
20.48273468017578
],
"params": {
"high_f": 7.0,
"low_f": 0.0,
"seed": 7,
"type_selected_mode": "Float"
},
"width": 140.0
},
"Remove Doubles": {
"bl_idname": "SvRemoveDoublesNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
2.133556365966797,
253.41644287109375
],
"params": {
"distance": 0.6310000419616699
},
"width": 136.72650146484375
},
"Scripted Node Lite": {
"bl_idname": "SvScriptNodeLite",
"color": [
0.0,
0.800000011920929,
0.949999988079071
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
163.7598114013672,
169.69366455078125
],
"params": {
"float_list": [
0.0,
3.559999704360962,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"inject_params": 0,
"injected_state": 0,
"int_list": [
0,
0,
14,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"script_name": "bonkers",
"script_str": "\"\"\"\nin verts_in v d=[] n=1\nin distor s d=2.0 n=2\nin sidor s d=7 n=2\nout verts_out v\nout edges s\nout new_verts v\nout new_faces s\n\"\"\"\n\nimport bmesh\nimport mathutils\nfrom mathutils import Vector\nfrom collections import defaultdict\n\ndef cv_hull(coords):\n bm = bmesh.new()\n bm_verts = [bm.verts.new(v) for v in coords]\n bmesh.ops.convex_hull(bm, input=bm_verts, use_existing_faces=False)\n verts, _, faces = pydata_from_bmesh(bm)\n return verts, faces\n\nsize = len(verts_in)\nkd = mathutils.kdtree.KDTree(size)\nfor i, xyz in enumerate(verts_in):\n kd.insert(xyz, i)\nkd.balance()\n\nedges = [[]]\nedge_set = set()\n\n\nlocators = defaultdict(list)\n\nfor idx, vtx in enumerate(verts_in):\n n_list = kd.find_n(vtx, sidor)\n for co, index, dist in n_list:\n if index == idx:\n continue\n # edge_set.add(tuple(sorted([idx, index])))\n # locators[idx].append(co, index, dist)\n locators[idx].append((Vector(co)-Vector(vtx))/distor + Vector(vtx))\n\nedges[0] = list(edge_set)\n\nfor k, v in locators.items():\n ___v, ___f = cv_hull(v)\n new_verts.append(___v)\n new_faces.append(___f)"
},
"snlite_ui": [],
"width": 140.0
},
"Vector in": {
"bl_idname": "GenVectorsNode",
"color": [
0.6079999804496765,
0.6079999804496765,
0.6079999804496765
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
-116.939697265625,
138.99502563476562
],
"params": {},
"width": 100.0
},
"Viewer Draw": {
"bl_idname": "ViewerNode2",
"color": [
0.6284880042076111,
0.931007981300354,
1.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
487.8927917480469,
119.60421752929688
],
"params": {
"edge_colors": [
0.5,
0.8989999890327454,
0.8297881484031677
],
"edge_width": 1,
"face_colors": [
0.03009999915957451,
0.8989999890327454,
0.7482777833938599
],
"shading": 1,
"transparant": 0,
"vertex_colors": [
0.8999999761581421,
0.9480000138282776,
0.9396737813949585
],
"vertex_size": 2.0
},
"width": 140.0
},
"Viewer Draw.001": {
"bl_idname": "ViewerNode2",
"color": [
0.6284880042076111,
0.931007981300354,
1.0
],
"height": 100.0,
"hide": false,
"label": "",
"location": [
438.1571044921875,
373.56103515625
],
"params": {
"edge_colors": [
0.5,
0.8989999890327454,
0.8297881484031677
],
"edge_width": 10,
"face_colors": [
0.03009999915957451,
0.8989999890327454,
0.7482777833938599
],
"shading": 1,
"transparant": 0,
"vertex_colors": [
0.9480001330375671,
0.0690222680568695,
0.19274306297302246
],
"vertex_size": 5.0420002937316895
},
"width": 140.0
}
},
"update_lists": [
[
"A Number",
0,
"Random Num Gen.002",
0
],
[
"A Number",
0,
"Random Num Gen",
0
],
[
"A Number",
0,
"Random Num Gen.001",
0
],
[
"Random Num Gen",
0,
"Vector in",
0
],
[
"Random Num Gen.001",
0,
"Vector in",
1
],
[
"Random Num Gen.002",
0,
"Vector in",
2
],
[
"Vector in",
0,
"Remove Doubles",
1
],
[
"Remove Doubles",
0,
"Viewer Draw.001",
0
],
[
"Remove Doubles",
0,
"Scripted Node Lite",
0
],
[
"Scripted Node Lite",
2,
"Mesh Join",
0
],
[
"Scripted Node Lite",
3,
"Mesh Join",
1
],
[
"Mesh Join",
0,
"Viewer Draw",
0
],
[
"Mesh Join",
1,
"Viewer Draw",
1
]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment