This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// JSON読み込みユーティリティ | |
/// 参考URL : http://takachan.hatenablog.com/entry/2017/01/18/120000 | |
/// </summary> | |
public static class JsonUtility | |
{ | |
public static string GetFileString(string filePath) | |
{ | |
StreamReader file = new StreamReader(filePath, Encoding.UTF8); | |
return file.ReadToEnd(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel.Design; | |
using System.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Globalization; | |
using System.Runtime.InteropServices; | |
using Microsoft.VisualStudio; | |
using Microsoft.VisualStudio.OLE.Interop; | |
using Microsoft.VisualStudio.Shell; | |
using Microsoft.VisualStudio.Shell.Interop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using UnityEngine; | |
using UnityEngine.Assertions; | |
public partial class Bitmap | |
{ | |
public uint width { get { return _width; } } | |
public uint height { get { return _height; } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
public partial class Bitmap | |
{ | |
private struct BilinearInterpolator | |
{ | |
public float ratioX; | |
public float ratioY; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#=========================================== | |
# 現在のカメラに表示されているオブジェクトを選択する | |
#=========================================== | |
import maya.OpenMaya as om_1 | |
import maya.OpenMayaUI as omUI_1 | |
# 現在選択されているビューの取得 | |
currentView = omUI_1.M3dView.active3dView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#=========================================== | |
# カメラから直線方向にある選択メッシュに対してRayを飛ばす | |
# (視野角は考慮してないんでカメラは方向だけです。) | |
#=========================================== | |
import maya.api.OpenMaya as om | |
# vector用カメラの諸々を取得 | |
camera_selList = om.MGlobal.getSelectionListByName("camera1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#=========================================== | |
# UV座標に対応するワールド座標とワールド座標に対応するUV座標 | |
#=========================================== | |
import maya.api.OpenMaya as om | |
# メッシュもろもろ取得 | |
mesh_selList = om.MGlobal.getActiveSelectionList() | |
mesh_dag = mesh_selList.getDagPath(0) | |
mesh_MFn = om.MFnMesh(mesh_dag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// スコープの開始と終了を出力する | |
struct PrintScope | |
{ | |
// コンストラクタ | |
PrintScope(const char* name) | |
: _Name(name) | |
{ | |
std::cout << _Indent << "Start " << _Name << std::endl; | |
_Indent.push_back(' '); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 例外を生成する | |
struct ExceptionFactory | |
{ | |
// アクセス違反を発生させる | |
static void AccessViolation() | |
{ | |
PrintScope scope("AccessViolation"); | |
*((int*)0) = 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// とくに意味のない適当な関数 | |
void Exec() | |
{ | |
PrintScope scope("Exec"); | |
// 例外がいっぱい | |
ExceptionFactory::AccessViolation(); | |
//ExceptionFactory::DivideByZero(); | |
//ExceptionFactory::StackOverflow(); | |
} |
OlderNewer