Skip to content

Instantly share code, notes, and snippets.

View rfletchr's full-sized avatar
🦝
racoons are cool

rfletchr

🦝
racoons are cool
View GitHub Profile
@rfletchr
rfletchr / download_playlist.py
Last active February 20, 2024 12:12
download the movies from a shotgrid playlist
import tank
import os
auth = tank.authentication.ShotgunAuthenticator()
user = auth.get_user()
sg = user.create_sg_connection()
playlist_ids = [23024]
@rfletchr
rfletchr / calculate_inset_transform.py
Last active October 24, 2023 16:10
calculate the transform required to transform a plate to match its edit ref.
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
def euclidean_distance(x1, x2):
return np.sqrt(np.sum((x1 - x2)**2))
inset_img = cv.imread('/home/work/Downloads/image.png',cv.IMREAD_GRAYSCALE) # queryImage
orig_rgb = cv.imread('/home/work/Downloads/image(1).png')
@rfletchr
rfletchr / example.py
Last active August 14, 2023 16:59
mvc, threads, progress
import time
from PySide2 import QtGui, QtWidgets, QtCore
from concurrent.futures import ThreadPoolExecutor
class SimpleController(QtCore.QObject):
progressChanged = QtCore.Signal(float)
def __init__(self, view=None):
super().__init__()
@rfletchr
rfletchr / export_shaders.py
Last active May 5, 2023 03:03
Maya Shader Exporter
"""
This is an attempt to make a poor man's version of Katana's look files.
We record any shader assignments on the descendants of a given group, each location is recorded as a relative path along
with the shading engine that is assigned to it.
Encoding:
given the following nodes:
@rfletchr
rfletchr / capture_screen.py
Created March 28, 2023 22:25
screen capture using pyside2
"""
This example shows how to capture a screenshot of a specific area of the screen.
Warning: This has not been tested with multiple monitors.
Example:
to capture the entire the current screen::
from PySide2 import QtCore, QtWidgets
@rfletchr
rfletchr / validation.py
Created February 24, 2023 11:17
Simple Validation Framework
import enum
import time
import textwrap
import qtawesome
from PySide2 import QtCore, QtWidgets, QtGui
__ICONS = {}
@rfletchr
rfletchr / Makefile
Last active June 29, 2021 11:13
record all open system calls of a program by shimming the open function via LD_PRELOAD
CC=gcc
all: src/shim.c
$(CC) -shared -fPIC -o shim.so src/shim.c -ldl
@rfletchr
rfletchr / decompile_guide.md
Last active June 6, 2019 06:26
Decompile a 'compiled' python api.

Setup

Ensure that uncomplye6 and black are installed. use conda, venv or just pip install to user..

pip install --user black uncompyle6

Decompile

cd