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
import math | |
def my_sin(x): | |
e = x | |
f = 1.0 | |
t = 0.0 | |
for i in range(1, 100): | |
if i % 2 == 1: | |
t += e / f |
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
import numpy as np | |
import copy | |
from pprint import pprint | |
# 目的行の列が0だった場合に入れ替える | |
def swap_row(mtx, rev_mtx, row, col): | |
num = mtx[row][col] | |
if num == 0.0: | |
org_vec = mtx[row] | |
org_rev_vec = rev_mtx[row] |
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
from maya import cmds | |
import imp | |
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin | |
try: | |
imp.find_module('PySide2') | |
from PySide2.QtWidgets import * | |
from PySide2.QtGui import * | |
from PySide2.QtCore import * | |
except ImportError: | |
from PySide.QtGui import * |
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 sys | |
import maya.api.OpenMaya as om2 | |
##コマンド名 | |
kPluginCmdName = "testCommand" | |
def maya_useNewAPI(): | |
##新しいAPIですよという宣言がいるらしい | |
pass |
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 sys | |
import maya.api.OpenMaya as om2 | |
#import maya.api.OpenMayaUI as omui | |
kPluginCmdName = "editorSampleCommand" # MELコマンド名 | |
kShortFlagName = "-ts" # 引数のショートネーム | |
kLongFlagName = "-test" # 引数のロングネーム | |
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 -*- | |
from maya import cmds | |
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin | |
import maya.api.OpenMaya as om2 | |
import maya.api.OpenMayaAnim as oma2 | |
import time | |
import imp | |
try: | |
imp.find_module('PySide2') | |
from PySide2.QtWidgets import * |
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
class SampleTableModel(QAbstractTableModel): | |
def __init__(self, data, parent=None, influences=None, vertices=None): | |
super(self.__class__, self).__init__(parent) | |
self._weight_data = data | |
self.v_header_list = vertices | |
self.h_header_list = influences | |
#ヘッダー設定をオーバーライド | |
def headerData(self, id, orientation, role): | |
if orientation == Qt.Horizontal: |
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 -*- | |
from maya import cmds | |
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin | |
import maya.api.OpenMaya as om2 | |
import maya.api.OpenMayaAnim as oma2 | |
import time | |
import imp | |
try: | |
imp.find_module('PySide2') | |
from PySide2.QtWidgets import * |
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 -*- | |
from maya import cmds | |
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin | |
import maya.api.OpenMaya as om2 | |
import maya.api.OpenMayaAnim as oma2 | |
import time | |
import imp | |
try: | |
imp.find_module('PySide2') | |
from PySide2.QtWidgets import * |
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 -*- | |
from maya import cmds | |
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin | |
import time | |
import imp | |
try: | |
imp.find_module('PySide2') | |
from PySide2.QtWidgets import * | |
from PySide2.QtGui import * | |
from PySide2.QtCore import * |
NewerOlder