Skip to content

Instantly share code, notes, and snippets.

@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_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_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 / 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_createInstanceMesh_fromSelectedFaces.mel
Last active December 17, 2015 17:49
[Maya] _createInstanceMesh_fromSelectedFaces
proc _createInstanceMesh_fromSelectedFaces(int $inv)
{
string $sels[]=`ls -sl`;
if(size($sels)<1) return;
string $nodes[]={};
for($s in $sels){
$nodes[size($nodes)] = substituteAllString($s, (match("\\.[^.:]+\[[0-9:]+\]$", $s)), "");
}
$nodes = stringArrayRemoveDuplicates($nodes);
@hmasato
hmasato / BAT_openFolderFromCurrentQT.cmd
Last active December 17, 2015 09:49
[WScript, QuickTime, Win, jscript] _openFoldersFromCurrentQT.cmd
@if(0)==(0) echo off
cscript.exe //NoLogo //E:JScript "%~f0" %*
goto :eof
@end
f1:
var ws = WScript;
var wsh = new ActiveXObject("WScript.Shell");
var wmi = GetObject("winmgmts:\\\\.\\root\\cimv2");
var qtpr = wmi.ExecQuery("Select * from Win32_Process where name='QuickTimePlayer.exe'");
if(qtpr.Count < 1) ws.Quit();
@hmasato
hmasato / SI_sendToClipboard_min.js
Created May 10, 2013 06:47
[Softimage, Win] _sendToClipboard.js
function _sendToClipboardStr(str)
{
var wsh = new ActiveXObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var fn = wsh.Environment("Process")("TEMP") + "\\_sendToClipboard_.tmp";
var f = fs.CreateTextFile(fn, true, false); f.WriteLine(str); f.Close();
wsh.run("cmd.exe /c clip < " + fn, 0, true);
}
function _sendToClipboardFile(filename)
{
@hmasato
hmasato / MAYA_cfField.py
Created May 10, 2013 06:13
[MAYA] cfField_min.py (curveFlow Field)
#--------------------------------
# cfField.py: curveFlow Field
#--------------------------------
import math, sys
import maya.OpenMaya as om
import maya.OpenMayaUI as omUI
import maya.OpenMayaMPx as omMPx
import maya.OpenMayaRender as omRen
@hmasato
hmasato / MAYA_sendFileToClipboard.mel
Created May 10, 2013 06:01
[Maya, Win] _sendToClipboard.mel
proc _sendFileToClipboard(string $filename)
{
string $fn = $filename;
if($fn=="") return;
if(!`filetest -r $fn`) return;
system("shell clip < \""+$fn+"\"");
}
_sendToClipboard("C:/TEMP/test.txt");
@hmasato
hmasato / MAYA_RF_makeCopyBat.mel
Last active December 17, 2015 04:39
[Maya, Realflow, Win] RF_makeCopyBat.mel
proc RF_makeCopyBat()
{
if(!`pluginInfo -q -l "realflow"`) return;
string $buf[]={};
if(catchQuiet( $buf=`ls -type "RealflowMesh"` )) return;
if(catchQuiet( $buf=`ls -type "RealflowEmitter"` )) return;
clear $buf;
string $sn = `file -q -sn`;