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 / README.md
Created June 23, 2021 08:32
Qt widget: Page sliding

Example:

4a14e11c-620f-40b9-998d-02672db82d1d

@davidlatwe
davidlatwe / mem_test2.py
Created May 22, 2021 15:03
Test improving Rez context resolve failure messsage
import os
from rez.resolved_context import ResolvedContext
from rez.package_repository import package_repository_manager
os.environ["REZ_PACKAGES_PATH"] = "memory@any"
class Repo(object):
@davidlatwe
davidlatwe / README.md
Last active May 20, 2021 17:31
Virtual env based python rez package (filesystem combined package)

Virtual env based python rez package

This is a combined package, which cannot be built but simply copying python.py into package repository. And it will provide clean, re-usable virtual env that created from system installed python that it could find.

$ rez-search python
python-2.7-venv
python-3.6-venv
python-3.7-venv
python-3.8-venv
@davidlatwe
davidlatwe / pref_test.md
Last active April 19, 2021 12:28
Point Reference AOV 製程分析

Point Reference AOV

以下測試同一角色在不同 shot 的以不同方式製作 Point Reference 的差異 👇

方案一: 採用該角色在各 shot 第一格的狀態為參考

  • Shot A 的場景狀態

shotA_scene

'''
This plugin was ported to python from C++,
All credits by Anno Schachner
original plugin is here https://github.com/wiremas/tension
'''
import sys
import maya.api.OpenMaya as om2
import maya.OpenMaya as om
@davidlatwe
davidlatwe / mem_test.py
Created November 18, 2020 16:05
Testing Rez's package not found detailed message
import os
os.environ["REZ_PACKAGES_PATH"] = "memory@any"
def memory_repository(packages):
from rez.package_repository import package_repository_manager
repository = package_repository_manager.get_repository("memory@any")
@davidlatwe
davidlatwe / 123.py
Last active November 11, 2020 11:26
Monkey patch pymongo.auth for Houdini 18.5.351 to avoid "ValueError: unsupported hash type" when connecting MongoDB with Auth enabled (error raised on all version of MongoDB and all versions of PyMongo)
def patch():
import hmac
import hashlib
from pymongo import auth
def _hi(hash_name, data, salt, iterations):
"""A simple implementation of PBKDF2-HMAC.
This is grabed from pymongo.auth module
@davidlatwe
davidlatwe / mem_test.py
Last active November 6, 2020 23:57
Testing Rez's conflict resolve and package not found detailed message
import os
os.environ["REZ_PACKAGES_PATH"] = "memory@any"
def memory_repository(packages):
from rez.package_repository import package_repository_manager
repository = package_repository_manager.get_repository("memory@any")
@davidlatwe
davidlatwe / allzpark_with_memory_profile.py
Created November 6, 2020 17:33
Testing Allzpark with memory-based package repository
import os
import sys
from rez.config import config as rezconfig
from allzpark import cli, allzparkconfig
os.environ["PATH"] += ";C:/Graphviz/bin"
# os.environ["ALLZPARK_NOTHREADING"] = "1"
os.environ["REZ_PACKAGES_PATH"] = os.pathsep.join([
"memory@any",
@davidlatwe
davidlatwe / Xdummy
Last active September 2, 2021 18:44
Xdummy (-ldl added)
#!/bin/sh
# ----------------------------------------------------------------------
# Copyright (C) 2005-2011 Karl J. Runge <runge at-sign karlrunge.com>
# All rights reserved.
#
# This file is part of Xdummy.
#
# Xdummy is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at