This file contains hidden or 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 socket | |
| from flask import Flask, request, jsonify | |
| MAYA_HOST = '127.0.0.1' | |
| MAYA_MEL_PORT = 7003 | |
| HTML = f''' | |
| <!doctype html> | |
| <title>htom</title> | |
| <h1>your maya command</h1> |
This file contains hidden or 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 auth import session | |
| import ftrack_api.event.base | |
| def note_validator(entity): | |
| return any(map(lambda x: x['entity_type'] in ('Task', 'AssetVersion'), entity['parents'])) | |
| def version_validator(entity): | |
| asset_version = session.get(entity['entity_type'], entity['entityId']) |
This file contains hidden or 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 PySide2 import QtCore, QtUiTools | |
| import os | |
| import importlib | |
| def load_ui(uifile, baseinstance=None): | |
| """ | |
| a function to load an ui file to self like this | |
| class CreateAssetGui(QtWidgets.QDialog): |
This file contains hidden or 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
| #!/bin/bash | |
| while true | |
| do | |
| tunnels=`lsof -i | grep *:3389 | wc -l` | |
| # echo $tunnels | |
| if [ "$tunnels" == "2" ] | |
| then | |
| : | |
| # echo the tunnel is ok |
This file contains hidden or 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 pymel.core as pm | |
| import random | |
| def ramp_to_curve(curve, anim_length=20, color1=(0.01, 0.01, 0.01), color2=(1, 1, 1)): | |
| ramp = pm.shadingNode('ramp', asTexture=True) | |
| place2d = pm.shadingNode('place2dTexture', asUtility=True) | |
| place2d.outUV >> ramp.uvCoord | |
| place2d.outUvFilterSize >> ramp.uvFilterSize | |
| ramp.cel[2].ep.set(1) | |
| ramp.cel[0].color.set(color1) |
This file contains hidden or 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 sys | |
| from PySide2 import QtNetwork | |
| from PySide2.QtCore import QCoreApplication, QUrl, QFile | |
| class NetworkManagerWrapper(object): | |
| def __init__(self): | |
| print(f'{QtNetwork.QSslSocket.sslLibraryBuildVersionString()=}') # openssl version need to by installed | |
| print(f'{QtNetwork.QSslSocket.supportsSsl()=}') # have to be true |
This file contains hidden or 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 pymel.core as pm | |
| from random import uniform | |
| def tremor_curve(src_curve, frame_step, amplitude): | |
| num_keys = src_curve.numKeys() | |
| min_frame = src_curve.getTime(0) | |
| max_frame = src_curve.getTime(num_keys - 1) | |
| for f in range(int(min_frame) + frame_step, int(max_frame), frame_step): |
This file contains hidden or 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 random | |
| import sys | |
| from PySide2 import QtWidgets, QtCore | |
| PROGRAMS = [ | |
| ['ping.exe', ['google.com']], | |
| ['notepad.exe', []], | |
| ['nothing', []], | |
| ] |
This file contains hidden or 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 random | |
| import sys | |
| import time | |
| from PySide2 import QtWidgets, QtCore | |
| class MyThread(QtCore.QThread): | |
| message = QtCore.Signal(str) |
This file contains hidden or 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 pymel.core as pm | |
| sel = pm.selected()[0] | |
| shape = sel.node() | |
| follicle_shape = pm.createNode('follicle', skipSelect=True) | |
| follicle_tr = follicle_shape.getParent() | |
| shape.outMesh >> follicle_shape.inputMesh | |
| shape.worldMatrix[0] >> follicle_shape.inputWorldMatrix | |
| follicle_shape.outRotate >> follicle_tr.rotate | |
| follicle_shape.outTranslate >> follicle_tr.translate | |
| u, v = sel.getUV() |
NewerOlder