Skip to content

Instantly share code, notes, and snippets.

View loonghao's full-sized avatar
😀

Hal loonghao

😀
  • Shenzhen
View GitHub Profile
REM http://www.microsoft.com/en-us/download/details.aspx?id=40855
REM INSTALL: Windows6.1-KB2819745-x64-MultiPkg
@ECHO off
rem VARIABLES
SET PYTHONINSTALL=C:\python27
SET LOCALFILE=c:\python-2.7.6.amd64.msi
SET PYTHONURL=http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi
REM My installation python script
SET PWINSTALLER=http://paulwinex.ru/files/pipeline/pwpipeline_install.py
SET PWINSTALLERLOCAL=c:\pwpipeline_install.py
@christophercrouzet
christophercrouzet / mayabake.py
Created December 24, 2016 14:03
Quick and dirty prototype of a naive animation bake implementation for Autodesk Maya.
#!/usr/bin/env mayapy
import itertools
import math
import random
import timeit
from maya import cmds, OpenMaya, OpenMayaAnim
import cask, shutil, json
def save_meta(path, meta):
tmp = path+'.tmp'
shutil.copy2(path, tmp)
a = cask.Archive(tmp)
#exists_prop = a.top.properties
pr = cask.Property()
pr.set_value(json.dumps(meta))
a.top.properties['jmeta'] = pr
@fredrikaverpil
fredrikaverpil / export.py
Last active July 12, 2019 08:45
Export/import shader assignment with Maya
import maya.cmds as cmds
import json
# Create the dictionary "data" with shadergroup as key
data = {}
shaders = cmds.ls(type='shadingEngine')
for shader in shaders:
data[shader] = []
# Append all shapes to each shadergroup-key
@Kif11
Kif11 / maya-undo-decorator.py
Last active March 2, 2024 09:40 — forked from schworer/undo_dec.py
quick and dirty Maya Python undo decorator
from functools import wraps
from maya import cmds
def undo(func):
""" Puts the wrapped `func` into a single Maya Undo action, then
undoes it when the function enters the finally: block """
@wraps(func)
def _undofunc(*args, **kwargs):
try:
# start an undo chunk
@paulwinex
paulwinex / abc_user_properies.py
Created March 3, 2016 08:10
Write user properties to alembic archive
import maya.OpenMaya as om
from imath import *
from alembic.Abc import *
from alembic.AbcGeom import *
import math
import alembic
from pymel.core import *
@davidcorbin
davidcorbin / zlib.md
Created February 9, 2016 05:43
How to fix missing ZLIB_LIBRARY and ZLIB_INCLUDE_DIR cmake error on Windows

How to fix missing ZLIB_LIBRARY and ZLIB_INCLUDE_DIR cmake error on Windows

Install ZLIB

Download ZLIB for Windows from Sourceforge and install it on your Windows machine. Works with x86/x64

Find ZLIB install directory

Currently, the ZLIB installer from Sourceforge (above) installs in C:/Program Files (x86)/GnuWin32.

function Add-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {
@mottosso
mottosso / README.md
Last active February 6, 2023 13:56
Minimal QML SceneGraph 2
@GaryLee
GaryLee / RunAsAdmin.py
Last active March 22, 2024 21:52
Elevate the privilege to Admin. Support both python script and pyinstaller wrapped program. Need ctypes only.
#!python
# coding: utf-8
import sys
import ctypes
def run_as_admin(argv=None, debug=False):
shell32 = ctypes.windll.shell32
if argv is None and shell32.IsUserAnAdmin():
return True