Skip to content

Instantly share code, notes, and snippets.

@hmasato
hmasato / SCH_SIGGRAPH2013.tsv
Last active December 18, 2015 02:49
[SCH] SIGGRAPH 2013 schedule (siggraph.org) TSV (Tab-separated values)
SIGGRAPH 2013 http://s2013.siggraph.org/attendees/attendees
Courses http://s2013.siggraph.org/attendees/courses
2013/07/21 9:00 12:15 Introduction to Computer Graphics http://s2013.siggraph.org/attendees/courses/events/introduction-computer-graphics
2013/07/21 9:00 12:15 Mobile Game Creation for Everyone http://s2013.siggraph.org/attendees/courses/events/mobile-game-creation-everyone
2013/07/21 14:00 17:00 An Introduction to OpenGL Programming http://s2013.siggraph.org/attendees/courses/events/introduction-opengl-programming
2013/07/21 14:00 17:00 Recent Advances in Light-Transport Simulation: Theory & Practice http://s2013.siggraph.org/attendees/courses/events/recent-advances-light-transport-simulation-theory-practice
2013/07/21 14:00 17:00 The Digital Production Pipeline http://s2013.siggraph.org/attendees/courses/events/digital-production-pipeline
2013/07/21 14:00 17:00 Turbulent Fluids http://s2013.siggraph.org/attendees/courses/events/turbulent-fluids
@hmasato
hmasato / MAYA_showRealflowNodeInfo.mel
Created June 6, 2013 05:39
[Maya, Realflow, Win] _showRealflowNodeInfo
proc float _r(float $v){
float $dec=10000.0;
return( int($dec*$v+0.5)/$dec );
}
proc _showRealflowNodeInfo()
{
string $dir = getenv("TEMP");
string $fn = `file -q -sn`;
$fn = $dir+"/"+basenameEx($fn)+"_rfnote.txt";
int $fd=fopen($fn, "w");
@hmasato
hmasato / MAYA_collectFiles_forRealflowBIN.mel
Created June 6, 2013 05:44
[MAYA, Realflow, WIN] _collectFiles_forRealflowBIN
proc _collectFiles_forRealflowBIN()
{
string $sn = `file -q -sn`;
string $sd = dirname($sn);
string $tmp = getenv("TEMP");
string $fn = $tmp+"/"+basenameEx($sn)+"_rfbat.txt";
int $fd=fopen($fn, "w");
int $nRF = 0;
@hmasato
hmasato / MAYA__changeAbsPathToRelPath_forRealflowBIN.mel
Created June 6, 2013 05:49
[MAYA, Realflow] _changeAbsPathToRelPath_forRealflowBIN
proc _changeAbsPathToRelPath_forRealflowBIN()
{
string $sn = `file -q -sn`;
string $sd = dirname($sn);
string $buf[]={};
if(catchQuiet( $buf=`ls -type "RealflowMesh"` )) return;
if(catchQuiet( $buf=`ls -type "RealflowEmitter"` )) return;
clear $buf;
@hmasato
hmasato / MAYA_nodePanel.mel
Created June 6, 2013 05:59
[MAYA] _nodePanel (_nodeList + ChannelBox)
proc string[] _GUI(string $func)
{
if(`window -exists ($func+"Win")`) deleteUI ($func+"Win");
window -title $func ($func+"Win");
paneLayout -w 200 -cn "left3"
-paneSize 1 50 15
-paneSize 2 50 100
-paneSize 3 50 85;
columnLayout -w 100 -h 50 -adj 1;
@hmasato
hmasato / MAYA_nodeList.mel
Last active December 18, 2015 03:39
[MAYA] _nodeList
proc string[] _GUI(string $func)
{
if(`window -exists ($func+"Win")`) deleteUI ($func+"Win");
window -title $func ($func+"Win");
paneLayout -cn "horizontal2" -paneSize 1 100 15 -paneSize 2 100 85;
columnLayout -h 50 -adj 1;
rowColumnLayout -h 50 -nc 2 -cw 1 60 -cw 2 160 -cat 1 "right" 0;
text -l "Node Name"; string $txt=`textField -text "*" ($func+"Tfld")`;
text -l "Node Type"; string $txt2=`textField -text "*" ($func+"Tfld2")`;
@hmasato
hmasato / MAYA_switchCams.mel
Created June 6, 2013 06:57
[MAYA] _switchCams (emu Mobu)
proc _switchCams()
{
string $p=`getPanel -withFocus`;
if(!`modelPanel -ex $p`) return;
string $cams[]={};
string $cur=`modelPanel -q -cam $p`;
if(nodeType($cur)!="camera"){
$cams=`listRelatives -pa -s $cur`;
$cur=$cams[0];
@hmasato
hmasato / GLSL_rgb2hsv_hsv2rgb.glsl
Last active December 18, 2015 07:28
[GLSL] rgb <=> hsv
// RGB -> HSV
vec3 rgb2hsv(vec3 v){
const float e=1e-20;
vec4 c=vec4(v,0);
c=mix(vec4(c.rbg,-1),c,step(c.b,c.g));
c=mix(vec4(c.grb,-1.0/3.0-c.a),c,step(c.g,c.r));
float cr=c.r-min(c.g,c.b);
return vec3(abs(c.a+(c.g-c.b)/(6*cr+e)),cr/(c.r+e),c.r);
}
// HSV -> RGB
@hmasato
hmasato / HTML_siListSHEDPose.htm
Created July 4, 2013 11:48
[Softimage, SHED PoseLib, HTML, javascript] PoseLib
<html>
<head>
<script type="text/JavaScript">
function _sort(_f)
{
var fn = [];
for(var e=new Enumerator(_f); !e.atEnd(); e.moveNext())
fn.push({'name':e.item().Name, 'obj':e.item()});
fn = fn.sort(function(a, b) {return((a.name>b.name)?1:-1);});
var ret = [];
@hmasato
hmasato / SI_sendToNotepad.js
Last active December 19, 2015 13:58
[Softimage, Win] _sendToNotepad.js
function _notepad(str)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var wsh = new ActiveXObject("WScript.Shell");
var dir = wsh.ExpandEnvironmentStrings("%temp%");
var sn = ActiveProject.ActiveScene.Parameters("Name").Value;
var fn = dir + "\\" + sn + ".txt";
var f = fso.CreateTextFile(fn, true, false);