Skip to content

Instantly share code, notes, and snippets.

@paulwinex
paulwinex / alembic_maya_writer_anim.py
Last active August 21, 2018 09:06
Polygons + Normals + UVs + animation + custom point and prim attribs + groups
from pymel.core import *
import maya.OpenMaya as om
from imath import *
from alembic.Abc import *
from alembic.AbcGeom import *
import math
import alembic
def get_mesh_data():
@paulwinex
paulwinex / app.js
Created November 17, 2015 16:16
Simple firebase messager
/*eslint-disable */
'use strict';
angular.module('messagesApp', [
'firebase'
])
.constant('FirebaseUrl', 'https://pwfireslack.firebaseio.com/')
.controller('msgCtrl', ['$scope', 'Messages', function ($scope, Messages) {
$scope.messages = Messages.all;
$scope.captcha = undefined;
status= dict(
hold=0,
omni=1,
notstarted=2,
wip=3,
inprogress=4,
pending=5,
normal=6,
proposed=7,
approved=8,
# install:
# add to menu.py
import nuke
from PySide.QtGui import *
from PySide.QtCore import *
def getMainWindow():
qApp = QApplication.instance()
for widget in qApp.topLevelWidgets():
import nuke
def createShuffleEXR(gradeNodes):
sel =nuke.selectedNode()
chanList=[]
rr = sel.channels()
for i in rr:
temp = i.split('.')
if (len(chanList)) == 0:
from pymel.core import *
objs = ls(sl=1, type='mesh')
errors = []
for obj in objs:
areas = {}
for f in obj.f:
a = round(f.getArea(),3)
def check_faces_in_the_same_place(sel=False):
objs = ls(sl=sel, type='mesh')
errors = []
for obj in objs:
areas = {}
for f in obj.f:
a = round(f.getArea(),5)
if a in areas:
areas[a].append(f)
@paulwinex
paulwinex / fast_render_frame.py
Created January 12, 2016 19:54
Render frame
def render_current_frame_ogl(self):
import tempfile, random
d = tempfile.gettempdir()
f = join(d,'preview_image_%s' % random.randrange(10000, 99999)) + '.jpg'
rg = PyNode('defaultRenderGlobals')
dr = PyNode('defaultResolution')
old_format = rg.imageFormat.get()
rg.imageFormat.set(8)
playblast(
frame=currentTime(),
@paulwinex
paulwinex / render_frame_arnold.py
Created January 13, 2016 13:40
Render current frame with arnold to jpeg and return path
def render_current_frame_ai(self):
import tempfile, random
from arnold import *
d = tempfile.gettempdir()
fi = join(d,'preview_image_%s' % random.randrange(10000, 99999))
fa = join(d,'preview_image_%s' % random.randrange(10000, 99999)) + '.ass'
rg = PyNode('defaultRenderGlobals')
dr = PyNode('defaultResolution')
ar = PyNode('defaultArnoldDriver')
import hou
from PySide.QtGui import QMenu, QAction, QCursor
env = ['DATA', 'TEMP', 'CACHE']
m = QMenu()
for e in env:
a = QAction(e, hou.ui.mainQtWindow())
a.setData(e)
m.addAction(a)