Skip to content

Instantly share code, notes, and snippets.

View vvzen's full-sized avatar
🎥
Pipeline Developer

Valerio Viperino vvzen

🎥
Pipeline Developer
View GitHub Profile
@vvzen
vvzen / rename_from_mari_to_mudbox.py
Last active June 20, 2019 16:59
Command line app in python that renames textures to match mudbox UDIM naming convention
import os
import re
import argparse
import shutil
MARI_REGEX = re.compile(r'(\d{2})(\d{2})')
parser = argparse.ArgumentParser()
parser.add_argument(
'--dir',
@vvzen
vvzen / test_runway_im2txt_openframeworks.cpp
Created June 1, 2019 12:40
Test osc communication between openframeworks and Runway
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup() {
ofSetWindowTitle("runway-im2txt test");
ofSetFrameRate(60); // run at 60 fps
ofSetVerticalSync(true);
// open an outgoing connection to HOST:PORT
@vvzen
vvzen / .jsbeautifyrc
Created February 9, 2019 09:11
js beautify file for vscode (must be in ~ directory)
{
"indent_size": "4",
"indent_char": " ",
"max_preserve_newlines": "5",
"preserve_newlines": true,
"keep_array_indentation": false,
"break_chained_methods": false,
"indent_scripts": "normal",
"brace_style": "collapse",
"space_before_conditional": true,
@vvzen
vvzen / includepaths.json
Created December 15, 2018 12:36
VSCode Mac Openframeworks include paths
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"/Users/vvzen/Documents/code/of/of_v0.10.1_osx_release/addons/ofxGui/src",
"/Users/vvzen/Documents/code/of/of_v0.10.1_osx_release/addons/ofxJSON/libs",
"/Users/vvzen/Documents/code/of/of_v0.10.1_osx_release/addons/ofxJSON/libs/jsoncpp",
"/Users/vvzen/Documents/code/of/of_v0.10.1_osx_release/addons/ofxJSON/libs/jsoncpp/include",
////////////////////////////////////////
// MESH EXPORT
// original code by Lior Ben Gai (http://soogbet.net/i/)
//////////////////////////////////////
// This uses the OBJExport library:
// https://n-e-r-v-o-u-s.com/tools/obj/
public void exportMesh(String fileName){
// export an obj file, change to X3DExport for x3d
MeshExport output = (MeshExport) createGraphics(10, 10, "nervoussystem.obj.OBJExport", fileName + ".obj");
@vvzen
vvzen / arduino-watering-relay.ino
Last active June 4, 2018 23:56
A simple watering system using a relay to activate a peristaltic pump
const int RELAY_PIN = 2;
unsigned long LONG_DELAY_MS = 43200000; // 12 hours expressed in milliseconds
unsigned int WATERING_TIME = 2000;
unsigned long startMillis;
void setup() {
pinMode(RELAY_PIN, OUTPUT);
startMillis = millis();
Serial.begin(9600);
digitalWrite(RELAY_PIN, LOW);
// a map used for storing distances between target and mesh points
// the key is a pair made by the target point and mesh point indices
// the value is the distance between those two points
std::map <pair<int,int>, float> distances_map;
for (int t = 0; t < target_points.size(); t++){
ofPoint random_point = target_points.at(t);
for (int p = 0; p < plane.getNumVertices(); p++){
#include "vv_extrudeFont.h"
//--------------------------------------------------------------
// Original credits go to jefftimeisten, see https://forum.openframeworks.cc/t/extrude-text-into-3d/6938
//
// This method returns a vector containing the vbo meshes required
// to render the front, back and sides of each character in the given string.
//
// @example:
//
import serial
import re
import Adafruit_CharLCD as LCD
# LCD STUFF
lcd_rs = 25
lcd_en = 24
lcd_d4 = 23
lcd_d5 = 17
lcd_d6 = 18
@vvzen
vvzen / tasks.json
Last active February 12, 2018 17:11
{
"version": "1.0.0",
"tasks": [
{
"label": "compile and run",
"type": "shell",
"command": "OF_ROOT=/your/of/root/path make && OF_ROOT=/your/of/root/path make RunRelease",
"group": {
"kind": "build",
"isDefault": true