Tweak Software Support

Jim Hourihan September 28, 2011 6 Knowledge Base

Frequently Asked Questions About Python in RV

  1. Where is the documentation for the RV command API?

    Right now we don't have a Python specific way to read the docs. However, the Mu API doc browser does have the information. Help->Mu Command API Browser will launch the doc viewer. The leftmost column has  items marked with a blue icon: these are Mu modules (these roughly correspond to python modules). The "commands" and "extra_commands" modules in Mu are documented and make up the RV API to both Mu and Python. So by reading those docs you can figure it out (plus they have the real types that will be returned)

    Something to note about the doc browser: there's a search bar at the top of the window. 

  2. What version of Python are you using?

    Python 2.6

  3. Can you make it version agnostic? Why Python 2.6?

    For better or worse, we plan on tracking what the foundry is using. Its already too complicated out there. 
     
  4. When I try to call a function in rv.commands its failing. Why?

    We do not yet handle default arguments so you have to supply all of the command arguments.
     
  5. How do I make UI in Python?

    You can use either PySide or PyQt to make Qt interface components (RV is a Qt Application). We don't have specific support for either one of these Qt wrappers in Python, but both should work. PyQt is by far the more common wrapper of the Qt API.

    For completeness you should know that the makers of PyQt require a license to use their code (even in RV). We don't have that license and even if we did its not transferable to the end user (it would only cover our use of it). However you can purchase a license from them if you want to be in full compliance with their licensing. PySide has no such license requirements.

  6. Can I draw on the view the way Mu does using OpenGL? 

    Yes. If you bind to a render event you can draw using PyOpenGL if you have it installed.

  7. Didn't you guys say Python would cause performance problems with OpenGL drawing?

    Yes. But we were probably wrong. The issue was whether or not Python's cyclic garbage collector would run in the middle of a render. Turns out it only runs when you're almost out of memory.  

  8.  Can I call existing Mu code from Python?

    Yes. The reference manual has a section on this. You can wrap any Mu function using a MuSymbol in Python and then call it. This is how the command API is constructed in Python. 

  9. How was Python compiled for RV (and Unicode Support)?

    On OS X we don't actually compile Python, but instead are using the OS provided Python 2.6 installation and .dylib. That version uses UCS2 for unicode. Modules that load in the system python 2.6 should work in RV.

    On Windows we compile UCS2 using VC9.
     
    Linux is UCS4  since most of the distros use that. We use GCC 4.2 to compile on Linux.
     
  10.  Module XXX is missing. Where can I get it?

    If the module is a "standard" Python module (it comes with the Python distribution for the platform you are on) than its hopefully included. For openSSL dependent modules, we may build it but not include openSSL. On OS X we use the system Python 2.6 so if your module runs in the system python interpreter it should run in RV. On Linux we've tried to make sure everything is included. On Windows we compile the same way that the Python binary distribution is compiled. 

    If the module is not included and its a CPython module (written in C) you will need to compile it yourself.

  11. The commands.bind() function in Python doesn't work the same way as in Mu? How do I use it?

    The Python version currently requires all arguments to bind(). So to make it the "short form" do:
    bind("default", "global", event, func, event_doc_string). 
     
  12. Can I do leader and overlay scripts in Python for RVIO?

    Not yet. But we hope to get that working in the near future.
     
  13. Doesn't the Python <-> Mu bridge slow things down?

    Maybe not a frequently asked question, but the answer is: not really. The MuSymbol type used to interface between them can completely skip interpreted Mu code if its calling a "native" Mu function from Python. All of the RV commands are native Mu functions. So there's a very thin layer between the Python call and the actual underlying RV command (which is largely language agnostic). 

    The Mu calling into Python bridge is a bit trickier: its basically the CPython API exposed. So its roughly the cost of calling a Python function from C.
     
  14. Why does my external Python process (which I call from RV) now behave differently?

    This is probably caused by the fact that RV modifies the PYTHONPATH to incorporate $RV_HOME/plugins/Python and $RV_HOME/lib/python2.6 in order to run. Forked processes will inherit the PYTHONPATH. If you are using QProcess to launch the external process you can call QProcess.setEnvironment() to set the PYTHONPATH prior to calling QProcess.start().

Jim Hourihan September 27, 2011 2 Knowledge Base

Executive Summary:

RV now ships with Python in addition to Mu for scripting and extending the application cross platform. Python is a full peer to Mu as far as RV is concerned. The command API is almost identical between the two.

In order to extend RV using Python you will be making a "mode" as part of an rvpkg package -- this is identical to the way its done in Mu and this is the method that we use internally to add new functions to RV's interface. Creation of a modes and packages is documented in the reference manual. Please read the relevant sections to understand how its done. Here is a very simple mode written in Python which is part of $RV_HOME/rvpkgs/pyhello-1.0.rvpkg. You can add and install $RV_HOME/rvpkgs/pyhello-1.0.rvpkg to see it working.

import rv.rvtypes
import rv.commands

class PyHello(rv.rvtypes.MinorMode):
  "A simple example that shows how to make shift-Z start/stop playback"

  def togglePlayback(self, event):
    if rv.commands.isPlaying():
      rv.commands.stop()
    else:
      rv.commands.play()

  def __init__(self):
    rv.rvtypes.MinorMode.__init__(self)
    self.init("pyhello",
              [("key-down--Z", self.togglePlayback, "Z key")],
              None)

def createMode():
  "Required to initialize the module. RV will call this function to create your mode."
  return PyHello()


Documentation:

Please read the *reference manual* which is available on-line here:

http://www.tweaksoftware.com/static/documentation/rv/current/html/rv_reference_frames.html

or from RV's Help->RV Reference Manaul menu items.

The command API is nearly identical to Mu. There are a few modules which are important to know about: rv.rvtypes, rv.commands, rv.extra_commands, and rv.rvui. These implement the base Python interface to RV.

We currently do not have seperate documentation for RV's command API in Python (e.g. via pydoc), but you can use the existing Mu Command API Browser available under RV's Help menu. The commands and extra_commands modules are basically identical between the two languages. We hope to have a pydoc solution in the future.

If you are not familiar with Python please visit python.org to find relevant documentation, books, and tutorials. We cannot answer support questions about Python the language but we are happy to help with questions regarding RV's Python integration and Python command API.

(NOTE: edited to use import instead of "from")

 

Seth Rosenthal April 07, 2011 Announcements

Hello from Tweak,

We have a new RV release and some upcoming news about a cool project with Tweak and ARRI. Also, we have built a smoking hot example workstation for NAB to show off RV, RV SDI, Nuke integration and 2K streaming playback. Lots of you ask about good hardware setups so we are sharing the specs below.

RV 3.10.13 Available for Download

This is an update release with lots of refinements and fixes. You can read the release notes here and download the new version from the downloads page on the tweak website here.

This version of RV is FREE for users with current maintenance. If you need to renew your maintenance, please contact us at sales@tweaksoftware.com.

A few highlights of 3.10.13 include:

  • Nuke package: Full stereo support including checkpoints and renders using %Vv workflow
  • Nuke package: Write node handling similar to read nodes
  • Shotgun package: Full stereo support for %Vv-style stereoscopic media
  • Shotgun package: automatic fallbacks for Pixel Aspect, frame range, and media type

Tweak and ARRI

Tweak has been collaborating closely with the engineers at ARRI and we have some big news about RV that will be announced next week at NAB. Please stop by our booth SL9707 to see more.

RV Workstation

  • RV + Nuke + SDI + Fusion-io ioXtreme + Shotgun is a powerful setup for getting work done. We've built a workstation to show it all off at NAB. The winning setup is:
  • HP z800 Workstation
  • 6 core Xeon with hyperthreading
  • 12 Gigs RAM
  • Nvdia Quadro 3800 SDI graphics
  • Dual FusionIO ioXtreme Pro RAID
  • HP DreamColor Monitor with 10 bit color and extended color gamuts

The system can stream 2K full app DPX frames from disk at 80+ fps. It makes working with film res imagery a snap: you can move around a complex RV session, switch views instantly, scrub easily and immediately see what you need. Of course, with RV SDI you can send the results to your projector or broadcast monitor.

Cheers,

The Tweak Crew

Seth Rosenthal March 29, 2011 Announcements

RV SDI is finally here. Many of  you have requested the ability to play out from RV directly to your projectors (particularly in stereo) and our new product does just that. We announced yesterday our plan to show RV SDI at NAB in April. It is currently in Beta testing on Linux and Windows.

We will be at NAB in Las Vegas April 11-14 in Booth SL9707. Please stop by to say hello and check out our latest stuff. We will be demonstrating RV SDI, the latest RV/Nuke tools and the latest RV/Shotgun integration.

RV SDI Overview

RV SDI matches the flexibility of RV's dailies sessions with full quality SDI output. RV SDI supports dual stream output for stereo playback, embeds audio in the SDI signal, and takes advantage of RV's flexible tools for review, editing, collaboration, annotation, and comparison of media.

RVSDIScreenshot.jpg

RV SDI Key Features:

  • Stereo playback over Dual Link SDI: using Nvidia SDI hardware
  • High Resolution, high bit depth
  • 24 bit embedded audio
  • Playback: 2K, HDR, Floating Point, Playback from RAM or Disk
  • Review: Organize and annotate media dailies review
  • Collaboration: Connect to other artists, clients or vendors for remote review
  • Editing: Edit sequences with lightweight intuitive tools
  • Comparison: Layout shots or cuts in tiled views, A/B compares with wipes
  • Integration: Script, customize, automate RV to fit into your pipeline or workflow

RV Presentation Mode

RV SDI introduces Presentation Mode. This mode allows users to control RV normally on one monitor while sending video out to another device. The controller view displays the RV GUI and the SDI presentation device sends final output through the SDI channel for display on a projector or monitor (with options to view the timeline and other tools on the SDI view)

RV Sessions for Dailies

 RV's rich session file is a powerful tool for organizing dailies. The session manager makes it easy to combine, compare, edit and annotate media. You can create sessions in advance of dailies with all of the versions, sequences, A/B split screens, layouts or other items to review.

During dailies you can work through your playlist, see shots in context or alone, annotate, edit the timeline, switch versions, and easily create new views on the fly.

Some things you can do with RV sessions include:

  • Layout sources in a 'contact sheet'
  • Compare two or more EDLs (A/B, layout)
  • Create an edited sequence with alternate takes to swap in/out
  • Retime media (pull up/down, change fps, offset)
  • Make and edit sequences, re-order, trim
  • Annotate on top of any view
  • Export WYSYWIG to a snapshot or a movie

The RV session is fully recursive. This means you can recombine anything you make in RV in new ways. For example, You could make a layout of sequences, or a sequence of layouts. Or you could make Folders of alternate takes and then make a sequence of folders.

Integrate

RV is highly customizable and can be knit very tightly into custom dailies workflows. RV session files are ascii files in an open source format (GTO). Many shops integrate editorial and production databases with RV by writing Python scripts to create custom RV sessions for dailies.

 session_manager.png

Mix resolutions, frame rates, and color spaces automatically

  • RV is resolution independent, which means you can mix sources of different resolutions and RV automatically fits them to the display window. No manual resizing is required to cut together mixed resolution sources (say SD reference video with Full App EXR renders and 1/2 res animation takes)
  • Realtime pull-down/pull-up to handle any frame rates. RV automatically retimes media to play it back at the output fps (even for fixed rate SDI playback) so you never have to pre-convert media before viewing it in RV. This means you can cut together media of different frame rates into the same timeline, layout, or A/B compare.
  • Advanced Color Management - RV converts media into a common color space so sources with completely different color spaces can be edited together and compared and can use the same display LUTs or other color settings. For example you can cut together Kodak Log DPX frames with sRGB Quicktime video and Linear Exr files and preserve the correct colors.

Alan Trombla August 17, 2010 Announcements

It's so alliterative we should have done it long ago!   Tweak now has a twitter presence here:

twitter.com/tweakrv

We'll try to post every day or so with news and tips.  If you have ideas about what you want to see on tweak's twitter, please let us know!

Alan