Skip to content

Instantly share code, notes, and snippets.

View davidlatwe's full-sized avatar
:shipit:
Awesome

David Lai davidlatwe

:shipit:
Awesome
View GitHub Profile
@davidlatwe
davidlatwe / pyblish_qml_pr267_testCase.py
Created November 5, 2017 17:41
Test case for pyblish-QML PR #267
import pyblish.api
class CollectTestCase(pyblish.api.ContextPlugin):
"""Inject the currently logged on user into the Context"""
order = pyblish.api.CollectorOrder
label = "Test"
def process(self, context):
@davidlatwe
davidlatwe / toggle_visbility.mel
Created November 9, 2017 06:30
Maya 切換選取物件的可視狀態
// 抓取選取範圍
string $selects[] = `ls -sl`;
// 取得選取範圍第一個物件的參數值
int $status = `getAttr ($selects[0] + ".visibility")`;
// 將參數值(數字 1) 相減並取絕對值以得相反值然後設定回去
setAttr ($selects[0] + ".visibility") `abs($status - 1)`;
@davidlatwe
davidlatwe / MayaDockingClass.py
Created November 23, 2017 05:59 — forked from liorbenhorin/MayaDockingClass.py
Maya 2017 PySide2 Docking Qt QMainWindow
"""
This is what you need to do in order to get a qt window to dock next to maya channel box,
In all maya versions, including 2017 with PySide2
"""
__author__ = "[email protected]"
import sys
import os
import logging
import xml.etree.ElementTree as xml
@davidlatwe
davidlatwe / undo_dec.py
Created November 23, 2017 07:29 — 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
@davidlatwe
davidlatwe / maya2017install.sh
Created November 23, 2017 17:01 — forked from borgfriend/maya2017install.sh
Maya 2017 Installation on Ubuntu 16.04
#!/bin/bash
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
echo Please run this script using sudo
echo Just type “sudo !!”
exit
fi
#Check for 64-bit arch
if [uname -m != x86_64]; then
@davidlatwe
davidlatwe / README.md
Last active November 26, 2017 15:27
Avalon Vanilla Config Proposal

Avalon Vanilla Config Proposal

Still in experiment stage, but I think the idea is becoming a little more solid now, good for discussion. And maybe this could develope as a vanilla config for Avalon.

Goal

  1. Provide a basic description of Avalon-Config package
  2. Git comparable
@davidlatwe
davidlatwe / CONTRIBUTING.md
Created December 15, 2017 14:00
Good Contributing Guide Line Steal From miquelcampos/mgear

Contributing to mGear

Argument shorthands

In Maya, some arguments have a short equivalent. Don't use it.

Wrong

pm.workspace(q=True, rd=True)
@davidlatwe
davidlatwe / mongodb_basic_commands.md
Last active December 24, 2017 20:58 — forked from leommoore/mongodb_basic_commands.md
MongoDB - Basic Commands

MongoDB - Basic Commands

Saving Data

db  //Tells you the current database

show collections //Shows the collections available in the current db

db.foo.save({_id:1, x:10}) //Save the document into the foo collection  

db.bar.save({_id:1, x:10}) //Save the document into the bar collection

@davidlatwe
davidlatwe / gist:8522709a1e604079c5d2e01ec92ad7f3
Created December 27, 2017 10:18 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@davidlatwe
davidlatwe / mongo_sort_behavior.py
Last active January 19, 2018 10:50
Full code to reproduce MongoDB sorting behavior (basic data types)
import copy
try:
basestring
except NameError:
basestring = str
"""Usage Example