Importing Tilt Brush files into Houdini
Posted: November 28, 2019 Filed under: Uncategorized 2 Comments »Although Tilt Brush exports FBX files with the brush stroke geometry sometimes it can be useful to get the data in the .tilt file itself. The .tilt file contains the controller positions, orientations, trigger pressure and timestamps that Tilt Brush then creates stroke geometry from. In my case I particularly wanted the timestamps, as it makes Tilt Brush a simple 6-dof capture solution.
Houdini’s python integration and the Tilt Brush Toolkit make this fairly straightforward.
First you need to get the Tilt Brush Toolkit. You can either clone the git repo or download it from github, and you need to add the Python subdirectory to your PYTHONPATH environment variable.
Now you can use a Python SOP to process the .tilt file and generate geometry. Here is the code I use:
# This code is called when instances of this SOP cook.
node = hou.pwd()
geo = node.geometry()
# Add code to modify the contents of geo.
filename = node.evalParm('filename')
from tiltbrush.tilt import Tilt
tilt = Tilt(filename)
if tilt.sketch.filename:
filenameAttrib = geo.addAttrib(hou.attribType.Global, "filename", "")
geo.setGlobalAttribValue(filenameAttrib, tilt.sketch.filename)
brushAttrib = geo.addAttrib(hou.attribType.Prim, "brush", 0)
colorAttrib = geo.addAttrib(hou.attribType.Prim, "Cd", (0.0, 0.0, 0.0, 0.0))
sizeAttrib = geo.addAttrib(hou.attribType.Prim, "size", 0.0)
time = geo.addAttrib(hou.attribType.Point, "time", 0.0)
pressure = geo.addAttrib(hou.attribType.Point, "pressure", 0.0)
orientation = geo.addAttrib(hou.attribType.Point, "orient", (0.0, 0.0, 0.0, 1.0))
poly = geo.createPolygon()
for stroke in tilt.sketch.strokes:
poly = geo.createPolygon()
poly.setIsClosed(False)
for cp in stroke.controlpoints:
point = geo.createPoint()
point.setPosition([i / 10.0 for i in cp.position])
point.setAttribValue(orientation, cp.orientation)
point.setAttribValue(time, cp.extension[1] / 1000.0)
point.setAttribValue(pressure, cp.extension[0])
poly.addVertex(point)
poly.setAttribValue(brushAttrib, stroke.brush_idx)
poly.setAttribValue(colorAttrib, stroke.brush_color)
poly.setAttribValue(sizeAttrib, stroke.brush_size)
Now you have each stroke as a curve primitive, with point attributes for position, orientation, pressure and time. The orientation is a quaternion but you can convert that into a more useful normal and up vector with an Attribute Wrangle SOP:
v@N = qrotate(@orient, {0, 0, 1 });
v@up = qrotate(@orient, {0, 1, 0});
Sweeping a line SOP along the curves will give you an approximation of the actual stroke geometry.
No Siggraph calendars for 2016
Posted: July 18, 2016 Filed under: Uncategorized 4 Comments »If you’re looking for Siggraph calendars for 2016 I’m afraid I haven’t had time to put them together this year. Sorry!
Siggraph 2015 Google calendars
Posted: July 15, 2015 Filed under: Uncategorized 14 Comments »To add to your google calendars, cut and paste the blah@group.calendar.google.com address for the calendar into the “Add a friend’s calendar” box in the “Other calendars” list on the left side of the google calendar page.
Let me know if you see any errors. The schedule can change, and I endeavor to update these when I see changes.
- Courses
8l06oq1i0r1msr2hegqjgaji0o@group.calendar.google.com
- Papers
899d9osiuvb9n3ke98ikvvk2r0@group.calendar.google.com
(And links to the papers) - Talks (including panels)
55g0chci5ifmsp8crcnor3ubus@group.calendar.google.com
- Special events
re6h03maiuhmlimhunl0m9p0fo@group.calendar.google.com
- Birds of a feather
vaav23f89q12t1im1uoakkf1ec@group.calendar.google.com
Siggraph 2013 google calendars
Posted: June 24, 2013 Filed under: Uncategorized 14 Comments »To add to your google calendars, cut and paste the blah@group.calendar.google.com address for the calendar into the “Add a friend’s calendar” box in the “Other calendars” list on the left side of the google calendar page.
Let me know if you see any errors. The schedule can change, and I endeavor to update these when I see changes. Parties: I don’t get invited to them anymore as I’m nobody’s customer, so you’re on your own 😉
- Courses
7dt1m4p5b5csqgi3m8lorogv9c@group.calendar.google.com
- Papers
k0eohhf6ge1q4jjdedm165157s@group.calendar.google.com
- Talks (including panels)
u8oideatih0joc794rur893leg@group.calendar.google.com
- Special events
j9g3t3f12kmqlg2b3r96a87om0@group.calendar.google.com
- Birds of a feather
880kqdmf86cd68rsvcoohp6ar8@group.calendar.google.com
And maybe I’ll see you all in Anaheim for beers!
Update: See this great set of links to conference content.
Comparing 160-bit hash values with SSE
Posted: September 13, 2009 Filed under: Uncategorized 2 Comments »I’m writing this up as it’s one of those things I was trying to do and thought I’d just be able to crib how to do it from the Internet yet a good amount of googleing turned up nothing. So here it it for anyone else looking for the same thing.
Projection mapping Arthur’s Seat
Posted: June 21, 2009 Filed under: Uncategorized | Tags: old stuff 1 Comment »Here’s something fun I found while clearing out the hard drives on my old pc—my undergraduate graphics project. Basically it involved projection mapping photographs of Arthur’s Seat (a big hill in Edinburgh) onto a model created from map contours. Here’s a couple of videos:
Looks like shit, huh? But it was a big deal for an undergraduate in 1997 😉
My first plugin
Posted: June 5, 2009 Filed under: Uncategorized | Tags: flame, old stuff Leave a comment »My first vfx job was with Smoke & Mirrors in London—I use the word ‘job’ in the loosest sense, as they were actually part-sponsoring my doctorate and part of the deal was that they had to employ me for three months over the three years (it was actually more complicated than that, involving a subsidiary that went bust, but that’s a story for another day).
Siggraph sketch that never happened
Posted: June 1, 2009 Filed under: Uncategorized | Tags: phd Leave a comment »Back in 2003, I submitted a sketch to Siggraph on my thesis work. I had been working at Framestore for a few months, was waiting for the University to organise my viva and figured that if I got something accepted I might have a fighting chance of getting someone else to pay my airfare to San Diego.