This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
log_file = op( 'text_log' ) | |
full_text = '''{now} | |
Current Year | {year} | |
Current Month | {month} | |
Current Day | {day} | |
Current Hour | {hour} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cue_list = { | |
"cue1" : { | |
"file" : '/Map/Banana.tif', | |
"mono" : 0 , | |
"invert" : 1, | |
"brightness" : 0.71, | |
"blacklevel" : 0.51, | |
"contrast" : 1.93 | |
} , | |
"cue2" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
class Project: | |
def __init__(self): | |
self.sys_config = '{project_folder}/system.json'.format(project_folder = project.folder) | |
return | |
def Touch_start(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# me - this DAT | |
# scriptOp - the OP which is cooking | |
# | |
targets_pars_vals = [ | |
[ 'tex3d1', 'cachesize', 1 ], | |
[ 'ramp3', 'resolutionh', 1 ], | |
[ 'tima1', 'blackoffset', -1 ] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform int numLights; | |
uniform vec3 viewDirection; | |
uniform vec3 specularColor; | |
uniform float shininess; | |
uniform sampler2D samplerPos; | |
uniform sampler2D samplerNorm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delay scripts example | |
# first we write out script as a string | |
delay_script = "constant_op.par.value0 = args[0]" | |
constant_op = op('constant1') | |
# next we run our script | |
for each_time in range(10): | |
run(delay_script, (each_time+1), delayFrames = 60 * (each_time + 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sender = op('tcpip1') | |
import json | |
def onOffToOn(channel, sampleIndex, val, prev): | |
msg = { | |
"time" : absTime.frame | |
} | |
j_msg = json.dumps(msg) | |
sender.sendBytes(str(j_msg)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def distance(x1, y1, z1, x2, y2, z2): | |
return math.sqrt((x2 - x1)**2 + (y2 - y1)**2 + (z2 - z1)**2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
def numpyDist(point1, point2): | |
p1 = numpy.array(point1) | |
p2 = numpy.array(point2) | |
return numpy.linalg.norm(p1-p2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tduDist(point1, point2): | |
p1 = tdu.Vector(point1) | |
p2 = tdu.Vector(point2) | |
return p1.distance(p2) |