Skip to content

Instantly share code, notes, and snippets.

@RH2
RH2 / gist:f54f4d7fb6cb7d280b53a03982074b27
Created March 17, 2022 05:18
shader and geometry-node generator
#import bpy
mat_name = "pointcloud2"
materials = bpy.data.materials
if materials.get(mat_name) is None:
print("creating pointcloud material")
mat = materials.new(mat_name)
mat.use_nodes = True
materialtree = mat.node_tree.nodes
materialtree.remove(materialtree.get("Principled BSDF"))
materialtree.remove(materialtree.get("Material Output"))
"csg" :
[
[
{
"type" : "cube"
"mode" : "add"
"rgb" : "153 204 255"
"round%": "0.25"
"r" : "1 0 0 0 1 0 0 0 1"
"t" : "0 0 256"
@RH2
RH2 / gist:956895379daa01a2b69679bb5dc05d21
Last active September 30, 2020 21:37
Vertex color from first material slot with baked cavity pass.
import bpy
import random
#matcol = bpy.data.materials["Material.001"].diffuse_color
#for m in bpy.context.object.material_slots:
for obj in bpy.context.selected_objects:
bpy.ops.object.mode_set(mode='OBJECT')
matname = bpy.context.selected_objects[0].material_slots[0].name
#specialColor = bpy.data.materials[matname].diffuse_color
specialColor = bpy.data.materials[matname].node_tree.nodes['Principled BSDF'].inputs[0].default_value
@RH2
RH2 / RGB_palletSnap.py
Created September 21, 2020 07:31
backup python files
import PIL
from PIL import Image
import math
from datetime import datetime
#from skimage.color import rgb2hsv
#from skimage.color import hsv2rgb
import os
import colorsys
inputDirectory ='C:/Users/Reference/Desktop/raylib-live/games/pixel-runner/conversion-in' #specify a directory of source images
exitDirectory = 'C:/Users/Reference/Desktop/raylib-live/games/pixel-runner/conversion-out' #where to put output images
MIT License
Copyright (c) 2019 Richard Hale
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
matrixA = [[3,2,1],[5,8,3],[2,4,7]]
matrixB = [[3,2,1],[5,8,3],[2,4,7]]
box = {x:3,y:4}
initialangle= Math.atan2(box.y,box.x)
function findh(x,y){return(Math.sqrt(Math.pow(x/2,2)+Math.pow(y/2,2)))}
function radtodeg(input){return((input/(Math.PI*2))*360)}
function degtorad(input){return((input/180)*Math.PI)}
angle = degtorad(30)
matrixRotateX = [[1,0,0],[0,Math.cos(angle),-Math.sin(angle)],[0,Math.sin(angle),Math.cos(angle)]]
matrixRotateY = [[Math.cos(angle),0,Math.sin(angle)],[0,1,0],[-Math.sin(angle),0,Math.cos(angle)]]
@RH2
RH2 / edge angle without hedges
Created November 2, 2019 21:18
(first attempt, not fully functional)
int pointArray = npoints(0);
int processedPoints[]={};
int edgeList[]; //ds: ai,at,bi,bt,ci,ct....
int faceList[]; //ds: aa,ab,ba,bb....
float edgeAngles[];
vector edgeMid[];
int pass;
//go through all points that have not been processed already
for(int i = 0 ; i<pointArray;i++){
int thispoint = i;
@RH2
RH2 / hea.vfl
Last active November 2, 2019 21:09
Half Edge Angle
int pass;
int pntPairs[] = expandedgegroup(0,"");
//printf("pntPairs: %f\\n",pntPairs);
for(int p=0; p<len(pntPairs);p=p+2){
int p1,p2;
p1 = pntPairs[p];
p2 = pntPairs[p+1];
int hedge1 = pointhedge(0, p1, p2);
@RH2
RH2 / notes
Created October 22, 2019 05:44
APPLIED RESEARCH :: VOLUME 63 (AUG 2016)
TECHNICAL COMMUNICATION AS USER EXPERIENCE IN A BROADENING INDUSTRY LANDSCAPE
pg248. Designer, Developer, Architect, Manager, Researcher
pg249. Based on an analysis of 502 industry job postings, this article argues that technical communication work shares traits and competencies with the field of UX
pg249. This holistic approach to the user is captured in the interdisciplinarity of UX, which, as a field, combines communication, psychology, human-computer interaction (HCI), social science, design, technology, and other specialized knowledge areas in an attempt to better understand user practices and meet the needs of users within and across information products and interfaces.
pg252. 41+30 or 71% of tech communication jobs are located on the coasts.
pg253. strong correlation with IT / Service / Software jobs. (~40%) — ~10% in Advertising/Social ~15% industry unclear
pg253. 22% UX,Developer ::: 61% UX/UI/Interatction, Designer
pg254. Designer Developer and Architect ha
import hou
import os
from struct import *
node = hou.pwd()
geo = node.geometry()
FilePath = 'C:\Users\Reference\Desktop\MV\MVexport.txt'
outputString = "This is my first python string outputted to a file from houdini"
"VOX_"