Background multiplication Technique

If you were to know a background completely, and an occlusion map, you could subtract it from a composited image.

This doesn’t work on real footage very well however, parts where the background is guessed incorrectly are very apparent.

Knowing this, some instead use premultiplication, however this while being great for full background or foreground areas, is bad for areas which are partly both.

VSCODE

Installing extensions without Internet

Extended Instructions are here

In the marketplace there is a Resources section, from there you can download a .vsix file

Then there is a command to Install from VSIX in the Command Palette Ctrl+Shit+P

python is here

If ssh is available, you can use rsync

ssh <hostname>

to check the the install directory

hostname can be found in linux under /etc/hostname (which you can see from a browser if need be.)

rsync -av <source dir> <user>@<hostname>:<target dir>

to transfer files across

Nuke as a Python Module

Nuke can be run in other python environments by importing the nuke.so file in

<nuke folder>/lib/python2.7/site-packages

This root is found can be found by

import nuke
print nuke.__file__

you’ll have to sys.path.append(<that directory>) first, and then

this will also ask for a license, so you also need to tell nuke where to get it.

There is an environment variable

os.environ[‘foundry_LICENSE’]

you can set this to point python to your license manually, and then finally;

import nuke.so

(editing the usrlocal.pth of your Python (2.7.16) install can also help with the first step)

This will actually run nuke in the interpreter.

VSCODE remote debugging nuke

With debugpy, you can attach the VSCODE debugger to a running python process (not sure if you even have to have debugpy on the path of the running process)

To get the process id, just

Import os

os.getpid()

In vscode just attach the process with the pid and you’re done. You get all nice development auto fill in the debug terminal and everything.

Nuke – never create Shift + shortcuts for creating nodes.

In nuke you can create a blur node by pressing B.

With Shift+B you can create a blur node and have the output not connected to the stream.

This actually works with any node, even for custom menu items; holding Shift is recognized by nuke, so any node you create will come in detached. This behavior cannot turned off!

So, even though it’s possible to create a menu item that creates a node with the shortcut Shift+(key), from a user perspective it is definitely not a not a good idea.

Context Menus

Right Click Menus with PySide

To enable a custom context menu, the qwidget class has a signal customContextMenuRequested, and a flag to enable the signal setContextMenuPolicy (which takes one of a number of options)

customContextMenuRequested, provides a QPoint object, from which the index of the Item that was right clicked on can be derived.

One of the flags for the context menu allows displaying of the action menu if that’s to your liking instead

Model View Controller (programming architecture)

Logically separating code, for optimisation of loading and finding again later, is part of programming.

The MVC structure is way of separation for guis.

PurposeExampleeg. language
Modelthe interface to the dataa databasesql
Viewto provide an interface to the usera panel with buttonsopengl
Controllerthe connector between the gui signals and data manipulationan adapter scriptpython

making a widget full a window

In Qt Designer, this isn’t an obvious thing.

The critical step is realizing that you can add a layout to the central widget. This is done by using the buttons at the top of the window while selecting the widget. It is reflected in the properties panel, adding a Layout section below.

From this section you can also remove any margins.

Git

A git repository is a way of storing a directory of files and track the changes to the files (so that we can go back or see what has happened later in simple or complicated ways). Information that git uses is stored in the .git folder, organised in a way that git understands.

Changes

Once we’re happy with the changes to the files in our directory, we Commit the changes for tracking. Sort of like a checkpoint.

Branches

A Branch can be thought of like a deviation in the list of changes, or a way of grouping sets of changes together, as part of a particular task. Branches have a name, and are usually is intended to be merged into the master branch of changes later.

Git remembers the current branch you are working on.

Since a branch can be made anywhere along the list of changes and can also have it’s own branches the repo structure looks like a tree.

When we Commit, we track those changes with the current branch.

To change the current branch (and change your local files to have the latest changes of the branch) we Checkout that branch.

Remote Repository

While the local repository tracks changes you have made, the remote repo is a copy of it, that others also interact with.

Git remembers the current remote repo.

Typically the source repo is stored using the name origin.
To copy our repos local changes to the remote repo we Push the current branch to the remote repo. To bring changes from the remote to ours, we Pull.

Standard procedure is: 
Pull the branch from the remote repo that you want to use as a base
    -> Make a branch based on that branch (your task) -> Switch your local files to that branch (checkout) 
        -> Make changes to your files 
    -> Update your local repo (commit) 
-> push the changes to the same named branch on the remote repo (push) 

-> request for your branch in the remote to be merged into the main branch (will take the latest branch when resolving)

  • merge
    Branch 1 + Branch 2 -> Branch 1 (with changes from 2)
    (if you are not the owner request the merge and the owner of the repo handles it)
  • branch Create a new local branch
  • clone
    This is the starting point, it takes the whole repo and makes another repo locally
  • fork
    made popular by github, makes a remote copy of a remote repo,
    pushing to the orignal repo doesn’t happen, instead they use pull requests
    (esentially it’s another layer of control, this time on the entire repo itself)

Cherry Picking

https://www.atlassian.com/git/tutorials/cherry-pick

This lets you take a single commit and add it to a branch. Handy if you started on the wrong branch.

Rebase

Rebasing is useful for backfilling commits to catch up to the HEAD, if other people have made commits in the meantime. Unlike merge, rebase sort of rewrites history.