Skip to content

Instantly share code, notes, and snippets.

Megumi Ando fereria

Block or report user

Report or block fereria

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View graphics_view_zoom.py
# -*- coding: utf-8 -*-
import sys
import os
import os.path
from PySide2 import QtCore, QtGui, QtWidgets
from PySide2.QtUiTools import QUiLoader
ZOOM_MIN = -0.5
View markdown.json
{
// Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@fereria
fereria / parse_json.py
Last active Apr 28, 2019
Jsonを読み込む
View parse_json.py
# -*- coding: utf-8 -*-
import json
from collections import OrderedDict
json_file = "R:/marmoset/muravision/std_4/meta.json"
with open(json_file,'r') as f:
od = json.loads(f.read(), object_pairs_hook=OrderedDict)
print od
View convert.bat
cd /d "C:\Program Files\Autodesk\Maya2018\bin"
mayapy pyside2-uic -o %~dp0<path>\ui\main_ui.py %~dp0ui\main.ui
cd /d %~dp0
View time_stamp_check.py
# -*- coding: utf-8 -*-
import os
import os.path
def is_file_update(src, dst):
"""
srcとdstを比較して、
srcのほうが新しい場合Trueを返す
View datetime_test.py
# -*- coding: utf-8 -*-
"""
datetimeの使い方
"""
from datetime import datetime
now = datetime.now()
# str->datetime
View dict_test.py
# -*- coding: utf-8 -*-
"""
基本はListと同じ。
違いは {} なのと、 key:value for x in XXX になっているところ
"""
d = {str(x): x * 3 for x in range(10)}
print (d)
View init_code.py
# -*- coding: utf-8 -*-
import glob
import sys
import os.path
import importlib
import re
this_file = os.path.dirname(os.path.abspath(__file__))
View exec_py.mel
global proc exec_python_file(string $py_path){
string $cmd[];
$fileId=fopen($py_path,"r");
string $nextLine = `fgetline $fileId`;
while ( size( $nextLine ) > 0 ) {
appendStringArray $cmd {$nextLine} 1;
$nextLine = `fgetline $fileId`;
}
View duplicate_reference.py
# -*- coding: utf-8 -*-
"""
選択しているリファレンスを複製する
複数OK、数値はTransformノード限定
"""
import pymel.core as pm
import os.path
# 現在選択中のノードのFileReferenceを取得する
sel_node = pm.ls(sl=True)
You can’t perform that action at this time.