Importing Tilt Brush files into Houdini
Posted: November 28, 2019 Filed under: Uncategorized 1 Comment »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 3 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 13 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 2014 google calendars
Posted: July 3, 2014 Filed under: siggraph 3 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
72fnpqucdp76krclc22qu8fmj4@group.calendar.google.com
- Papers
2b4825rl9v95qobo37aq7ethrs@group.calendar.google.com
(And links to the papers) - Talks (including panels)
aam6k1a94kt8q9rh3necnunvds@group.calendar.google.com
- Special events
fcnc7g31lenqhli41s2usotd8s@group.calendar.google.com
- Birds of a feather
av4bm8og2ivjs92ubolap4cr6s@group.calendar.google.com
And maybe I’ll see you all in Vancouver for beers!
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.
Siggraph 2012 google calendars
Posted: July 11, 2012 Filed under: siggraph 8 Comments »Here we go again…
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. Also there don’t appear to be any room assignments for Birds of a Feather sessions yet; I’ll update the calendar if I get this information.
- Courses
4suceenkrqc6j5keokle3fjlg8@group.calendar.google.com
- Papers
20pnmfuah7jr9gqnimq891r1k4@group.calendar.google.com
- Talks (including Panels)
89rd0sopbcp9efnuh3sf2n5j0s@group.calendar.google.com
- Special Events
lod9c4rufv2qm1527fr90ahaso@group.calendar.google.com
- Birds of a Feather
aie5q3cjahflg52pqdlul7u44g@group.calendar.google.com
Working with Karotz
Posted: July 7, 2011 Filed under: karotz, sfmuni 1 Comment »A few months ago after seeing a friend’s Nabaztag I eventually ordered a Karotz, it’s spiritual successor. Alas it arrived the same day as my new piano so it sat ignored for a couple of months. Then last week I figured having dropped $200 on it I should get it to do something more useful than playing french internet radio. So here it is telling me when the bus is coming (something I otherwise have to open up the laptop for):
Siggraph 2011 google calendars
Posted: June 12, 2011 Filed under: siggraph 5 Comments »Here it is—this year’s Siggraph schedule in handy calendar format!
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. Also there don’t appear to be any room assignments for Birds of a Feather sessions yet; I’ll update the calendar if I get this information.
- Courses
4of3kkklmktjdp2q265564051o@group.calendar.google.com
- Papers
h56bvn41esnc27as13f9dosgs4@group.calendar.google.com
- Talks (including Panels)
hua89dv3lah5km1d157q24u0r4@group.calendar.google.com
- Special Events
f1ql8qlkit7jrem2usgk1svreg@group.calendar.google.com
- Birds of a Feather
19r973gn72aunblaem6c2tgc6c@group.calendar.google.com
SIGGRAPH 2010 google calendars
Posted: June 10, 2010 Filed under: siggraph 5 Comments »Back by popular demand!
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.
- Courses
e1980aphrhr0ifb1qitoh4hmu0@group.calendar.google.com
- Panels
ee5kcj6jll596j2rpjv90978ng@group.calendar.google.com
- Papers (Previews from Ke-Sen Huang)
39spm5aoav39om1nm8sg0a6n6s@group.calendar.google.com
- Talks
8afrj4lpp7lg027cppibus5rg0@group.calendar.google.com
- Special events
o0129tkgslt07rvl3drcbn9s6s@group.calendar.google.com
- Birds of a Feather
sbj0roal68qi3tu11humgrn8ro@group.calendar.google.com
Any errors or something to be added? Mail me at c.j.wills@acm.org
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.