This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
import math | |
def exportCameraChan(obj, st, ed, filename): | |
bt = pm.currentTime( query=True ) | |
fd = open(filename, 'wt') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int npoints = npoints(1); | |
vector cagePos = {0}; | |
int success; | |
float w[] = pointattrib(0, "PMVCweights", @ptnum, success); | |
if (success) | |
{ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import hou | |
def LoadHipFile(filename): | |
path = os.path.dirname(os.path.abspath(filename)).replace("\\", '/') | |
hou.hscript('set HIP='+path) | |
return hou.hipFile.load(os.path.basename(filename)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Setting for python" | |
pythonpath = #( | |
-- add your python path. | |
@"d:\dev\3dsmax\python\lib" | |
) | |
for p in pythonpath do | |
( | |
format "add python path:%\n" p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn execute_python filename = | |
( | |
try | |
( | |
fd = openFile filename mode:"r" | |
seek fd #eof | |
maxlen=filepos fd | |
seek fd 0 | |
code = readChars fd maxlen errorAtEOF:false | |
close fd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setStyle( QApplication* app, QWidget* mainwindow ) | |
{ | |
app->setStyle( QString("plastique") ); | |
QPalette pal = app->palette(); | |
pal.setColor(QPalette::Window, QColor(0x32,0x32,0x32) ); | |
pal.setColor(QPalette::WindowText, QColor(0xc2,0xc2,0xc2)); | |
pal.setColor(QPalette::Base, QColor(0x1a,0x1a,0x1a) ); | |
pal.setColor(QPalette::AlternateBase, QColor(0x22,0x22,0x22) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_name = '/obj/geo1/null1' | |
ramp_name = 'color' | |
n = hou.node(node_name) | |
ramp = n.parm(ramp_name).evalAsRamp() | |
for i in range(len(ramp.keys())): | |
# Position | |
# get | |
pos = n.parm('%s%dpos' % (ramp_name, i+1)).eval() | |
# set | |
n.parm('%s%dpos' % (ramp_name, i+1)).set(pos * 0.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def import_path(fullpath): | |
""" | |
Import a file with full path specification. Allows one to | |
import from anywhere, something __import__ does not do. | |
""" | |
path, filename = os.path.split(fullpath) | |
filename, ext = os.path.splitext(filename) | |
sys.path.append(path) | |
module = __import__(filename) | |
reload(module) # Might be out of date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mainwindow.h" | |
#include <QApplication> | |
#include <QStyleFactory> | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
a.setStyle( QStyleFactory::create("fusion") ); | |
MainWindow w; | |
w.setStyleSheet( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mainwindow.h" | |
#include <QApplication> | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
a.setStyle( "Fusion"); | |
MainWindow w; | |
w.setStyleSheet( | |
"font-family: \"Verdana\";" |
NewerOlder