Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

HTC Vive Development Environment

Helpful techniques for working with TouchDesigner. Answers only, no questions.

Re: HTC Vive Development Environment

Postby jarrett » Mon Feb 20, 2017 6:53 pm

Hey John!

I think version one was missing the teapot geo. I have updated to ViveDevEnvironment_Rev2.zip. Let me know if you are still having trouble, but I just double checked and all references are relative to the toe file.

J
______________________
Jarrett Smith
Derivative
User avatar
jarrett
Staff
 
Posts: 68
Joined: Tue Nov 13, 2007 1:12 am
Location: Los Angeles

Re: HTC Vive Development Environment

Postby anodin » Tue Feb 28, 2017 5:13 pm

Really Nice.
It help me to create teleport mode.
Cheers
anodin
 
Posts: 158
Joined: Tue Jun 21, 2011 4:40 pm
Location: Montreal

Re: HTC Vive Development Environment

Postby jarrett » Thu Mar 02, 2017 3:48 pm

A small fix to the teapot example object found in /openVR/resources. teapotExample had a bad reference from in the pickGeo COMP to the Callback COMP - it was parent.Sphere and should have been parent.Teapot. As well I added a very simple extension to the teapot called TeapotExt. You can see this extension by right clicking on the teapotExample component and select "Customize Component" from the popup menu.

In the dialog scroll down to the Extension section and press "Edit". This will open a text editor and will reveal this code...

Code: Select all
"""
Extension classes enhance TouchDesigner component networks with python
functionality. An extension can be accessed via ext.ExtensionClassName from
any operator within the extended component. If the extension is "promoted", all
its attributes with capitalized names can be accessed directly through the
extended component, e.g. op('yourComp').ExtensionMethod()
"""

class TeapotExt:
   """
   TeapotExt description
   """
   def __init__(self, ownerComp):
      # The component to which this extension is attached
      self.ownerComp = ownerComp

   def HandlePick(self, info):
      debug('teapot pick handled', info)




I simply added the HandlePick function which is passed the standard info dictionary with all the contextualized controller information.

For those getting deeper into Python I recommend this new doc written by Ivan...

https://www.derivative.ca/wiki099/index ... t_Examples

It gets into a very interesting extension module that is part of 099 called CallbacksExt. It is a good example that covers why we have standardized on this single "info" dictionary for passing data between components and modules.

Find the latest revision at the top of this thread.

J
______________________
Jarrett Smith
Derivative
User avatar
jarrett
Staff
 
Posts: 68
Joined: Tue Nov 13, 2007 1:12 am
Location: Los Angeles

Previous

Return to Techniques

Who is online

Users browsing this forum: No registered users and 1 guest