Skip to content

Instantly share code, notes, and snippets.

@tokejepsen
tokejepsen / post_script_ffd_import.py
Created May 10, 2019 09:34
mGear Post Script FFD Import
import os
import pymel.core
basename = os.path.basename(pymel.core.sceneName())
filename = os.path.splitext(basename)[0]
directory = os.path.dirname(pymel.core.sceneName())
# Find *.ffd folder starting with same name as current file
@tokejepsen
tokejepsen / display_layers_export.py
Created May 11, 2019 07:22
Display Layers Export
import os
import json
import pymel.core
display_layers = {}
for layer in pymel.core.ls(type="displayLayer"):
display_layers[layer.name()] = {"members": []}
for node in layer.listMembers():
@tokejepsen
tokejepsen / ffmpeg_compression.py
Last active March 11, 2021 09:32
ffmpeg compression
import os
import sys
import subprocess
def transcode_movies(path):
movie_files = []
for root, dirs, files in os.walk(path):
for file in files:
if file.endswith("_review.mov"):
@tokejepsen
tokejepsen / batch_publish.py
Last active September 26, 2019 16:52
Batch publish
import os
import argparse
import socket
import tempfile
from avalon import io, api
from launcher import lib
def wait_for_maya_boot():
@tokejepsen
tokejepsen / google_drive_duplicates.py
Last active June 9, 2024 20:01
Google Drive Duplicates
import os
import re
import sys
import shutil
def get_size(start_path):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
@tokejepsen
tokejepsen / maya_frustum_cutter.py
Last active November 14, 2019 09:56
Maya Frustum Cutter
"""
Select the camera you want to cut from, then the geometry you want
to be cut.
"""
import maya.cmds as cmds
import pymel.core as pm
def cut_to_frustum(camera, geometry):
# Gather relevant camera attributes.
@tokejepsen
tokejepsen / mirror_meshes.py
Last active September 17, 2019 13:10
Mirror Meshes
"""
Select all meshes that needs to be mirrored.
Script produces a mirror locator with a plane for visualizing.
"""
import pymel.core as pm
selection = pm.ls(selection=True)
@tokejepsen
tokejepsen / ftrack_check_resolution_action.py
Last active December 2, 2019 11:21
Ftrack: Check Resolution Action
import subprocess
import logging
import sys
import argparse
import webbrowser
import traceback
import json
import ftrack_api
@tokejepsen
tokejepsen / hold_frame_analyzer.py
Last active October 5, 2021 15:25
Hold Frame Analyzer
"""
Select the node to analyze for held frames.
Outputs a FrameHold node with animation synced to the held frames.
"incremental" > If True only increment held values by 1. If False held values are the frames.
"operation" > choice between "Auto Crop" and "Avg Intensities". Different footage can require different operations. If one operation misses a frame movement, then try the other.
"""
import nuke
@tokejepsen
tokejepsen / ear_dwaa_compression.py
Last active October 29, 2019 09:44
EXR DWAA compression
import os
import sys
import subprocess
def get_size(start_path):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)