This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
import lx | |
import lxu.object | |
import lxu.command | |
import lxifc | |
class AwSelListener(lxifc.SelectionListener): | |
running = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import threading | |
def _print_stdout(process): | |
''' | |
Print out the stream line by line. If line is empty we know that the process has finished and we exit | |
''' | |
while True: | |
try: | |
line = process.stdout.readline() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lx | |
import modo | |
ImgSrv = lx.service.Image() | |
colorService = lx.service.ColorMapping() | |
TosRGB = lx.object.ColorMapping(colorService.MakeColorMapping("nuke-default:sRGB", 0)) | |
width = 1000 | |
height = 800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modo | |
import lx | |
scene = modo.scene.current() | |
selected = scene.selected[0] | |
list = [] | |
rp = scene.renderPassGroups[0] | |
for ch in rp.groupChannels: | |
g=ch.item.itemGraph('xfrmCore') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @author David Ballesteros | |
# | |
# @brief Helper classes to deal with the read and write of Item Channels. | |
# Based on a ChannelRead class sample code provided by Matt Cox | |
import lx | |
class ChannelRead: | |
def __init__(self, item): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sip | |
sip.setapi('QString', 2) | |
sip.setapi('QVariant', 2) | |
from PyQt4 import QtCore, QtGui | |
class TableModel(QtCore.QAbstractTableModel): | |
""" | |
A simple 5x4 table model to demonstrate the delegates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sip | |
sip.setapi('QVariant', 2) | |
from PyQt4 import QtCore, QtGui | |
class SpinBoxDelegate(QtGui.QItemDelegate): | |
def createEditor(self, parent, option, index): | |
editor = QtGui.QSpinBox(parent) | |
editor.setMinimumHeight(100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UI4.FormMaster.PythonValuePolicy | |
# Create a node for which to create parameter widgets | |
node = NodegraphAPI.CreateNode('Alembic_In', NodegraphAPI.GetRootNode()) | |
# Get a couple of parameters from the node | |
addForceExpandParameter = node.getParameter('addForceExpand') | |
addBoundsParameter = node.getParameter('addBounds') | |
fpsParameter = node.getParameter('fps') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def CreateTeleParam(parentParam, targetParam): | |
teleParam = parentParam.createChildString( | |
'%sTeleParam' % targetParam.getName(), '') | |
teleParam.setExpression('getParam("%s").param.getFullName()' | |
% targetParam.getFullName()) | |
teleParam.setHintString(repr({'widget': 'teleparam'})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = open(file_path) | |
file_size = os.path.getsize(file_path) | |
CHUNK_SIZE = 4 * 1024 * 1024 | |
if file_size <= CHUNK_SIZE: | |
print dbx.files_upload(f, dest_path) | |
else: |