SketchUp to Vue ruby script

This script is a ruby plugin for google 'SketchUp' that exports SketchUp cameras to E-on's 'Vue' digital environment software.

Click on the image above to download a zip file containing all the files and tutorials required.

Thanks to Pete Stoppel for the pdf tutorial, and Grant Marshall for some of the source code.


Vue to Nuke camera import python script

Simple piece of code to transfer static cameras between 'vue' and 'nuke' - useful for setting up projections

Copy and paste the following code into nuke's script editor

You'll have to write down the camera information in vue by hand - i haven't worked out how to automate this step

posx = float(nuke.getInput('vue camera x translation', '0'))
posy = float(nuke.getInput('vue camera y translation', '0'))
posz = float(nuke.getInput('vue camera z translation', '0'))
rotx = float(nuke.getInput('vue camera pitch', '0'))
roty = float(nuke.getInput('vue camera roll', '0'))
rotz = float(nuke.getInput('vue camera yaw', '0'))
focal = float(nuke.getInput('vue camera focal length', '0'))
hor = float(nuke.getInput('vue camera horizontal field of view', '0'))
vert = float(nuke.getInput('vue camera vertical field of view', '0'))

px = posx
py = posz
pz = -posy
rx = (90-rotx)
ry = (rotz-180)
rz = roty

import math

hor_new = math.radians(hor)
vert_new = math.radians(vert)

h = (focal*2)*(math.tan((hor_new/2)))
v = (focal*2)*(math.tan((vert_new/2)))

cam = nuke.nodes.Camera()

cam.knob('translate').setValue((px, py, pz))
cam.knob('rotate').setValue((rx, ry, rz))
cam.knob('focal').setValue(focal)
cam.knob('haperture').setValue(h)
cam.knob('vaperture').setValue(v)


Nuke CSV file to axis nodes python script

Another small, rather crude piece of code.  The idea of this one was to re-create a vue ecosystem as a series of cards in nuke

You'll need a CSV file as an input - nuke will create an axis node and a transform geo node for each line in the file

filename = nuke.getFilename('csv file')

file=open(filename,'r')

count=0
check=0

line = file.readline()
count = line

i=1
while i < count:
    line = file.readline()
    if not(line):
        break

    line=line.strip()

    bits=line.split(',')

    x=float(bits[1])
    y=float(bits[2])
    z=float(bits[3])
    rx=float(bits[4])
    ry=float(bits[5])
    rz=float(bits[6])
    sx=float(bits[7])
    sy=float(bits[8])
    sz=float(bits[9])
    label=str(bits[10])


    a=nuke.Axis()
    a.knob('translate').setValue((x,z,-y))
    a.knob('rotate').setValue((rx,rz,ry))
    a.knob('scaling').setValue((sx, sz, sy))
    a['xpos'].setValue(0)
    a['ypos'].setValue(i*100)
    b=nuke.TransformGeo()
    b.knob('label').setValue((label))
    b['xpos'].setValue(100)
    b['ypos'].setValue(i*100)
    i=i+1