Skip to content

Instantly share code, notes, and snippets.

@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;
@tm8r
tm8r / get_maya_qcolor.py
Last active March 13, 2020 18:28
Extract QColor from Maya
from Qt import QtGui
from Qt import QtWidgets
app = QtWidgets.QApplication.instance()
palette = app.palette()
roles = [
QtGui.QPalette.ColorRole.WindowText,
QtGui.QPalette.ColorRole.Foreground,
QtGui.QPalette.ColorRole.Button,
QtGui.QPalette.ColorRole.Light,
@tm8r
tm8r / embed_test.py
Last active August 23, 2024 11:37
Mayaでシーンファイルに情報を埋め込む
from maya import cmds
print(cmds.fileInfo("custom_note",q=True))
cmds.fileInfo("custom_note", "test")
print(cmds.fileInfo("custom_note",q=True))
# fileInfoだけ変更したのちにFile>SaveSceneを実行すると変更なしと判定されるので、差し支えなければcmds.fileで強制的に保存した方が良い
cmds.file(save=True)
# result:
# []
# [u'test']
@tm8r
tm8r / konami_command.py
Last active December 2, 2017 08:04
Mayaでコナミコマンド
# -*- coding: utf-8 -*-
u"""KonamiCommand"""
from __future__ import absolute_import, division, print_function
from Qt import QtGui, QtWidgets
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin
import time
@tm8r
tm8r / filecopy.js
Created October 25, 2016 11:21
DriveFileCopy
function doGet(e) {
var fileId = e.parameter.fileId;
Logger.log("fileId:"+fileId);
if (!fileId){
Logger.log("invalid fileId.");
return HtmlService.createHtmlOutput(false);
}
var file = DriveApp.getFileById(fileId);
if (!file){
Logger.log("file is not found.");
@tm8r
tm8r / SelectType.cs
Created October 20, 2016 11:04
SelectType
using UnityEngine;
using UnityEditor;
public class SelectType : MonoBehaviour
{
[MenuItem ("Tools/SelectType #t")]
static void SelectViewerSetting ()
{
var target = FindObjectOfType<Light> ();
if (target == null) {
@tm8r
tm8r / ManyItemsWindow.cs
Created July 13, 2016 04:26
ManyItemsWindow.cs
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
public class ManyItemsWindow : EditorWindow
{
static ManyItemsWindow window;
static readonly Vector2 windowMinSize = new Vector2 (700f, 300f);
const float lineHeight = 16f;
@tm8r
tm8r / UDPManager.cs
Created May 24, 2016 10:07
UnityでUDP受信するやつ
using UnityEngine;
using UniRx;
using UdpReceiverUniRx;
using System.IO;
namespace Viewer
{
public class UDPManager : SingletonMonoBehaviour<UDPManager>
{
public UdpReceiverRx _udpReceiverRx;
@tm8r
tm8r / MenuPresenter.cs
Created May 13, 2016 11:32
MenuPresenter
using UnityEngine;
using UnityEngine.UI;
using UniRx;
using UniLinq;
using System.IO;
using System.Collections;
using System.Collections.Generic;
namespace Viewer
{
@tm8r
tm8r / CheckSameMaterials.cs
Created May 2, 2016 10:58
CheckSameMaterials
using UnityEngine;
using UnityEditor;
using UniLinq;
using System.IO;
public class CheckSameMaterials
{
static readonly string[] validExtensions = { ".prefab", ".fbx" };
[MenuItem ("Assets/CheckSameMaterials")]