Skip to content

Instantly share code, notes, and snippets.

@boredstiff
boredstiff / hi.otio
Created August 26, 2017 22:59
OpenTimeline Generated File
{
"OTIO_SCHEMA": "Timeline.1",
"metadata": {},
"name": "test_sequence",
"tracks": {
"OTIO_SCHEMA": "Stack.1",
"children": [
{
"OTIO_SCHEMA": "Sequence.1",
"children": [
@boredstiff
boredstiff / premiere-export.xml
Created August 26, 2017 22:56
Full Premiere export
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmeml>
<xmeml version="4">
<sequence id="sequence-1" TL.SQAudioVisibleBase="0" TL.SQVideoVisibleBase="0" TL.SQVisibleBaseTime="0" TL.SQAVDividerPosition="0.5" TL.SQHideShyTracks="0" TL.SQHeaderWidth="236" Monitor.ProgramZoomOut="1262874412800" Monitor.ProgramZoomIn="0" TL.SQTimePerPixel="0.61538461538461542" MZ.EditLine="0" MZ.Sequence.PreviewFrameSizeHeight="480" MZ.Sequence.PreviewFrameSizeWidth="720" MZ.Sequence.AudioTimeDisplayFormat="200" MZ.Sequence.PreviewRenderingClassID="1061109567" MZ.Sequence.PreviewRenderingPresetCodec="1685288558" MZ.Sequence.PreviewRenderingPresetPath="EncoderPresets\SequencePreview\0f3c7317-cf5d-44e8-8b19-1bc6d7b05ce6\Microsoft AVI DV NTSC.epr" MZ.Sequence.PreviewUseMaxRenderQuality="false" MZ.Sequence.PreviewUseMaxBitDepth="false" MZ.Sequence.EditingModeGUID="0f3c7317-cf5d-44e8-8b19-1bc6d7b05ce6" MZ.Sequence.VideoTimeDisplayFormat="102" MZ.WorkOutPoint="15239249625600" MZ.WorkInPoint="0" explodedTracks="true">
<uuid>
@boredstiff
boredstiff / shotgun_task_query.py
Created August 1, 2017 15:07
Shotgun Task Query
query = {
'entity_type': 'Task',
'filters': [
['project', 'is', {'type': 'Project', 'id': project_id}],
{'filter_operator': 'any',
'filters': [
# Ensure that the task is on a shot, we're not setting
# the sequence on the tasks in Shotgun.
['entity.Shot.id', 'is_not', None],
# Or that the task is on an asset.
@boredstiff
boredstiff / test-notes.txt
Created July 13, 2017 15:36
Unittesting notes
# Some old unittesting notes I consult once in a while when I get stuck writing a test
In the broadest sense of the term, unit testing simply means testing a single unit of code, isolated from other code that it might be integrated with. Traditionally, unit testing was an activity that was primarily performed by test engineers. These engineers would take code given by the developers and run them through a suite of tests to verify that the code worked. Since this code was tested before integration, the process fits into the definition of a unit test. Traditional unit testing was typically a manual affair, with test engineers walking through the tests cases by hand, although some teams would go a step further and automate the tests.
An integration test is a test that involves exercising more than one unit of the system. The goal is to check whether these units have been integrated correctly. A typical integration test might be to go to a web page, fill in a form, and check whether the right message is display
from typing import (Dict, Tuple, List, NewType, Callable, Mapping, Sequence, TypeVar, Generic,
Iterable)
from logging import Logger
Vector = List[float]
def scale(scalar: float, vector: Vector) -> Vector:
return [scalar * num for num in vector]
@boredstiff
boredstiff / pycharm.txt
Created April 21, 2017 22:01
PyCharm Live Templates
# RST =====================
============================
# Code block for RST #
============================
.. code-block:: python
$END$
=============================
# Inline code block for RST #
=============================
@boredstiff
boredstiff / tree.py
Created February 16, 2017 14:38
tree.py
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
class Node(object):
def __init__(self, name, parent=None):
self._name = name
self._parent = parent
self._children = []
@boredstiff
boredstiff / renderSequences.jsx
Created November 6, 2016 16:25
Render Sequences in Premiere Pro
render : function(outputPresetPath, outputPath) {
app.enableQE();
var activeSequence = qe.project.getActiveSequence();
if (activeSequence) {
app.encoder.launchEncoder();
var timeSecs = activeSequence.CTI.secs;
var timeFrames = activeSequence.CTI.frames;
var timeTicks = activeSequence.CTI.ticks;
@boredstiff
boredstiff / deleteMayaSignIn.py
Created October 9, 2016 01:31
Delete Maya 2017 Sign In Button
import pymel.core as pm
import shiboken2
import maya.OpenMayaUI as OMUI
from PySide2 import QtWidgets
def deleteSignInButton():
statusLine = pm.mel.eval('$tmp = $gStatusLineForm')
pointer = OMUI.MQtUtil_findControl(statusLine)
statusLine = shiboken2.wrapInstance(long(pointer), QtWidgets.QWidget)
mayaStatusShelf = statusLine.children()[1].children()[1]
@boredstiff
boredstiff / Maya2016VisualStudio2015.txt
Created January 21, 2016 03:40
Maya 2016 + Visual Studio 2015
MayaPluginWizard never works. Here's setting up a project from scratch.
File > New Project > Visual C++ > Win32 > Win 32 Project > Name it.
Win32 Application Wizard > Next > DLL
Additional Options > Empty Project checked > Finish
Main Window
Right-click Source Files > Create an empty .cpp file