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);
#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));
@howiemnet
howiemnet / SetScreenLayout.py
Created January 27, 2017 15:18
Blender Screen hotkeys script
import bpy
class SetScreenLayout(bpy.types.Operator):
"""Switches to the screen layout of the given name."""
bl_idname="screen.set_layout"
bl_label="Switch to Screen Layout"
layoutNamme=bpy.props.StringProperty()
def execute(self,context):
bpy.context.window.screen=bpy.data.screens[self.layoutNamme]
return{'FINISHED'}
def invoke(self,context,event):