Skip to content

Instantly share code, notes, and snippets.

Dealga McArdle zeffii

Block or report user

Report or block zeffii

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View darf.py
@persistent
def sv_update_handler(scene):
"""
Update sverchok node groups on frame change events.
"""
if not has_frame_changed(scene):
return
for ng in sverchok_trees():
try:
View c_xall.py
sockets = """
in points v
in edges s
out new_verts v
"""
cdef = """
int intersectAll(float vertices[][3], int lines[][2], float new_verts[][3]);
"""
View app_handler_bug.py
import bpy
from bpy.app.handlers import persistent
@persistent
def handler_undo_pre(scene):
print('pre')
@persistent
def handler_undo_post(scene):
print('post')
View using pathlib.py
def setup():
import os, bpy, pathlib
path = os.path.dirname(bpy.data.filepath)
root = pathlib.Path(bpy.app.binary_path).parent
# old way
py = os.path.join(root, "2.80", "python", "include")
build = os.path.join(path, "build")
srcs = os.path.join(path, "voro", "src")
View arc_From_3pt.c
float *lerp(float *a, float *b, float t){
if (t == 0.0) { return a; }
else if (t == 1.0){ return b; }
float s = 1.0 - t;
float x = s * a[0] + t * b[0];
float y = s * a[1] + t * b[1];
float z = s * a[2] + t * b[2];
float *outvalue = {x, y, z};
return outvalue;
}
View example.py
"""
in dummy_in s
out dummy_out s
"""
if not 'NEW_IN' in self.inputs:
self.inputs.new('StringsSocket', 'NEW_IN')
if not 'NEW_OUT' in self.outputs:
self.outputs.new('StringsSocket', 'NEW_OUT')
View yikes.py
['', ' float add(float a, float b);', ' ']
ITEM1 float add(float a, float b);
X ['float add', 'float a, float b);']
PARSE ['float a', ' float b']
[(['float', 'add'], [('float', 'a'), ('float', 'b')])]
FP ['float', 'add'] [('float', 'a'), ('float', 'b')]
PARAM {'a': 5.0, 'b': 12.110000610351562}
add a,b
_cffi__x5594ce1fx833f21d4.c
C:\Users\zeffi\Desktop\test_blenders\sverchok_cffi_28 (1)/build\_cffi__x5594ce1fx833f21d4.c(2): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
View yikes.py
import bpy
from mathutils import Matrix
new_matrix = Matrix((
(0.791, 0.612, 0.0, 0.279),
(-0.612, 0.7906, 0.0, -0.0995),
(0.0, 0.0, 1.0, -0.60742),
(0.0, 0.0, 0.0, 1.0)))
cube = bpy.data.objects['Cube']
@zeffii
zeffii / sate.sauce
Created Oct 15, 2018
recipe for sate sauce
View sate.sauce
Ingredients 4 persons
=====================
3 sjalotes / onions
2 cloves garlic
200 gram unsalted rauw peanuts
3 or more peppers (tawits? )
1 tablespoon gula djawa (or brown sugar)
1 dl water
2 tablespoons ketjap manis ( sweet )
You can’t perform that action at this time.