python log

Setting up python and pyside for CG pipelines

Python for CG pipelines.

Python 2.7 is the tool of choice for linking CG pipelines. Custom tools speed up repetitive workflows and help you concentrate on the art rather than data entry or trouble shooting. You can create python tools to enable CG packages to talk to each other and to shot management software such as FTrack and Shotgun.

Python has a massive online presence and one can find code snippets to do almost anything. To some extent the hard part is choosing the best tools out of a vast array of choices. Here is my setup.

Installation

Install python2.7

https://www.python.org/downloads/
If you’re running a 64bit version of windows make sure to look for the Windows x86-64 MSI installer.

Setup python environment

Add Python path as an environment variable

My Computer > Properties > Advanced System Settings > Environment Variables >

To the system variable path add

 c:\python27;c:\python27\scripts; 

To check if its working simply open the command window and type

 python 

more info here https://docs.python.org/2/using/windows.html

Check the video here video tutorial: adding python to a DOS path

Install pyside

with python 2.7 you can install pyside directly using pip

Open the cmd ( command window ) in windows and simply type

 pip install -U PySide 

Install qt

You can get the latest version of Qt from there site. There are various flavours but if you happy to go open source then download it here http://www.qt.io/download-open-source/

If you do go open source share your code on gitHub

QTdesigner and pyside

Qt Designer is a basic UI designer for Qt. It’s worth take time to understand the layout framework. but really its pretty simple to use and you can get upto speed quite quickly.

QtDesigner creates .ui xml data. To turn it into something we can run we first need to convert it to Python code. To do this we use the pyside-uic command.

https://wiki.qt.io/QtCreator_and_PySide

pyside-uic mainwindow.ui -o mainwindow.py

You can do this in the command window but if your doing a lot of work on the same file I find it quicker to create a .bat file in the same folder as your .ui file.

Sub class the Qt UI generated by pyside

My notes from This tutorial

Because Qt UI file is automatically generated you do not want to make edits directly to it. Your edits would be overwritten everytime you update the UI in Qt-Designer

This means that in order to interact with the GUI that we have created in Qt Designer we need to create a separate file for the rest of our application code.

By subclass our  Ui_mainWindow class we can extend it with the functions we need like this

import sys
from PySide.QtGui import *
from PySide.QtCore import *
from ui_mainWindow import Ui_mainWindow

class MainWindow(QMainWindow, Ui_mainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.setupUi(self)
        self.assignWidgets()
        self.show()

    def assignWidgets(self):
        self.goButton.clicked.connect(self.goPushed)

    def goPushed(self):
        self.goText.append("Go, Go, Go!")

if __name__ == '__main__':
    app = QApplication(sys.argv)
    mainWin = MainWindow()
    ret = app.exec_()
    sys.exit( ret )

Useful Python APIs

FTrack

Ftrack API is very simple to use and is well documented. It also needs a pathmap added to the PYTHONPATH user variable, there is an option to do this automatically during the installation.

EPP

The Eyeon production pipeline is an open source project for shot management. Its based around BMD Fusion and Generation.

https://github.com/eyeonSoftware/epp

https://github.com/eyeonSoftware/epp/wiki/Installation

BMD Fusion (only uses 64bit python)

The latest version of fusion 7 has python console . But it only works with 64bit versions of python2.7+ or python 3.4+

The is a community driven python project here: https://github.com/BigRoy/fusionscript

Evernote

This webclipper and collaborative documentation tool has a python API (and many others). I’ve yet to use it. If anyone has experience please comment.

pywin32

pywin32 is a python library to talk to the Windows API and registry. This is needed to set system wide environment variables. Get the proper version from: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218

 

 

Make space on your hard drive using treemaps

Somehow the 60GB on my SSD is never enough for windows (sigh) and I’m always doing house cleaning to make sure it has enough free space. Treemaps help me visualise the data and clear out the biggest space hogging offenders.

I designed my desktop I opted for a superfast but small SSD drive for the windows OS and a big 1TB raid for everything else ( i’ve also another 200MB SSD for cache files and program files). VFX generates a bucket load of data. It’s important to keep on top of my house keeping.

Continue reading

How to remove the annoying wacom circles in windows

This will show you how to remove the annoying circles that appear in windows 7 and windows 10 when you use a wacom tablet.They’re for touch screens, and you don’t need them if you have the wacom pen buttons.  They just get in the way and slow you down.

How to remove the pen and touch right click… (the radar circle)

1.Open the windows control panel.
2.Select ‘pen and touch’
3.In ‘pen options’ select ‘press and hold’ and press the settings button.
4.Uncheck the ‘enable press and hold for right-clicking’ option.
5.click ok to close the dialogs.

Windows Press and hold settings

How to remove the splash circle in windows 7

1. Click windows start and type gpedit.msc into the command line
2. Click gpedit.msc from the programs list to open the ‘local group policy editor’
3. Navigate to… User Configuration > Administrative Templates > Windows Components > Tablet PC > Cursor.
4. Set ‘Turn off pen feedback’ to enabled.
5. Now navigate to… Computer Configuration > Administrative Templates > Windows Components > Tablet PC > Cursor.
6. And again Set ‘Turn off pen feedback’ to enabled.

How to remove the splash circle in windows 10

  1. press windows key
  2. type “settings” and hit enter
  3. click on “devices”
  4. Select “Pen” from the left column (if it’s not there, first install the wacom driver for your tablet)
  5. Turn “Show Visual Effects” off
  6. Close the settings dialog

Turn off windows Ink.

I was still getting some glitches in windows 10 where the wacom pen failed to left click. This seemed to cure the problem.

  • You can turn off windows ink in the wacom tablet preferences.
  • Choose the ‘Mapping’ tab then uncheck Use windows Ink

Disable Windows Ink


Disable flicks

The radar circle and the splash circle are the things that really bug me when I’m using the wacom pen. But you can also dig a bit deeper…

Disable flicks in windowsHow to disable flicks

1.Open the windows control panel.
2.Select ‘pen and touch’
3.Choose the flicks tab
4.Uncheck ‘Use flicks to perform common actions quickly and easily’.
5.Uncheck ‘Display flicks icon in the notifications area’
6.click ok to close the dialogs.

Additionally you can turn off all the tablet PC components

1.With the control panel view in “view by category mode”.
2.Go into Control Panel > Programs > Turn Windows Features On or Off
3.Untick the Tablet PC Components

And Finally

It melts my brain that this is still an issue in windows 10. Hopefully the solutions above will help. If you try working through in stages you’ll get a feel for what windows trying to do and how it messes up Wacom.

…. So then there’s windows uac to fix ….

The macbook’s missing hash key etc.

The macbook pro has no # key. Which is a bit of a pain if you’re writing maxScript.

On the max os side the shortcut is ( Alt + 3 )
But if you use bootcamp the windows side the shortcut is ( Ctrl + Alt + 3 )

just so you know 🙂

A few useful short cuts while using windows and boot camp

Print Screen:   Fn-Shift-F11
Print active window:  Fn-Shift-Option-F11