Skip to content

Instantly share code, notes, and snippets.

View fredrikaverpil's full-sized avatar
🏄‍♂️
vacation

Fredrik Averpil fredrikaverpil

🏄‍♂️
vacation
View GitHub Profile
@fredrikaverpil
fredrikaverpil / main.ui
Last active May 31, 2016 15:08
nuke panel test
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>961</width>
<height>651</height>
@fredrikaverpil
fredrikaverpil / main.py
Last active May 30, 2016 11:23
PyQt/PySide .ui loader
import uifileloader
# Load Qt bindings via Qt wrapper
# Source: https://github.com/mottosso/Qt
from Qt import __binding__
UI_FILE = 'my_ui.ui'
# form and base from uifileloader
form, base = uifileloader.uifileloader().load_ui_type(
@fredrikaverpil
fredrikaverpil / .vimrc
Created May 18, 2016 10:44
.vimrc example
" ---------------------------------- "
" General settings
" ---------------------------------- "
set nocompatible " not vi compatible
set backspace=2 " make backspace work like most other apps
set encoding=utf8
syntax on
set number " show line numbers
set noerrorbells
@fredrikaverpil
fredrikaverpil / vraymesh_geomtype_from_selected.py
Last active April 28, 2016 07:19
Set V-Ray proxy geometry type
import maya.cmds as cmds
def set_selected_geotype(n):
""" Source this function in Maya, then run one of the following:
set_selected_geotype(n=0) # Placeholder
set_selected_geotype(n=1) # Bounding box
set_selected_geotype(n=2) # Preview
set_selected_geotype(n=3) # Maya mesh
set_selected_geotype(n=4) # GPU Cache
@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
@fredrikaverpil
fredrikaverpil / rc-local-shutdown.service
Created April 4, 2016 10:51
rc.local replacement for systemd
[Unit]
Description=/etc/rc.local.shutdown Compatibility
After=rc-local.service
[Service]
Type=oneshot
ExecStart=/etc/rc.local.shutdown
StandardInput=tty
RemainAfterExit=yes
import xgenm as xg
#import xgenm.xgGlobal as xgg
collections = xg.palettes()
for c in collections:
descriptions = xg.descriptions(c)
for d in descriptions:
print 'Collection:', c
print 'Description:', d
for dp in xg.descriptionPatches(d):
@fredrikaverpil
fredrikaverpil / devsetup_windows.bat
Last active March 7, 2016 09:51
Development environment setup
REM install choco
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
REM install atom with packages
choco install atom -y
apm install linter-flake8
apm install linter-docker
apm install linter-jsonlint
apm install pretty-json
apm install script
@fredrikaverpil
fredrikaverpil / vcpython27_OK.log
Last active February 11, 2016 17:16
vcpython27
C:\nupkgs\vcpython27\tests>install
C:\nupkgs\vcpython27\tests>choco install vcpython27 -fdv --source="'C:\nupkgs\vcpython27\tests;https://chocolatey.org/api/v2/'" -y --debug
Chocolatey is running on Windows v 10.0.10240.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install vcpython27 -fdv --source="'C:\nupkgs\vcpython27\tests;https://chocolatey.org/api/v2/'" -y --debug
Received arguments: install vcpython27 -fdv --source='C:\nupkgs\vcpython27\tests;https://chocolatey.org/api/v2/' -y --debug
@fredrikaverpil
fredrikaverpil / chunk_out_abc.py
Created November 20, 2015 11:45
Chunk out .abc files from Maya
import os
import maya.cmds
def generateChunks( start, end, chunk_size ):
'''
Given a start, end and chunk size, spit out lists of frames.
'''
i = int(start)
while i < end: