Skip to content

Instantly share code, notes, and snippets.

View yamahigashi's full-sized avatar

yamahigashi

View GitHub Profile
@yamahigashi
yamahigashi / locateDummy.mel
Last active August 29, 2015 13:57
maya のいろいろ支援スニペット mel
global float $BIGNUMBER_MINUS = 100;
global float $BIGNUMBER_PLUS = 1000;
global proc string stripNamespace(string $n){
string $exp = "^.*:";
string $new = `substitute $exp $n ""`;
return $new;
};
@yamahigashi
yamahigashi / dyn_shelf_launcher.py
Last active May 11, 2016 19:15
指定パス以下の スクリプトを元にシェルフを動的作成 for maya
"""coding: utf-8"""
#
# 指定パス以下の スクリプトを元にシェルフを動的作成 for maya
#
# ├─dyn_shelf_root
# │ ├─hoge_tab
# │ │ └─ スクリプト1.py
# │ │ └─ スクリプト2.py
# │ └─mage_tab
# └─ スクリプト3.py
@yamahigashi
yamahigashi / expand_schematic_nodes.py
Last active August 29, 2015 14:06
expand under selected nodes on Schematic View #softimage
import siutils
def expand_nodes():
viewname = 'Schematic'
activelayout = Application.Desktop.ActiveLayout
v = activelayout.FindView( viewname )
if v == None:
siutils.log('Creating new schematic...: %s' % (viewname))
@yamahigashi
yamahigashi / filter_constraint.py
Created November 18, 2014 09:32
mel filter constraint from `ls -t "transform" -dag -o`;
import re
import maya.cmds as cmds
exp = re.compile("_\w+Constraint\d*$")
liste = cmds.ls(exactType="transform", dag=True)
liste = filter(lambda x: not exp.search(x), liste)
@yamahigashi
yamahigashi / my_motionbuilder_util.py
Created December 24, 2014 05:36
motinbuilder python utility
# -*- coding: utf-8 -*-
# MotionBulider 用のユーティリティ関数集
###############################################################################
import pyfbsdk as fb
#import pyfbsdk_additions as fb_add
###############################################################################
fbsys = fb.FBSystem()
app = fb.FBApplication()
@yamahigashi
yamahigashi / animationPostprocess.boo
Created March 16, 2015 08:39
Auto duplicate animation clips at PostprocessModelImport #unity3d
import UnityEngine
import UnityEditor
import System
import System.IO
import System.Text.RegularExpressions
//--------------------------------------------------------------------------//
class Mot:
public name as string
@yamahigashi
yamahigashi / inspect_property.js
Created June 5, 2015 04:21
inspect property with width/height #softimage
function inspect_property(propname, width, height){
view = Desktop.ActiveLayout.CreateView("Property Panel", propname);
view.BeginEdit();
//view.Move(posx, posy)
view.Resize(width, height);
view.SetAttributeValue("targetcontent", propname);
view.EndEdit();
}
@yamahigashi
yamahigashi / check_maximum_influence.py
Created June 30, 2015 09:17
check max influence and select these vertex. for Maya
import maya.cmds as cmds
import maya.mel as mel
DEFAULT_MAXIMUM_INFULENCE = 5
##############################################################################
#1頂点に影響するジョイントの上限チェックする
##############################################################################
def check_maximum_influence(max=DEFAULT_MAXIMUM_INFULENCE):
res = []
@yamahigashi
yamahigashi / Simplex.kl
Last active November 5, 2015 10:27
simplex noise generator for FabricEngine kl
/*
* http://stackoverflow.com/questions/18279456/any-simplex-noise-tutorials-or-resources
*/
/*
* A speed-improved simplex noise algorithm for 2D, 3D and 4D in kl.
*
* Based on example code by Stefan Gustavson ([email protected]).
* Optimisations by Peter Eastman ([email protected]).
* Better rank ordering method by Stefan Gustavson in 2012.
@yamahigashi
yamahigashi / execute_script.js
Last active August 29, 2015 14:25
Application.ExecuteScript を使ってのスクリプトファイルの実行 #Softimage
function select_execute(){
var title = "実行ファイルを選択する";
var initialDirectory = "";
var fileFilter = "py|js|vbs";
var filter = "Script Files(*.py;*.js;*.vbs)|*.py;*.js;*.vbs|All Files (*.*)|*.*||";
fileBrowser = XSIUIToolkit.FileBrowser;
fileBrowser.DialogTitle = title;
fileBrowser.InitialDirectory = initialDirectory;