An elaboration of QML SceneGraph 1
python main.py --amount 100
""" | |
This code can be run from a Maya script editor | |
""" | |
import subprocess | |
import cPickle | |
print 'This value below should be a 1000:' | |
p = subprocess.Popen(["/path/to/multi_test.py", "-po"], stdout=subprocess.PIPE) | |
result = cPickle.load(p.stdout) |
from PyQt4 import QtGui, QtCore | |
import maya.cmds as cmds | |
import maya.OpenMayaUI as mui | |
import sip | |
def convertToQT(controlName): | |
controlPoniter = mui.MQtUtil.findControl(controlName) | |
if controlPoniter is not None: | |
return sip.wrapinstance(long(controlPoniter), QtCore.QObject) |
An elaboration of QML SceneGraph 1
python main.py --amount 100
from PySide import QtGui | |
class QDictBox(QtGui.QDialog): | |
WIDGETS = {str: QtGui.QLineEdit, | |
unicode: QtGui.QLineEdit, | |
int: QtGui.QSpinBox, | |
float: QtGui.QDoubleSpinBox, | |
list: QtGui.QComboBox, | |
bool: QtGui.QCheckBox} |
import maya.api.OpenMaya as om | |
import maya.api.OpenMayaUI as omui | |
import maya.cmds as cmds | |
# Maya Python API: | |
# http://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__py_ref_index_html | |
def onPress(): | |
"""Take x,y from mouse click, convert into 3d world coordinates""" |
# Do some setup for Maya's Qt | |
set(QT_VERSION_MAJOR 5) | |
# Set moc Path | |
set(QT_MOC_EXECUTABLE ${MAYA_BIN_PATH}/moc) | |
add_executable(Qt5::moc IMPORTED) | |
set_target_properties(Qt5::moc PROPERTIES IMPORTED_LOCATION ${QT_MOC_EXECUTABLE}) | |
set(CMAKE_AUTOMOC TRUE) | |
# Set the UIC Path |
Andrew Ng lecture, Stanford Graduate School of Business
High level, but totally worth watching.
https://www.youtube.com/watch?v=21EiKfQYZXc
I went looking for lectures from different sources and these are a great "from first principles" introduction. The newer cs231n lectures may have more relevant details, but I like Andrej Karpathy's