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
def conform(txt): | |
""" | |
Conform plain text as Python executable command | |
this can be useful for whenever we need to get python | |
as plain text format from a text widget and execute that | |
for example: | |
exec(command) | |
mel.eval('python({})'.format(command)) | |
unreal.PythonScriptLibrary.execute_python_command_ex(command) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<ui version="4.0"> | |
<class>MainWindow</class> | |
<widget class="QWidget" name="MainWindow"> | |
<property name="geometry"> | |
<rect> | |
<x>0</x> | |
<y>0</y> | |
<width>280</width> | |
<height>600</height> |
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
""" | |
Example usage to get/post data on server from client.py | |
``` | |
import requests | |
url = 'http://localhost:8000' | |
def get(url): |
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
''' | |
Simple chatroom | |
Reference | |
https://docs.python.org/2/library/threading.html | |
http://blog.oddbit.com/2013/11/23/long-polling-with-ja/ | |
http://zulko.github.io/blog/2013/09/19/a-basic-example-of-threads-synchronization-in-python/ | |
http://www.laurentluce.com/posts/python-threads-synchronization-locks-rlocks-semaphores-conditions-events-and-queues/ | |
''' | |
import time |
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 | |
import numpy as np | |
from transforms3d import * | |
np.set_printoptions(precision=3) | |
np.set_printoptions(suppress=True) |
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 | |
np.set_printoptions(precision=3) | |
np.set_printoptions(suppress=True) | |
def change_xform(source_xform, change_of_basis): | |
""" | |
Change a transformation matrix from one coordinate to another |
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 builtins import int | |
from shiboken2 import wrapInstance | |
from maya import cmds, OpenMayaUI as omui | |
from Qt import QtWidgets, QtCore | |
from Qt import _loadUi | |
def Dock(Widget, show=True): | |
name = Widget.__class__.__name__ |
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 random | |
import sys | |
from time import sleep | |
from Qt import QtWidgets, QtCore, QtGui | |
class RunnerSignals(QtCore.QObject): | |
progressed = QtCore.Signal(int) | |
messaged = QtCore.Signal(str) |
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 sys | |
from time import sleep | |
from Qt import QtWidgets, QtCore, QtGui | |
class Worker(QtCore.QObject): | |
progressed = QtCore.Signal(int) | |
messaged = QtCore.Signal(str) | |
finished = QtCore.Signal() |
NewerOlder