Skip to content

Instantly share code, notes, and snippets.

View csaez's full-sized avatar

Cesar Saez csaez

View GitHub Profile
from wishlib.si import si, sisel, SIWrapper
class Rig(SIWrapper):
def __init__(self, model):
super(Rig, self).__init__(model)
# add your own stuff here
pass
@property
@csaez
csaez / ricerocks.py
Created June 15, 2013 10:10
Interactive Programming in Python - Mini-project #8 - "RiceRocks" (Asteroids)
# Mini-project #8 - "RiceRocks" (Asteroids)
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import math
import random
@csaez
csaez / hard_reload.py
Created June 18, 2013 09:20
Handy function to fully reload a module by name
import sys
def hard_reload(name):
for k in sys.modules.keys():
if k.startswith(name):
del sys.modules[k]
if __name__ == "__main__":
for name in sys.argv[1:]:
@OneUndo
def CreateNulls(size=100):
return [Application.ActiveSceneRoot.AddNull()
for i in range(size)]
CreateNulls()
class ImagePlayer(QWidget):
def __init__(self, filename, title, parent=None):
QWidget.__init__(self, parent)
# Load the file into a QMovie
self.movie = QMovie(filename, QByteArray(), self)
size = self.movie.scaledSize()
self.setGeometry(200, 200, size.width(), size.height())
self.setWindowTitle(title)
{
"auto_complete": true,
"close_windows_when_empty": false,
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme",
"draw_white_space": "all",
"find_selected_text": true,
"fold_buttons": false,
"highlight_modified_tabs": true,
"folder_exclude_patterns":
[
#!/usr/bin/env python
# -*- coding: utf-8 -*-
mydict = {"root": {"dir1": {"subdir1": "foo"},
"dir2": {"subdir2": "bar",
"subdir3": {"subdir4": {"subdir5": "baz",
"subdir6": "foo_again"}}}}}
def get_contents(directories):
@csaez
csaez / toggle_visibility.py
Last active December 21, 2015 04:09
Maya trick to hide shape nodes and bypass hierarchy visibility inherance.
import pymel.core as pm
def toogleVisibility(obj):
for s in obj.getShapes():
s.overrideEnabled.set(True)
s.overrideVisibility.set(not s.overrideVisibility.get())
for x in pm.ls(selection=True):
toogleVisibility(x)
var oPSet = ActiveSceneRoot.AddProperty( "CustomProperty", false, "UDIMtools" ) ;
oPSet.AddParameter3( "incremento", siInt4, 1, 1, 100, false, false) ;
oPSet.AddParameter3( "rotacion", siInt4, 90, 1, 360, false, false) ;
var oLayout = oPSet.PPGLayout;
//GRUPO TRANSLATE
oLayout.AddGroup("Translate UVW");
oLayout.AddRow();
oLayout.AddGroup("", false, 30); oLayout.EndGroup(); //espaciador
@csaez
csaez / listConnections.py
Last active August 29, 2015 13:59
Softimage: list input/output connections
import xml.etree.ElementTree as ET
from win32com.client import Dispatch
si = Dispatch("XSI.Application")
siut = Dispatch("XSI.Utils")
def listConnections(obj, conn_type="out"):
data = siut.DataRepository.GetConnectionStackInfo(obj)
return [c.find("object").text for c in ET.fromstring(data)
if c.find("object") is not None and c.find("type").text == conn_type]