Skip to content

Instantly share code, notes, and snippets.

@tokejepsen
tokejepsen / mrm.py
Created July 11, 2016 08:26
Maya: Render Mattes
"""
Select the geometry to make the renderlayers from.
Will find all the materials (lambert), make a renderlayer per material only showing that material.
"""
import traceback
import pymel.core
selection = pymel.core.ls(selection=True)
@tokejepsen
tokejepsen / pld.py
Created August 17, 2016 11:38
pyblish-lite debug
import pyblish_lite
from pyblish_lite import mock
import pyblish.api
for plugin in mock.plugins:
pyblish.api.register_plugin(plugin)
def instance_toggled(instance, new_value, old_value):
@tokejepsen
tokejepsen / pf.py
Created September 7, 2016 11:46
PyFileMaker fix
# PyFileMaker - Integrating FileMaker and Python
# (c) 2014-2016 Marcin Kawa, [email protected]
# (c) 2006-2008 Klokan Petr Pridal, [email protected]
# (c) 2002-2006 Pieter Claerhout, [email protected]
#
# http://code.google.com/p/pyfilemaker/
# http://www.yellowduck.be/filemaker/
# Import the main modules
import string
@tokejepsen
tokejepsen / mwe.py
Created December 10, 2016 22:32
Maya Widget Explorer
from PySide.QtCore import *
from PySide.QtGui import *
from shiboken import wrapInstance
from maya import cmds
from maya import mel
from maya import OpenMayaUI as omui
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin, MayaQWidgetDockableMixin
@tokejepsen
tokejepsen / hbit.txt
Created January 24, 2017 11:56
Hiero: Burn In Tags
[python {sorted(hiero.ui.activeSequence().trackItemAt(hiero.ui.currentViewer().time()).tags(), key=lambda item: item.name())}]
@tokejepsen
tokejepsen / hif.py
Last active January 25, 2017 10:24
Hiero: Import Ftrack
import hiero
import ftrack
shots_data = []
for seq in hiero.ui.activeSequence().project().sequences():
for vid in seq.videoTracks():
for item in vid.items():
for tag in item.tags():
data = tag.metadata().dict()
@tokejepsen
tokejepsen / dmud
Last active March 1, 2017 23:10
Docker: Mount Users Directory
docker run -v /c/Users/admin/linux-env:/shared -it ubuntu /bin/bash
@tokejepsen
tokejepsen / filelink-environment.yml
Last active August 1, 2017 14:09
filelink-environment
@tokejepsen
tokejepsen / acp.py
Last active July 2, 2018 07:49
AfterEffects Python Communication
import os
import socket
import traceback
def send(cmd, port):
host = '127.0.0.1'
# we expect a result no matter if it errors, so we keep trying until we
@tokejepsen
tokejepsen / fbpe.py
Last active December 13, 2017 17:54
Flow Based Programming Experiments
"""
- Keyword arguments can be None, so need something more unique to compare
against.
- There is the possibility of cache the results of each component for quicker
evaluation.
"""
import inspect
import functools
from pyblish import api