Skip to content

Instantly share code, notes, and snippets.

View yamahigashi's full-sized avatar

yamahigashi

View GitHub Profile
import maya.api.OpenMaya as om
import maya.api.OpenMayaUI as omui
# ======================================================================
SLIM_MASK = omui.M3dView.kDisplayTextures + omui.M3dView.kDisplayMeshes + omui.M3dView.kDisplayGrid
ALL_MASK = omui.M3dView.kDisplayEverything
def hoge(mask):
import ctypes
class MEMORYSTATUSEX(ctypes.Structure):
_fields_ = [
('dwLength', ctypes.c_ulong),
('dwMemoryLoad', ctypes.c_ulong),
('ullTotalPhys', ctypes.c_ulonglong),
('ullAvailPhys', ctypes.c_ulonglong),
@yamahigashi
yamahigashi / select_opposite.py
Last active January 29, 2018 02:15
Select opposite nodes currentry selected for Autodesk Maya.
import re
from maya.api import OpenMaya as OpenMaya2
def select_opposite():
# type: () -> None
y = OpenMaya2.MGlobal.getActiveSelectionList()
sel_strings = y.getSelectionStrings()
@yamahigashi
yamahigashi / auto_enable_vp2.py
Created January 25, 2018 05:11
Enable viewport2.0 with antialias on opening secen for Autodesk Maya.
from textwrap import dedent
from maya import OpenMaya as om
from maya import cmds
from maya import mel
def auto_enable_vp2(arg):
force_vp2_cmd = dedent("""
string $panels[] = `getPanel -type modelPanel`;
@yamahigashi
yamahigashi / add_corner_widget_to_maya_main_menu.py
Last active September 15, 2023 03:31
Add corner widget to maya main menu bar.
from Qt import QtWidgets
def getMayaMainWindow():
# type: () -> QtWidgets.QWidget
for obj in QtWidgets.qApp.topLevelWidgets():
if obj.objectName() == 'MayaWindow':
return obj
else:
#!/usr/bin/env python
# -'''- coding: utf-8 -'''-
import os
import sys
from PySide2 import QtQuickWidgets
from PySide2.QtCore import QUrl
import maya.mel as mel
import maya.cmds as cmds
import_command = "DoraSkinWeightImport( \"{name}.dsw\", $gDoraSkinWeightImpExp_ImpMode, 0, 1, 0.001)"
all = [x for x in cmds.ls(sl=True)]
for x in all:
cmds.select(x)
mel.eval(import_command.format(name=x))
@yamahigashi
yamahigashi / except_result.rst
Created April 12, 2017 08:45
Except annotation as restrcturedText

MAYA sampleメニュー 解説

Animation

Mirror Selected (animation):

no description

autoLoader.mll 1.463225366
autoLoader.mll 1.735383116
autoLoader.mll 2.210803252
autoLoader.mll 2.562135002
autoLoader.mll 2.616407629
autoLoader.mll 2.678918174
autoLoader.mll 2.762849043
autoLoader.mll 2.827423119
autoLoader.mll 2.866582192
autoLoader.mll 2.870142490
@yamahigashi
yamahigashi / add_custom_module_to_autorigs.py
Created March 24, 2017 10:13
Add custom rig-module to autorigs for SideFX Houdini
import os
import hou
from whereis.customModule import CustomModule
import autorigs.asset.moduleInfos as info
import autorigs.asset.defaultProperties as props
info.CUSTOM_MODULE_ICON = hou.ui.createQtIcon('OBJ_autorig', info.ICON_SIZE, info.ICON_SIZE)
info.MODULES_DATA.append(('custom', 'Custom', info.SPINE_ICON))