Skip to content

Instantly share code, notes, and snippets.

@howiemnet
howiemnet / gist:4aef79384b86c06e6f7d
Last active August 29, 2015 14:15
Pyserial in Blender on Mac
# Install a full version of Python 3.4. It'll end up
# in /Library/Frameworks. Install PySerial in there too.
# This code can then be run in Blender
import sys
sys.path.append("/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages”)
import serial
s = serial.Serial("/dev/tty_YOURPORTHERE",9600)
my_string = "hello"
// serial port <--> Motion Mind 3 latency test
import processing.serial.*;
Serial myPort; // The serial port
long myRet;
int inByte;
byte[] myOutString = {
// commands: READ REGISTER, Address (5), Register 17 (fw revision), checksum:
29, 5, 17, 51
};
@howiemnet
howiemnet / pumaJacobian.c
Created April 1, 2015 06:23
Puma Jacobian functions from RCCL / RCI, (C) 1987, 1991 J Lloyd and V Hayward
/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
* *
* Copyright (C) 1987, 1991 by John E. Lloyd and Vincent Hayward. *
* *
* Information on copyright permissions, as well as a complete *
* disclaimer of warranty, is given in the file COPYRIGHT. *
* *
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*=~=~=~=~ McGill-Computer-Vision-and-Robotics-Laboratory--C-Module ~=~=~=~=
@howiemnet
howiemnet / SerialPortLister.swift
Created August 17, 2015 06:27
Serial port lister for OS X in Swift
//
// GetSerialPortList.swift
// serialTestsIokitSwift
//
// Created by h on 17/08/2015.
// Copyright © 2015 h. All rights reserved.
//
// Simple function returns array of serial port
// paths as Strings
//
#
# POPULATE!
#
import bpy
import math
from bpy_extras import object_utils
from random import randint
from math import radians
C = thisComp.layer("Camera");
V = C.toWorldVec([0,0,1]);
P = toWorld(anchorPoint);
lookAt(P, P + V);
# Motion export script
rad2deg = 180/3.14159265
import bpy
import math
from math import sqrt
sce = bpy.context.scene
saveFile = open("/Users/h/Documents/BlenderPlayback.csv","w")
#include <Adafruit_NeoPixel.h>
#define PIN 3
#define LEDCOUNT 23
#define SPEED 5
const uint8_t PROGMEM gamma[] = {
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, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
@howiemnet
howiemnet / Spot_Flare_Brightness.js
Created December 7, 2016 06:02
After Effects Expression to control flare brightness from spotlight orientation
// AE expression to modulate a spotlight's flare brightness
// depending on whether the spot is facing into or away
// from the camera
// h 6/12/2016
// change these to reference your spotlight
// and camera as appropriate
L = thisComp.layer("Light 1");
C = thisComp.activeCamera;
@howiemnet
howiemnet / gist:b63f759c99475dcb347c6ee727995778
Created January 3, 2017 11:31
After Effects: expressions for Particular - particles from thrust
// apply this to the PoI of a spot light to point it in the direction of its acceleration vector
nextVec = transform.position.valueAtTime(time+0.08)-transform.position.valueAtTime(time);
prevVec = transform.position.valueAtTime(time)-transform.position.valueAtTime(time-0.08);
theVec = prevVec-nextVec;
theVec = theVec * 10;
theVec = theVec + transform.position;
theVec
// apply this to the Particles/sec parameter
prevVel = length(thisComp.layer("TEAL").transform.position.valueAtTime(time+0.04) - thisComp.layer("TEAL").transform.position.valueAtTime(time));