Skip to content

Instantly share code, notes, and snippets.

View yamahigashi's full-sized avatar

yamahigashi

View GitHub Profile
// Maya Mel UI Configuration File.Maya Mel UI Configuration File..
//
//
// This script is machine generated. Edit at your own risk.
//
//
////////////////////////////////////////////////////////////////////
global proc UI_Mel_Configuration_think(){
string $localized_resources_path = `getenv MAYA_LOCATION`+("/resources/l10n/");
string $all_file[]=`getFileList -folder $localized_resources_path`;
@hiroki-o
hiroki-o / VrmRuntimeLoader.cs
Created April 15, 2020 02:21
FileOpenDialog Loader script (WebGL supported)
using System;
using System.Collections;
using System.Runtime.InteropServices;
using SFB;
using UnityEngine;
using VRM;
//
// Get SFB from https://github.com/gkngkc/UnityStandaloneFileBrowser
@rgl
rgl / python-embedded.md
Last active March 18, 2024 15:33
notes about python embedded in windows

The gist is:

  1. install the normal python from python.org
  2. install everything into a venv
  3. copy the venv into python embed.

A raw example

unzip python-3.8.0-embed-amd64.zip
@defTechAndrew
defTechAndrew / fbx_animation_editing.py
Created April 1, 2019 22:01
Here are some useful calls I've developed for editing FBX animation files using the Python FBX SDK.
import FbxCommon
def fbx_trim_keys(scene, start, end, take_buffer=10):
"""
Uses the FBX SDK to remove unnecessary keys.
:param scene: FBX SDK scene class that hold data to edit
:param int start: start frame of animation keys to keep
:param int end: end frame of animation keys to keep
@tm8r
tm8r / shaderfx
Last active July 7, 2023 08:50
Maya shadefx command reference(Maya2018.2)
shaderfx
Options:
-sfxnode
Specify the dagPath of the ShaderfxShader you are working on
The -sfxnode has to be supplied with (almost) every other flag
Example: shaderfx -sfxnode "ShaderfxShader1" -start;
@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
@ryusas
ryusas / workspaceControl.py
Created April 18, 2017 06:57
A simple example to avoid the issue of Maya 2017 workspaceControl.
# coding: utf-8
u"""
Maya 2017 workspaceControl の問題回避のサンプル。
workspaceControl と workspaceControlState のゴミが残らないようにする。
retain=False の場合でも何故か state のゴミが残ってしまうが、
scriptJob で workspaceControl の削除を監視して state も同時に削除するようにする。
retain=True の場合は、UI が閉じたとしても state は残って良いはずなので監視はしない。
@coxevan
coxevan / mobu_evaluate_decorator.py
Last active August 7, 2020 13:26
Gotcha Examples
def toggle_parallel_settings( func ):
def _wrapper( *args, **kwargs ):
# Store the initial values.
evaluate_manager = pyfbsdk.FBEvaluateManager()
p_evaluation = evaluate_manager.ParallelEvaluation
p_pipeline = evaluate_manager.ParallelPipeline
p_deformation = evaluate_manager.ParallelDeformation
# Turn them all off
evaluate_manager.ParallelEvaluation = False
@andrearastelli
andrearastelli / unitCube.py
Created March 5, 2017 11:42
MAYA - unitCube using MFnMesh
import maya.api.OpenMaya as OpenMaya
mesh = OpenMaya.MFnMesh()
# Simple unitCube coordinates
vertices = []
vertices.append(OpenMaya.MPoint( 1, 1, 1)) # 0
vertices.append(OpenMaya.MPoint( 1, -1, 1)) # 1
vertices.append(OpenMaya.MPoint( 1, -1, -1)) # 2
@YoshihideSogawa
YoshihideSogawa / Purchaser.cs
Created May 19, 2016 07:42
UnityIAPでハマりながら作ったクラス
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
/// <summary>
/// 課金処理を扱うクラスです。
/// 非消費、サブスクリプション型は動作未検証です。
/// Android/iOSのみ動作検証しています。
/// INFO:[iOS]未購入のアイテムがあるとInitialize後すぐに認証ダイアログが表示されるので、呼び出すタイミングを調整してください