Skip to content

Instantly share code, notes, and snippets.

View liaokongVFX's full-sized avatar
🎯
调焦

了空 liaokongVFX

🎯
调焦
View GitHub Profile
@hahastudio
hahastudio / TextEdit.py
Created December 20, 2012 13:49
A TextEdit editor that sends editingFinished events when the text was changed and focus is lost.
from PyQt4 import QtCore, QtGui
class TextEdit(QtGui.QTextEdit):
"""
A TextEdit editor that sends editingFinished events
when the text was changed and focus is lost.
"""
editingFinished = QtCore.pyqtSignal()
receivedFocus = QtCore.pyqtSignal()
@maty974
maty974 / setNukeZeroMarginsWidget.py
Last active March 14, 2024 09:09
The Foundry Nuke hack works with "nukescripts.panels.registerWidgetAsPanel", to remove the disturbing widget contents margins set by Nuke.
'''
Created on Feb 8, 2013
@author: matthieuc
@contact: matthieu.cadet@gmail.com
'''
import PySide.QtGui as QtGui
def setNukeZeroMarginsWidget(widget_object):
@dbr
dbr / nuke_viewer_shortcut_intercept.py
Created June 4, 2013 04:12
Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""
from PySide import QtGui, QtCore
def findviewer():
stack = QtGui.QApplication.topLevelWidgets()
viewers = []
while stack:
@QuantumCD
QuantumCD / Qt 5 Dark Fusion Palette
Created August 15, 2013 21:40
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
@dbr
dbr / nuke_save_with_root_settings.py
Last active September 21, 2023 07:27
Saving selected Nuke nodes to file, preserving the root settings
def root_settings_to_string(root):
"""Serialise the project settings. Used when writing the selected
nodes (otherwise things like the frame range would be lost)
"""
# Write non-default settings, in .nk script format. Also write
# user-knob definitons to avoid errors like NUKE-256
rootstring = root.writeKnobs(nuke.TO_SCRIPT | nuke.WRITE_USER_KNOB_DEFS)
# TODO: Why doesn't writeKnobs write [first/last]_frame? Also
#pragma opname fisheyelens
#pragma oplabel "Fisheye Lens"
#pragma hint x hidden
#pragma hint y hidden
#pragma hint Time hidden
#pragma hint dofx hidden
#pragma hint dofy hidden
#pragma hint aspect hidden
#pragma hint P hidden
@paulwinex
paulwinex / alembic_maya_writer_anim.py
Last active August 21, 2018 09:06
Polygons + Normals + UVs + animation + custom point and prim attribs + groups
from pymel.core import *
import maya.OpenMaya as om
from imath import *
from alembic.Abc import *
from alembic.AbcGeom import *
import math
import alembic
def get_mesh_data():
@jackdoerner
jackdoerner / dpx.py
Last active December 27, 2023 16:31
Read Metadata and Image data from 10-bit DPX files in Python 3
"""
dpx.py
Read Metadata and Image data from 10-bit DPX files in Python 3
Copyright (c) 2016 Jack Doerner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
import time, hou
# version 1. Static class
class SessionCallback(object):
last_time = time.time()
interval = 10 # sec
@classmethod