python main.py --amount 100- Panning by left-click + drag
- Scale by rotating the mouse wheel
| from functools import wraps | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| def timed(func): | |
| """This decorator prints the execution time for the decorated function.""" | |
| @wraps(func) | |
| def wrapper(*args, **kwargs): | |
| start = time.time() |
| import re | |
| def replace(obj): | |
| print(obj.groups()) | |
| if obj.group(0) == '\'': | |
| return '"' | |
| if obj.group(0) == '"': | |
| return '\'' | |
| if obj.group(0) == '"""': |
| prod = NodegraphAPI.GetGeometryProducer() | |
| root = prod.getRootProducer() | |
| cel = root.getAttribute('collections.test.cel').getValue() | |
| node = NodegraphAPI.GetNode('CollectionCreate') | |
| collector = Widget.CollectAndSelectInScenegraph(str(cel), '/root/world/geo') | |
| result = collector.collectAndSelect(select=False, node=node) |
| 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: |
| def CreateTeleParam(parentParam, targetParam): | |
| teleParam = parentParam.createChildString( | |
| '%sTeleParam' % targetParam.getName(), '') | |
| teleParam.setExpression('getParam("%s").param.getFullName()' | |
| % targetParam.getFullName()) | |
| teleParam.setHintString(repr({'widget': 'teleparam'})) |
| 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') |
| 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) |
| 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 |
| # @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): | |
| """ |