snip–><–snip

long time no post.

by on Aug.26, 2012, under Uncategorized

since may the ultimaker has taken over my life. which is not a bad thing. im going to be putting all the 3d printing exploits on a new blog here.

 

Leave a Comment more...

The 3D adventure begins….

by on Apr.24, 2012, under 3d Printing, Ultimaker

I have spent allot of time over the 6 months heavily researching 3d printers. My girlfriend and i had an idea we want to try and getting a 3d printer would be easier and cheaper than a cnc mill, plus we could use it at home.

I spent a ton of time looking at hte pro and cons of all the printers, there is a really good comparison at protoparadigm.

We ended out going with Ultimaker.

Today after a 5 week wait i have the box and im ready to start…. Im looking forward to where this jorney will take me.

 

Some useful links:

http://www.thingiverse.com/kwatts

kwatts: http://forum.ultimaker.com

 

 

 

Leave a Comment more...

Useful links for scripting with Nuke

by on Mar.05, 2012, under Nuke, Python

I have been doing some scripting with Nuke, While the Documentation is great, not being a compositor by trade, knowing the lingo for items in nuke was a pain to get my head around.

So here are some useful links in case i forget what im looking for…

Creating custom panels / widgets and popups in nuke’s python:

http://docs.thefoundry.co.uk/nuke/63/pythondevguide/custom_panels.htm

Visual guide to nuke Knob types:

http://docs.thefoundry.co.uk/nuke/63/ndkdevguide/knobs-and-handles/knobtypes.html

Nuke knob flags (These apply in  python aswell):

http://docs.thefoundry.co.uk/nuke/63/ndkdevguide/knobs-and-handles/knobflags.html

Some useful example scripts i have found:

Pyside webbroswer in nuke:

http://pastebin.com/CC0CJ2Qu

Split multichannel exrs into visible layers in nuke:

http://pastebin.com/G7fFbsXz

Query all the read nodes in a script:

http://pastebin.com/wKFXh3Vf

Path swapping reads and write for a company that has 2 facilities. hmm its hard to guess:

http://pastebin.com/8fK00AMx

Leave a Comment more...

PySide in maya 2010.

by on Jan.01, 2012, under Uncategorized

The last time i tired this it broke and it broke good, but this time when i installed pyside, i made sure it was the 64bit version from:

http://developer.qt.nokia.com/wiki/PySide_Binaries_Windows

maya 2010 uses python 2.6, so make sure you have that installed and then install pyside on that.

Getting pyside to lauch in maya was as easy as:

**EDIT: Forgot to check to the instance..
Checking for the instance gets rid of this error:
# Error: RuntimeError: A QApplication instance already exists. #

<br />
import sys<br />
sys.path.append('C:/Python26/Lib/site-packages/')# this is where python and pyside exist.<br />
#from PySide import QtCore, QtGui<br />
from PySide.QtCore import *<br />
from PySide.QtGui import *<br />
# Create a Qt applicatio<br />
app = QApplication.instance()<br />
if app == None:<br />
    app = QApplication(sys.argv)<br />
# Create a Label and show it<br />
label = QLabel("Hello World")<br />
label.show()<br />
# Enter Qt application main loop<br />
app.exec_()<br />
sys.exit()<br />

That loads hello world.

Next up, so you can load the .ui file in a python app with out having to compile the file.
Nathan Horne wrote a nice wrapper:
PySide_loadUiType.py

So then you can do this:

<br />
&amp;amp;amp;lt;pre&amp;amp;amp;gt;from PySide import QtCore, QtGui<br />
from PySide_loadUiType import loadUiType<br />
form_class,base_class = loadUiType('C:/temp/sgToolCreator02.ui')<br />
class AssetTaskCreator(form_class, base_class):<br />
    def __init__(self, parent=None):<br />
        super(AssetTaskCreator, self).__init__(parent)<br />
        self.setupUi(self)<br />
        #i have a button in the ui, i can now assign it a function that exist out side the ui:<br />
        # in the qt designer, i have called my button: createButton<br />
        # so if i want to assign something, i do it like this:<br />
        self.createButton.clicked.connect(self.onCreateButton)<br />

Then the rest of the ui goes below this point.
So if i make any changes to the layout of the ui, as long as i dont change the names of the ui elements that i have already assigned functions.
everything will work fine.

2 Comments more...

Replying to Shotgun messages on an Android phone.

by on Aug.03, 2011, under Coding, Python

On the project “Them Greeks“, we are using Shotgun for managing the project.

One of the things that annoys me the most is that i cannot reply straight to one of the shotgun emails from a note or Ticket.

To make it even more frustrating i have an android phone and using any of the browsers available i cannot for  the life of me make a reply….

So i decided to see if i could get the shotgun_api3 to run on SL4A python on my android. It worked. Next to write a little wrapper i could use to reply to messages i got in my email.

One of the things I had to do was get the email notes to include the note id, so that i could reply directly to the note via the api.

So to get this to work, you will need to have an android phone with SL4A installed on your android phone.

You will also need Python for Android installed.

Once you have these, you will need to get hold of the shotgun_api and copy it to your phone.
You will need to place the shotgun_api3.py in your sl4a scripts dir, it should live here:

/mnt/sdcard/sl4a/scripts/

So here is my first version of the code, it will need to go into the same directory as above to run.

You can put it into a new directory, but you need to put the shotgun_api3.py in there as well.

#
# setup imports.
import android,os,sys
# setup android
droid = android.Android()
# setup where to find the shotgun api on my phone
# I placed it in my sl4a scripts directory
#
scripts = os.getcwd()
scripts = scripts +'/scripts/'
sys.path.append(scripts)
from shotgun_api3 import Shotgun
#
#
# setup the api script and project im working on.
# this is how sg allows us to communicate with it.
#
SERVER_PATH = "server path"
SCRIPT_NAME = "script name here"
SCRIPT_KEY = "script key here"
#
#
# currently I am the only one using this.
# at a later date ill allow for other users.
userId = 188#kym watts
#
#
def replytoNote(noteId='',noteText='',userId=''):
 #  this is a base function for replying to a note in sg with some android ui
 #  bits added to the mix.
 #
 #
 noteID = droid.dialogGetInput('Value', 'enter noteid:', str(noteId)).result
 print type(noteID), noteID
 if not noteID == None:

  noteId = int(noteID)
  #
  #
  replyText = 'enter reply for note %s:' % (noteId)
  #
  noteText = droid.dialogGetInput('Value', replyText, '').result
  sg = Shotgun(SERVER_PATH,SCRIPT_NAME,SCRIPT_KEY)
  #
  #noteId = 974 #"pipeline - planning" note
  #noteText = 'Did you know if you put your mind to it.\nYou can do awesome things.\n\n'
  dReply = {
   'entity':{'type':'Note','id':noteId},
   'user':{'id':userId,"type":"HumanUser"},
   'content': noteText
   }
  #
  #
  sg.create("Reply",dReply)
  print 'msg sent to note id:%s'%(noteId)
else:
 print 'no note id returned.'

#
#
noteId = 1304
noteText = 'sent from my android phone.'
replytoNote(noteId,'',userId)

So some things that you need to update yourself before you run this for the first time:

SERVER_PATH = "server path"
SCRIPT_NAME = "script name here"
SCRIPT_KEY = "script key here"

These you need to get from your shogun server. It might be good in terms of tracking and debgging to create a api script just for this script.

userId = 188#kym watts

You will also need to know what your user name is , so that your reply’s will come from you and not the api script.

So thats pretty much it.
Some stuff i would like to add in the future is:

Functions to handle tickets and other things to reply to in shotgun.
Functions to deal with queue of reply’s till there is a valid connection with the sg server, this would mean i cn read my mail and do replys on the train and have them send when my phone has service again.

So what happens when you run this?

It will prompt you with 2 text inputs.

The First needs to know what the noteid is. This s the note you want to reply to.

The second is the text that you want to reply with. This text field will accept the enter key to seperate things with a new line.

If you can think of any other useful things this could have give me a shout at:

watts[ d o t]kym[ a t ]gmail[ d o t]com


Leave a Comment :, , , more...

ThemGreeks

by on Jul.24, 2011, under Uncategorized

Since April 2011 i have been activley involved with the animated short film called ThemGreeks.

What interests me most about the film is that everyone is working remotely, so there is a huge technology and infrastructure that has to be worked out to make this work.

 

 

 

Leave a Comment more...

arduino cont.

by on Jan.12, 2011, under Arduino, Coding, Electronics, Uncategorized

Some photos of the prototyping with the lcd and relay replacing the transistor, as well as my workspace:

arduino__cont_001arduino__cont_003arduino__cont_005

arduino__cont_008arduino__cont_010arduino__cont_012

arduino__cont_013

More Photos and code soon.

Leave a Comment :, , , more...

Jump in to Arduino 002

by on Dec.10, 2010, under Uncategorized

I have been crazy busy at the moment with work  and organising for christmas holidays.

I have been hanging out every thursday at the site3 lab (makerspace) here in toronto. There are some good friendly folks here. I could learn alot from them.

I havent spent much time on the hardware, thou i have found a small box i want to try and fit the project in.

I have done a ton of code work, because i can do that on any computer i have access to with out the arduino connected.

Here is my latest iteration:

</code>
/*
simple program for setting my canon cameras shutter time.

I do long welding glass exposures and this will come in handy so i wont need to hold the trigger down for too long.
The arduino will do that for me.

*/
//start includes
//http://www.arduino.cc/en/Reference/LiquidCrystal
#include <LiquidCrystal.h>
//end includes
//
// start shutter pins
#define SHUTTER 12    //definesthe shutter control
#define TRIGGER 11    // defines the trigger button
#define UP      10    // defines the +1 second button
#define DOWN    9    // defines the -1 second button
#define MODE    8     // defines the -1 second button
#define SECOND  1000  // defines how long a second is
// end shutter pins
//
// start shutter vars
long curTime = 1000; // sets the current time to be one second at the start of the program
int val = 0;           // this is the trigger button control
int modeButton = 0;
int upButton = LOW;
int downButton = LOW;
int currentMode = 0; // modes 1:,2:,3:
// end shutter vars
// shutter timing //
int idx = 15;
int lastMode = 99;
//
//backup
//String shutterSettings[]   = {"10'","9'30\"","9'","8'30\"","8'","7'30\"","7'","6'30\"","6'","5'30\"","5'","4'30","4'","3'30\"","3'","2'30\"","2'","1'30\"","1'","55\"","50\"","45\"","40\"","35\"","30\"","25\"","20\"","15\"","13\"","10\"","8\"","6\"","5\"","4\"","3\"2","2\"5","2\"","1\"6","1\"3","1","0\"8","0\"6","0\"5","0\"4","0\"3","NONE","4","5","6","8","10","13","15","20","25","30","40","50","60","80","100","125","160","200","250","320","400","500","640","800","1000","1250","1600","2000","2500","3200","4000","5000","6400","8000"};
String shutterSettings[]   = {"10'","9'30\"","9'","8'30\"","8'","7'30\"","7'","6'30\"","6'","5'30\"","5'","4'30","4'","3'30\"","3'","2'30\"","2'","1'30\"","1'","55\"","50\"","45\"","40\"","35\"","30\"","25\"","20\"","15\"","13\"","10\"","8\"","6\"","5\"","4\"","3\"","2\"","1\""};
//long delaySettings[]       = {600000000, 570000000, 540000000, 510000000, 480000000, 450000000, 420000000, 390000000, 360000000, 330000000, 300000000, 0, 240000000, 210000000, 180000000, 150000000, 120000000, 90000000, 60000000, 55000000, 50000000, 45000000, 40000000, 35000000, 30000000, 25000000, 20000000, 15000000, 13000000, 10000000, 8000000, 6000000, 5000000, 4000000, 3000000, 2000000, 1000000};
long delaySettings[]       = {600000, 570000, 540000, 510000, 480000, 450000, 420000, 390000, 360000, 330000, 300000, 0, 240000,210000, 180000, 150000, 120000, 90000, 60000, 55000, 50000, 45000, 40000, 35000, 30000, 25000, 20000, 15000, 13000, 10000, 8000, 6000, 5000, 4000, 3000, 2000, 1000};
//
// start lcd setup
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
// end lcd setup
//
// setup
void setup()
{
 pinMode(SHUTTER,OUTPUT);
 pinMode(TRIGGER,INPUT);
 pinMode(UP,INPUT);
 pinMode(DOWN,INPUT);
 pinMode(MODE,INPUT);
 //
 //
 Serial.begin(9600);      // open the serial port at 9600 bps:
 //                       // so we can see what the arduino is doing before we attach the lcd screen later.
 //lcd pins
 //
 // set up the LCD's number of columns and rows:
 lcd.begin(16, 2);
 lcd.clear();
 // Print a message to the LCD.
 //lcd.print("Shutter Cnt v004");
 printFirstRow("Shutter Cnt v004");
}
//
//  fuction to clear the whole first row.
//
void clearFirstRow()
{
 lcd.setCursor(0, 0);
 lcd.print("                ");
}
//
//  fuction to clear the whole second row.
//
void clearSecondRow()
{
 lcd.setCursor(0, 1);
 lcd.print("                ");
}
//
//    a function fo print stuff on the first line
//
void printFirstRow(String toPrint)
{
 clearFirstRow();
 lcd.setCursor(0, 0);
 lcd.print(toPrint);
}
//
//    a function fo print stuff on the second line
//
void printSecondtRow(String toPrint)
{
 clearSecondRow();
 lcd.setCursor(0, 1);
 lcd.print(toPrint);
}
//
//  pull the delay and the lcd text from the arrays using the index.
//
long setLCDReturnDelay(int id)
{
 //
 String displayTime = shutterSettings[id];
 long delayTime = delaySettings[id];
 //
 //  convert the time to something easy to understand on the lcd
 displayTime = displayTime.replace("'","m");
 displayTime = displayTime.replace("\"","sec");
 printSecondtRow(displayTime);
 String strid = id;
 Serial.print("DEBUG: index:"+strid+"\n");
 Serial.print("DEBUG: lcd print:"+displayTime+"\n");
 //Serial.print("DEBUG: delay time:"+delayTime+"\n");
 return delayTime;
}
/*
TODO:

 get modes working.
 // long exposure
 // time lapse
 // time lapse + long exposure
 // sound trigger?
 maybe:
 single exposure
 time lapse + multi exposure
 sound trigger

 frre mode to set the trigger time, or canon defualt:
 30",25",20",15",13",10",8",6",5",4, 3"2,2"5,2",1"6,1"3,1" 0"8,0"6,0"5,0"4,0"3,,4,5,6,8,10,13,15,20,25,30,40,50,60,80,100,125,160,200,250,320,400,500,640,800,
 1000,1250,1600,2000,2500,3200,4000,5000,6400,8000,
 extras:
 40",45",50", 55",1', 1'30",2',2'30",3',3'30",4',4'30,5',5'30",6',6'30",7',7'30",8',8'30",9',9'30,10'
 String shutterSettings[] = {"10'","9'30","9'","8'30"","8'","7'30"","7'","6'30"","6'","5'30"","5'","4'30","4'","3'30"","3'","2'30"","2'","1'30"","1'","55"","50"","45"","40"","35"","30"","25"","20"","15"","13"","10"","8"","6"","5"","4"," 3"2","2"5","2"","1"6","1"3","1" 0"8","0"6","0"5","0"4","0"3","NONE","4","5","6","8","10","13","15","20","25","30","40","50","60","80","100","125","160","200","250","320","400","500","640","800","1000","1250","1600","2000","2500","3200","4000","5000","6400","8000"};

 get down/ negative time sorted out
 //  currently if it is less than 1000 it become a negative.
 // cant delay in negative time.
 //
 get counter working for trigger delay
 // currently delay = curtime.
 // should be a for loop ,
 // for every second
 print curseccond of total time
 delay second

 // display mode and times in real world seconds.
 // display high speed in mili seconds and canon shutter settings.
 // 1000 ms  || 1sec
 // 1ms || 1000/sec

*/
// the loop function
void loop()
{
 // get the vars.
 upButton = digitalRead(UP);
 downButton = digitalRead(DOWN);
 val = digitalRead(TRIGGER);
 modeButton = digitalRead(MODE);
 //
 //
 // mode settings:
 //
 if (modeButton == HIGH)
 {
 if (currentMode >= 2)  // 2 is currently the highest setting.
 {
 currentMode = 0;
 }
 else
 {
 currentMode++;
 }
 //
 //
 //
 if ( currentMode != lastMode)
 {
 if (currentMode == 0)
 {
 printFirstRow("1:Single Exp");
 }
 else if (currentMode == 1)
 {
 printFirstRow("2:Time Lapse");
 }
 else if (currentMode == 2)
 {
 printFirstRow("3:Sound Trigger");
 }
 lastMode = currentMode;
 String strCurMode = lastMode;
 Serial.print("DEBUG: current Mode:"+strCurMode+"\n");
 }
}
 //
 if (upButton == HIGH)
 {
 // adds one second on to current time
 //
 curTime = curTime + SECOND;
 //
 Serial.print("DEBUG: up button in high\n");
 //
 if (idx != 36)
 {
 idx++;
 }
 else
 {
 idx = 36;
 }
 Serial.print(idx);
 curTime = setLCDReturnDelay(idx);
 delay(200);
 }
 if (downButton == HIGH)
 {
 /* a little more complex.
 the shutter doesnt understand negative numbers.... doesnt work like that
 */
 Serial.print("DEBUG: down button high\n");
 //
 if (idx != 0)
 {
 idx--;
 }
 else
 {
 idx = 0;
 }
 Serial.print(idx);
 Serial.print(curTime);
 Serial.print("\n");
 //lcd.setCursor(0, 1);
 //lcd.print(curTime);
 curTime = setLCDReturnDelay(idx);
 delay(200);
 }
 //
 if (val == HIGH)
 {
 Serial.print("DEBUG: value is high\n");
 // takes the photo.
 String secConvert = (curTime /1000);
 lcd.setCursor(0, 1);
 lcd.print("open for "+secConvert+"s");
 Serial.print(curTime);
 Serial.print("\n");
 Serial.print(secConvert);
 Serial.print("\n");
 digitalWrite(SHUTTER,HIGH);
 //need to convert to milliseconds in stead of micro seconds, some numbers too high.
 delay(curTime);
 digitalWrite(SHUTTER,LOW);
 //
 lcd.setCursor(0, 1);
 lcd.print("shutter closed");
 delay(500);
 curTime = setLCDReturnDelay(idx);
 }
 // delays the loop for a tad
 delay(200);
 //Serial.print("DEBUG: end loop\n");
}
<code>

I have added some functions to help with clearing and adding data to my lcd.

Also 2 arrays that i treat like a python dictonary, like a key / value system.

Thanks to the folks on the arduino forum for the help.
I set up shutter times for everthing over a second, because those are the most usefull to me a t the moment.

Im going to start looking at the Aiko library for the next iteration.

.

.

I will try in the next few days to post some new photos.

Leave a Comment more...

Some cool Arduino related links

by on Nov.17, 2010, under Arduino, Coding

Here are the links to some good pdf’s worth reading:

Arduino programming notebook, by Brian W. Evans. This book is a Reference on how to program with the Arduino language. I really like the way it is written.

Essential C , by By Nick Parlante , from Stanford CS department.  This is a good read for people new to c … It assumes that you have some programming experience.

Fritzing

Leave a Comment :, more...

Jump in to arduino

by on Nov.17, 2010, under Arduino, Coding, Electronics

So i spent the next evening converting the proof of concept over for use with the arduino.

I have added some extra bits:

1) A button for triggering the shutter.

2) A button to Increase the shutter open time.

3) A button to Decrease the shutter open time.

.

.

Parts used:

3 x small push buttons.

4x (insert ohms here) resistors

1x long breadboard.

1x npn transistor.

A ton of hook up wires.

.

The buttons were pretty straight forward to hook up, which was nice. The trigger button is connected to pin 12, the “add time / up” button is connected to pin 7 and the “reduce time / down” button is connected to pin 6.

.

second_go

The code to run the buttons looks like this:

</code>

/*
simple program for setting my canon cameras shutter time.

I do long welding glass exposures and this will come in handy so i
wont need to hold the trigger down for too long.
The arduino will do that for me.

*/

#define SHUTTER 13    // defines the shutter control
#define TRIGGER 12    // defines the trigger button
#define UP      7     // defines the +1 second button
#define DOWN    6     // defines the -1 second button
#define SECOND  1001  // defines how long a second is

int curTime = SECOND; // sets the current time to be one second at the
start of the program
int val = 0;           // this is the trigger button control

int upButton = LOW;
int downButton = LOW;

void setup()
{
 pinMode(SHUTTER,OUTPUT);
 pinMode(TRIGGER,INPUT);
 pinMode(UP,INPUT);
 pinMode(DOWN,INPUT);
 Serial.begin(9600);     // open the serial port at 9600 bps:
                         // so we can see what the arduino is doing
                         //before we attach the lcd screen later.
}
// the loop function
void loop()
{
 // get the vars.
 upButton = digitalRead(UP);
 downButton = digitalRead(DOWN);
 val = digitalRead(TRIGGER);

 if (upButton == HIGH)
 {
  // adds one second on to current time
  curTime = curTime + SECOND;
  Serial.print("up button\n");
  delay(200);
 }
 if (downButton == HIGH)
 {
  // removes one second from current time
  curTime = curTime - SECOND;
  Serial.print("down button\n");
  delay(200);
 }

 if (val == HIGH)
 {

  // takes the photo.
  Serial.print("Shutter will be open for: ");
  Serial.print(curTime);
  Serial.print(" miliseconds\n");
  digitalWrite(SHUTTER,HIGH);
  delay(curTime);
  digitalWrite(SHUTTER,LOW);
  Serial.print("shutter closed\n");
 }
 // delays the loop for a tad
 delay(200);
}

<code>

You’ll see that i have my “SECOND” variable set to 1001. I have been running into issues where the shutter open and close time doesn’t match a correct one second interval…. Which is really strange…

Also because i have no way at the moment to display the information, i’m sending debug prints to the serial, so i can view it on the serial monitor.

second_go

.

I found a really good explanation about the canon 3 pin connect Im interfacing with:

Canon N3 details.

.

To finish this project i have a few more steps to do:

a) Add another button to control the mode the device is in.

b) Get hold of a LCD to allow for real world use……

c) Refine the code,  I’m still learning the api,  so im sure i can clean this up a little and work out where my time is going.

d) Start to plan a durable storage case to house the project in.

second_go

.

Leave a Comment :, , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!