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 / resize_tex.py
Created March 7, 2017 06:31 — forked from SEVEZ/resize_tex.py
Resize textures using python
import maya.cmds as cmds
import maya.OpenMaya as om
fileNodes = cmds.ls(sl=1)
width = 1024
height = 1024
image = om.MImage()
for i in fileNodes:
filePath = cmds.getAttr(i+'.fileTextureName')
@davidlatwe
davidlatwe / mayaBatch.bat
Created May 27, 2017 08:50
Maya Batch Render CMD
@ECHO off
REM Put this batch file under scenes folder in maya project path
REM set scene folder path
SET POOL=%~dp0
REM set project path
CD /D %POOL%..
SET PROJ=%CD%
REM set images output root path
CD /D ./images
@davidlatwe
davidlatwe / delUnknow.py
Created May 27, 2017 09:06
Remove Maya Unknow Nodes
# Remove maya unknow nodes
from pymel.core import *
for node in ls(typ= 'unknown'):
if lockNode(node, q= 1, l= 1):
print node.name()
lockNode(node, l= False)
delete(node)
@davidlatwe
davidlatwe / messages.md
Created August 23, 2017 18:26 — forked from mharris717/messages.md
A Conversation About OOP vs. FP Turns Constructive

Just tried to put this in a more readable format: https://github.com/svanderbleek/haskellandchill.com/blob/master/a-conversation-about-oop-vs-fp-turns-constructive.md

Person Time Message
sagar 10:47 why is that, why is OOP trash
katychuang 10:48 excellent question
katychuang 10:49 I've been told FP and OOP are different paradigms
katychuang 10:52 I'm going to butcher a quote from a talk by Evie so I'm going to paraphrase… She said something like when you work with OOP you create lots of objects and rules on how they should interact and yet somehow end up having to touch each other a lot and inappropriately
katychuang 10:53 On the other hand FP (especially Haskell) is like working with shapes, like that baby shape fitting toy where you focus more on fitting the type parameters correctly
katychuang 10:56 I think of programming as building a piping system. FP (especia
@davidlatwe
davidlatwe / build_avalon_env.bat
Created September 12, 2017 17:38
avalon__kick__
REM change to parent dir
SET INIT=%~dp0
CD /D %INIT%..
REM build python 3.6 virtualenv
virtualenv avalon_env -p "C:\Python36_64\python.exe"
REM copy python3.dll for PYQT5
copy %INIT%python3.dll avalon_env\Scripts\
@davidlatwe
davidlatwe / Dockerfile-avalon
Last active September 17, 2017 07:29
avalon docker
FROM ubuntu:16.04
# install python3.6 and pip
RUN apt-get update \
&& apt-get install -y software-properties-common curl \
&& add-apt-repository ppa:jonathonf/python-3.6 \
&& apt-get remove -y software-properties-common \
&& apt autoremove -y \
&& apt-get update \
&& apt-get install -y python3.6 \
@davidlatwe
davidlatwe / README.md
Created November 2, 2017 06:43 — forked from mottosso/README.md
Nodes with unique IDs

Nodes with unique IDs in Maya

unique_id1.py associates a new ID to every DAG-node in the scene, unique_id2.py does the same but keeps existing IDs as-is. Finally, unique_id3.py updates IDs and ensures that no duplicate ID exists in the scene.

@davidlatwe
davidlatwe / pyblish_override_logic_for_testing.py
Last active November 5, 2017 09:55
Pyblish - Enable Publishing Continues with Validation Error
from pyblish.logic import (
registered_test,
plugins_by_targets,
instances_by_plugin,
log
)
from pyblish.plugin import (
registered_targets,
)
@davidlatwe
davidlatwe / test_for_pyblish_override_logic.py
Created November 5, 2017 09:48
Pyblish Test Case - Enable Publishing Continues with Validation Error
import pyblish.api
import pyblish.util
disk = {}
items = ["John.Boy.Person"]
class CollectInstances(pyblish.api.ContextPlugin):
order = 0