Skip to content

Instantly share code, notes, and snippets.

View loonghao's full-sized avatar
😀

Hal loonghao

😀
  • Shenzhen
View GitHub Profile
@zachlewis
zachlewis / package.py
Last active February 14, 2022 03:25
alternate python rez package
name = "python"
version = "3.8.6"
authors = [
"Guido van Rossum"
]
description = \
"""
@jagt
jagt / ipython_maya_2018.md
Created June 19, 2018 08:55
Setting up IPython for Maya 2018
  1. Put mayapy on Path
  2. Open a cmd as admin
  3. run mayapy -m ensurepip --default-pip
  4. run mayapy -m pip install --upgrade pip
  5. run mayapy -m pip install ipython==5.7.0
  6. delete C:\Program Files\Autodesk\Maya2018\Python\Lib\site-packages\_scandir.pyd. it's build against original python release version.
  7. test mayapy -c "from IPython import embed; embed()"
import sys
import os
from PySide2.QtCore import Qt, QObject, Signal, Slot, Property
from PySide2.QtWidgets import QApplication, QSystemTrayIcon, QStyle, QAction, QMenu, QMessageBox
from PySide2.QtQml import QQmlApplicationEngine
my_list = ['here','is','my','list']
class Manager(QObject):
import maya.OpenMaya as OpenMaya
# Get the selection and create a selection list of all the nodes meshes
selection = OpenMaya.MSelectionList()
OpenMaya.MGlobal.getActiveSelectionList(selection);
# Create an MItSelectionList class to iterate over the selection
# Use the MFn class to as a filter to filter node types
iter = OpenMaya.MItSelectionList ( selection, OpenMaya.MFn.kGeometric );
@marcoshipe
marcoshipe / main.qml
Created April 4, 2018 04:58
pyqtSlot and garbage collector problem examples
import QtQuick 2.9
import QtQuick.Controls 2.2
ApplicationWindow {
id: main_window
visible: true
width: 500
height: 500
Item {
from pymel.core import *
# original setup
SCENE.defaultRenderGlobals.imageFilePrefix.set('/render_output/frame_<RenderLayer>')
SCENE.defaultRenderGlobals.animation.set(1)
SCENE.defaultRenderGlobals.outFormatControl.set(2)
SCENE.defaultRenderGlobals.putFrameBeforeExt.set(1)
SCENE.defaultRenderGlobals.extensionPadding.set(3)
# get path and add format expression
@liorbenhorin
liorbenhorin / Simple_MayaDockingClass.py
Created December 1, 2017 15:04
Simple way to Docking Qt widgets to Maya 2017+
'''
Template class for docking a Qt widget to maya 2017+.
Author: Lior ben horin
12-1-2017
'''
import weakref
import maya.cmds as cmds
import maya.OpenMayaUI as omui
@tterb
tterb / README-badges.md
Last active December 28, 2024 22:27
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

import time, hou
# version 1. Static class
class SessionCallback(object):
last_time = time.time()
interval = 10 # sec
@classmethod
# Create shortcut on desktop for windows
#...................................
def createShortCut(self, data):
executable = join(os.getenv('PIPELINE_LOCATION'), 'start_app.cmd')
if not os.path.exists(executable):
self.trayMessage('Launcher not found')
return
data['launcher'] = executable.replace('/','\\')
data['wd'] = os.getenv('PIPELINE_LOCATION')
ico = icons[data['name']] if data['name'] in icons else icons['default']