Skip to content

Instantly share code, notes, and snippets.

View furby-tm's full-sized avatar
:electron:
swifting reality.

furby™ furby-tm

:electron:
swifting reality.
View GitHub Profile
@furby-tm
furby-tm / draw.py
Last active November 23, 2019 22:33
import gpu
import bgl
import numpy as np
from gpu_extras.batch import batch_for_shader
import barnold.props as props
from array import array
class GPU:
def __init__(self, engine, scene, width, height, offset_x, offset_y, rect):
import bgl
import numpy as np
import barnold.props as props
import ctypes
class GPU:
def __init__(self, engine, scene, width, height, offset_x, offset_y, rect):
self._width = width
self._height = height
@furby-tm
furby-tm / draw.py
Last active November 21, 2019 00:35
import bgl
import numpy as np
import barnold.props as props
class GPU:
def __init__(self, engine, scene, width, height, offset_x, offset_y, rect):
self._width = width
self._height = height
self.buffer = bgl.Buffer(bgl.GL_SHORT, rect.shape, rect)
# -*- coding: utf-8 -*-
__author__ = "Ildar Nikolaev"
__email__ = "nildar@users.sourceforge.net"
import sys
import numpy
import mmap
import platform
import os
import ctypes
import itertools
import collections
import numpy
import math
import time
import re
from contextlib import contextmanager
import traceback
import contextlib as cl
def view_draw(engine, depsgraph, region, space_data, region_data):
#print(">>> view_draw [%f]:" % time.clock(), engine)
try:
region = bpy.context.region
v3d = bpy.context.space_data
rv3d = bpy.context.region_data
data = {}
_camera = {}
# -*- coding: utf-8 -*-
__authors__ = "Tyler Furby, Jared Webber"
import os
import sys
import ctypes
import itertools
import collections
import numpy
@furby-tm
furby-tm / polymesh.py
Last active February 16, 2021 22:42
import ctypes
import itertools
import collections
import numpy
import math
import time
import re
from contextlib import contextmanager
import traceback
import contextlib as cl
import ctypes
import itertools
import collections
import numpy
import math
import time
import re
from contextlib import contextmanager
import traceback
if mesh.materials:
_Name = _CleanNames("M", itertools.count())
if mesh.materials[0].use_nodes:
for _node in mesh.materials[0].node_tree.nodes:
if isinstance(_node, nt.ArnoldNodeOutput) and _node.is_active:
for input in _node.inputs:
if input.is_linked:
# Displacement Mapping (Arnold needs map to be a pointer to the array of nodes pointing to displacement)
if input.identifier == "disp_map":
dispnodes = []