Skip to content

Instantly share code, notes, and snippets.

View yamahigashi's full-sized avatar

Takayoshi Matsumoto yamahigashi

View GitHub Profile
@YukiMiyatake
YukiMiyatake / ActivityProxyObjectHelper.java
Created March 14, 2014 11:44
複数のActivityを継承したい時に(UnityPlayerActivityProxy) ref: http://qiita.com/samuneP/items/09033f31b3b2f8137d8b
public class ActivityProxyObjectHelper
{
public ActivityProxyObjectHelper(Activity context)
{
_proxyClasses = new ArrayList();
_context = context;
}
protected void onCreate(Bundle savedInstanceState)
@inohiro
inohiro / detect_fbx_format.rb
Created August 15, 2013 15:32
Detect fbx format (Binary one or ASCII one) with ruby
FILE_PATH = File.expand_path './file.fbx'
CORRECT = %w"K a y d a r a \ F B X \ B i n a r y \ \ "
def binary_fbx? file_path
File.open( file_path, 'rb' ) do |file|
CORRECT.each do |char|
num = file.read( 1 )
false if num != char
end
# In mymodule.py
from zope.proxy import ProxyBase, setProxiedObject
hoge = ProxyBase(None)
def setup_hoge():
setProxiedObject(hoge, 'hoge')
@tsubaki
tsubaki / UnityAppController.mm
Created December 12, 2013 01:17
ディクテーションでUnityが落ちる対策。Unityが出力したファイルのUnityAppController.mmのrepaintメソッドのSetupUnityDefaultFBOの上にEAGLContextSetCurrentAutoRestore云々の部分を追加する
- (void)repaint
{
EAGLContextSetCurrentAutoRestore autorestore(_mainDisplay->surface.context);
SetupUnityDefaultFBO(&_mainDisplay->surface);
// ...
}
from maya import OpenMaya
from pymel.core import *
def mdagpath_from_name(name, extend_to_shape=False):
if not objExists(name):
raise MayaNodeError, name
slist = OpenMaya.MSelectionList()
slist.add(name)
dagpath = OpenMaya.MDagPath()
slist.getDagPath(0, dagpath)
@MirageYM
MirageYM / spPaint3d patch
Last active March 8, 2016 01:07
spPaint3d patch
spPaint3d mod
constraint Y(Y軸コンストレイント) SHIFT + mouse drag
constraint X(X軸コンストレイント) CTRL + mouse drag
spPaint3dContext.py
***** ORIGINAL オリジナル
306:
307: pressPosition = mc.draggerContext(spPaint3dContextID, query=True, anchorPoint=True);
###------------------------------------------------------------
#
# Tool Name: Cache Dependency
#
# Copyright: Takanori Kishikawa
# Created: 2015.09.06
# Update: 2015.09.16
# Lisence: BSD 3-Clause
# http://opensource.org/licenses/BSD-3-Clause
#
@OmniZ3D
OmniZ3D / getSelectedOrder.py
Created June 27, 2013 10:00
getSelectedOrder (MotionBuilder) snippet function via pyfbsdk FBGetSelectedModels
from pyfbsdk import *
def getSelectedOrder():
# selectionOrder selection order
# Get the current selection
lModelList = FBModelList()
pParent = None
pSelected = True
pSortSelectedOrder = True
FBGetSelectedModels( lModelList, pParent, pSelected, pSortSelectedOrder )
@keijiro
keijiro / PostprocessBuildPlayer
Created September 26, 2011 11:24
PostprocessBuildPlayer for Unity iOS: modifies Info.plist to use Facebook URL-scheme
#!/usr/bin/env python
import sys, os.path
install_path = sys.argv[1]
target_platform = sys.argv[2]
if target_platform != "iPhone": sys.exit()
info_plist_path = os.path.join(install_path, 'Info.plist')
@tsubaki
tsubaki / ResettableScriptableObject.cs
Last active June 20, 2017 06:57
ゲーム再生終了時にパラメータをリセットする(ゲーム開始時の値に戻す)ScriptableObject
using UnityEngine;
public class ResettableScriptableObject : ScriptableObject
{
#if UNITY_EDITOR
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void CallBeforPlayScene()
{
// recently, unity editor will crash
// recommend SaveProject before playing