Skip to content

Instantly share code, notes, and snippets.

@ToQoz
ToQoz / unity_script_with_webview_with_local_html.js
Created June 1, 2012 00:48
UnityのWebView(unity-webview-integration使う)でローカルHTMLを見るやつ
// index.html は Assets/StreamingAssetsにあるとする.
// Android
// HTMLをテキストとして送る. -> ださい
www = new WWW("jar:file://" + Application.dataPath + "!/assets/index.html"); // this is the path to your StreamingAssets in android
yield www;
if(www.isDone){
WebMediator.LoadData(www); // 独自で追加したメソッド, ネイティブプラギン側でWebView.loadData呼び出してる.
}
@taka-mochi
taka-mochi / file0.txt
Last active November 21, 2018 16:59
Bounding Volume Hierarchy (BVH) の実装 - 構築編 ref: http://qiita.com/omochi64/items/9336f57118ba918f82ec
T = 2T_{AABB} + \frac{A(S_1)}{A(S)}N(S_1)T_{tri} + \frac{A(S_2)}{A(S)}N(S_2)T_{tri}
@fereria
fereria / sinWave.py
Created March 13, 2014 13:37
create sinwave
# -*- coding: utf-8 -*-
import maya.OpenMaya as om
import maya.OpenMayaMPx as omPx
import math
class sinWave(omPx.MPxNode):
kPluginNodeTypeName = "sinWave"
@n-yoda
n-yoda / SerializedObjectEditor.cs
Last active June 8, 2018 00:58
Unityの任意のアセットを編集するエディタスクリプト http://ny.hateblo.jp/entry/2014/03/23/051546
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// 「Window/SerializedObject Editor」で起動。
/// 選択中のObjectと関連ObjectからSerializedObjectを作ってPropertyを全て表示する。
/// </summary>
public class SerializedObjectEditor : EditorWindow
@kanishk2391
kanishk2391 / unsmoothMesh.py
Last active March 16, 2021 03:24
Reconstruct Subdiv for Maya
#---------Reconstruct Subdiv Script for Maya----------
#Script by - Kanishk Chouhan
#Email - kanishk2391@gmail.com
#Blog - www.pixel-architect.blogspot.com
#Description -
#This script allows u to reverse the result of smooth operation in maya after deleting the history
#It also preserves the original UV of the mesh
#Select the mesh u want to unsmooth and execute the script
#Script might take some time to execute depending on the polycount...
@metalix00
metalix00 / cudaTest.cpp
Created August 31, 2014 02:28
Example code for http://vfxcode.blogspot.co.nz/ cuda intro
#include "cudaTest.h"
CudaTest::CudaTest()
{
}
void* CudaTest::creator()
{
return new CudaTest;
}
@iberianpig
iberianpig / .ideavimrc
Created March 30, 2015 14:23
IdeaVIM用のキーマップ
"検索をファイルの先頭へ循環しない
set nowrapscan
"大文字小文字の区別なし
set ignorecase
"検索時に大文字を含んでいたら大/小を区別
set smartcase
"検索対象をハイライト
@taikomatsu
taikomatsu / gist:99d34488eebe0225510f
Created June 22, 2015 07:25
Stick to closest uv
from maya import OpenMaya
from pymel.core import *
import math
class UvCoord(object):
def __init__(self, u, v):
self.u = u
self.v = v
def dist(self, uv):
@taikomatsu
taikomatsu / gist:98f77bf067bb9bfd4ffd
Last active August 29, 2015 14:23
Render sequence on Render View
# 何らかの理由でbatchレンダリングがうまくいかない、Maya HWだと何故かレンダリングが遅い、みたいなときに便利なスクリプト
# 連番をRender View上でレンダリングします
# Progress window付きでキャンセルすることが可能ですが、なぜかRender Viewの下に隠れてしまうので上手いことやらないとキャンセル出来ないので要注意
from pymel.core import *
from maya import mel
import math
preroll_start = None
s = int(playbackOptions(q=True, min=True)) # start frame
e = int(playbackOptions(q=True, max=True)) # end frame
// c# setWeights(),setWeight()
// http://ueta.hateblo.jp/entry/2015/08/24/102937
private void n(string name, ref MDagPath dp)
{
MSelectionList sellist = new MSelectionList();
MGlobal.getSelectionListByName( name, sellist );
sellist.getDagPath( 0 , dp );
}