diff --git a/tools/MayaExporter/MayaExporter.sln b/tools/MayaExporter/MayaExporter.sln new file mode 100644 index 00000000..1ab742ff --- /dev/null +++ b/tools/MayaExporter/MayaExporter.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MayaExporter", "MayaExporter\MayaExporter.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|ARM.ActiveCfg = Debug|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.ActiveCfg = Debug|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.Build.0 = Debug|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x86.ActiveCfg = Debug|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x86.Build.0 = Debug|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|ARM.ActiveCfg = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.ActiveCfg = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.Build.0 = Release|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x86.ActiveCfg = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/MayaExporter/MayaExporter/GeneratedFiles/Debug/moc_Menu.cpp b/tools/MayaExporter/MayaExporter/GeneratedFiles/Debug/moc_Menu.cpp new file mode 100644 index 00000000..aef8d533 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/GeneratedFiles/Debug/moc_Menu.cpp @@ -0,0 +1,107 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'Menu.h' +** +** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../../Menu.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'Menu.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.6. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_Menu[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 7, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 14, 6, 5, 5, 0x08, + 35, 5, 5, 5, 0x08, + 59, 5, 5, 5, 0x08, + 75, 5, 5, 5, 0x08, + 95, 5, 5, 5, 0x08, + 116, 5, 5, 5, 0x08, + 137, 5, 5, 5, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_Menu[] = { + "Menu\0\0checked\0ExportSelected(bool)\0" + "ExportPathClicked(bool)\0ExportAll(bool)\0" + "CancelClicked(bool)\0Button1Clicked(bool)\0" + "Button2Clicked(bool)\0Button3Clicked(bool)\0" +}; + +void Menu::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + Menu *_t = static_cast(_o); + switch (_id) { + case 0: _t->ExportSelected((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 1: _t->ExportPathClicked((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 2: _t->ExportAll((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 3: _t->CancelClicked((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 4: _t->Button1Clicked((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 5: _t->Button2Clicked((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 6: _t->Button3Clicked((*reinterpret_cast< bool(*)>(_a[1]))); break; + default: ; + } + } +} + +const QMetaObjectExtraData Menu::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject Menu::staticMetaObject = { + { &QWidget::staticMetaObject, qt_meta_stringdata_Menu, + qt_meta_data_Menu, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &Menu::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *Menu::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *Menu::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_Menu)) + return static_cast(const_cast< Menu*>(this)); + return QWidget::qt_metacast(_clname); +} + +int Menu::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 7) + qt_static_metacall(this, _c, _id, _a); + _id -= 7; + } + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/tools/MayaExporter/MayaExporter/GeneratedFiles/qrc_leeeeel.cpp b/tools/MayaExporter/MayaExporter/GeneratedFiles/qrc_leeeeel.cpp new file mode 100644 index 00000000..aa8f5d73 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/GeneratedFiles/qrc_leeeeel.cpp @@ -0,0 +1,29 @@ +/**************************************************************************** +** Resource object code +** +** Created by: The Resource Compiler for Qt version 4.8.6 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +QT_END_NAMESPACE + + +int QT_MANGLE_NAMESPACE(qInitResources_leeeeel)() +{ + return 1; +} + +Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_leeeeel)) + +int QT_MANGLE_NAMESPACE(qCleanupResources_leeeeel)() +{ + return 1; +} + +Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_leeeeel)) + diff --git a/tools/MayaExporter/MayaExporter/GeneratedFiles/ui_MayaExporter.h b/tools/MayaExporter/MayaExporter/GeneratedFiles/ui_MayaExporter.h new file mode 100644 index 00000000..68d5aaf4 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/GeneratedFiles/ui_MayaExporter.h @@ -0,0 +1,69 @@ +/******************************************************************************** +** Form generated from reading UI file 'MayaExporter.ui' +** +** Created by: Qt User Interface Compiler version 4.8.6 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_MAYAEXPORTER_H +#define UI_MAYAEXPORTER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_leeeeelClass +{ +public: + QMenuBar *menuBar; + QToolBar *mainToolBar; + QWidget *centralWidget; + QStatusBar *statusBar; + + void setupUi(QMainWindow *leeeeelClass) + { + if (leeeeelClass->objectName().isEmpty()) + leeeeelClass->setObjectName(QString::fromUtf8("leeeeelClass")); + leeeeelClass->resize(600, 400); + menuBar = new QMenuBar(leeeeelClass); + menuBar->setObjectName(QString::fromUtf8("menuBar")); + leeeeelClass->setMenuBar(menuBar); + mainToolBar = new QToolBar(leeeeelClass); + mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + leeeeelClass->addToolBar(mainToolBar); + centralWidget = new QWidget(leeeeelClass); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + leeeeelClass->setCentralWidget(centralWidget); + statusBar = new QStatusBar(leeeeelClass); + statusBar->setObjectName(QString::fromUtf8("statusBar")); + leeeeelClass->setStatusBar(statusBar); + + retranslateUi(leeeeelClass); + + QMetaObject::connectSlotsByName(leeeeelClass); + } // setupUi + + void retranslateUi(QMainWindow *leeeeelClass) + { + leeeeelClass->setWindowTitle(QApplication::translate("leeeeelClass", "leeeeel", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class leeeeelClass: public Ui_leeeeelClass {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_MAYAEXPORTER_H diff --git a/tools/MayaExporter/MayaExporter/Main.cpp b/tools/MayaExporter/MayaExporter/Main.cpp new file mode 100644 index 00000000..476f97f2 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/Main.cpp @@ -0,0 +1,42 @@ +#include "MayaIncludes.h" +#include "Menu.h" +#include +#include +using namespace std; +QDialog* dialog; +Menu* menu; + +// called when the plugin is loaded +EXPORT MStatus initializePlugin(MObject obj) +{ + MStatus res = MS::kSuccess; + + MFnPlugin myPlugin(obj, "Maya plugin", "1.0", "Any", &res); + if (MFAIL(res)) + { + CHECK_MSTATUS(res); + } + + MGlobal::displayInfo("Maya plugin loaded!"); + + dialog = new QDialog(); + dialog->setWindowTitle("Custom Exporter"); + + menu = new Menu(dialog); + + dialog->resize(300, 200); + dialog->show(); + + return res; +} + +EXPORT MStatus uninitializePlugin(MObject obj) +{ + MFnPlugin plugin(obj); + + MGlobal::displayInfo("Maya plugin unloaded!"); + + delete dialog; + delete menu; + return MS::kSuccess; +} diff --git a/tools/MayaExporter/MayaExporter/MayaExporter.ui b/tools/MayaExporter/MayaExporter/MayaExporter.ui new file mode 100644 index 00000000..15e99532 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/MayaExporter.ui @@ -0,0 +1,29 @@ + + leeeeelClass + + + leeeeelClass + + + + 0 + 0 + 600 + 400 + + + + leeeeel + + + + + + + + + + + + + diff --git a/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj b/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj new file mode 100644 index 00000000..42b1b45a --- /dev/null +++ b/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj @@ -0,0 +1,246 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B12702AD-ABFB-343A-A199-8E24837244A3} + Qt4VSv1.0 + 8.1 + MayaExporter + + + + DynamicLibrary + v140 + Unicode + + + DynamicLibrary + v140 + Unicode + + + Application + v140 + + + Application + v140 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.23107.0 + + + $(SolutionDir)$(Platform)\$(Configuration)\ + .mll + true + + + $(SolutionDir)$(Platform)\$(Configuration)\ + .mll + true + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + UNICODE;WIN32;QT_DLL;%(PreprocessorDefinitions) + C:\Program Files\Autodesk\Maya2016\include;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + true + Level3 + + + Windows + $(OutDir)$(TargetName)$(TargetExt) + C:\Program Files\Autodesk\Maya2016\lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + qtmaind.lib;%(AdditionalDependencies) + + + + + QT_DLL;QT_NO_IMPORT_QT47_QML;UNICODE;WIN32;%(PreprocessorDefinitions) + C:\Program Files\Autodesk\Maya2016\include;.\GeneratedFiles;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + true + Level1 + + + Windows + $(OutDir)$(TargetName)$(TargetExt) + C:\Program Files\Autodesk\Maya2016\lib;%(AdditionalLibraryDirectories) + true + %(AdditionalDependencies) + MachineX64 + /SUBSYSTEM:WINDOWS + + + + + UNICODE;WIN32;QT_DLL;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories) + + MultiThreadedDLL + true + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + qtmain.lib;%(AdditionalDependencies) + + + + + NDEBUG;QT_DLL;QT_NO_DEBUG;QT_NO_IMPORT_QT47_QML;UNICODE;WIN32;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories) + + + MultiThreadedDLL + true + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + qtmain.lib;%(AdditionalDependencies) + MachineX64 + /SUBSYSTEM:WINDOWS + + + + + + true + true + + + + + + + + + + + + + true + true + + + + + + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + Moc%27ing Menu.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -D_WINDLL -D_UNICODE "-IC:\Program Files\Autodesk\Maya2016\include" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + Moc%27ing Menu.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DQT_DLL -DQT_NO_IMPORT_QT47_QML -DUNICODE -DWIN32 -D_WINDLL -D_UNICODE "-IC:\Program Files\Autodesk\Maya2016\include" "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)\." + Moc%27ing Menu.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + Moc%27ing Menu.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DNDEBUG -DQT_DLL -DQT_NO_DEBUG -DQT_NO_IMPORT_QT47_QML -DUNICODE -DWIN32 "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + + + + + + + %(FullPath);%(AdditionalInputs) + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + + + + + + + + + + + \ No newline at end of file diff --git a/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj.filters b/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj.filters new file mode 100644 index 00000000..d5bcfd00 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj.filters @@ -0,0 +1,73 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;cxx;c;def + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + moc;h;cpp + False + + + {bd033994-5bd0-43b7-8fdf-7b8a213a1c55} + cpp;moc + False + + + {f53efcfb-95d1-44a6-a82f-295bb0b0509c} + cpp;moc + False + + + + + Generated Files + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files + + + Source Files + + + + + Resource Files + + + Header Files + + + Form Files + + + + + Header Files + + + Generated Files + + + \ No newline at end of file diff --git a/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj.user b/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj.user new file mode 100644 index 00000000..8fa85117 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/MayaExporter.vcxproj.user @@ -0,0 +1,19 @@ + + + + PATH=$(QTDIR)\bin%3b$(PATH) + C:\Program Files\Autodesk\Maya2016 + + + PATH=$(QTDIR)\bin%3b$(PATH) + C:\Program Files\Autodesk\Maya2016 + + + PATH=$(QTDIR)\bin%3b$(PATH) + C:\Program Files\Autodesk\Maya2016 + + + PATH=$(QTDIR)\bin%3b$(PATH) + C:\Program Files\Autodesk\Maya2016 + + \ No newline at end of file diff --git a/tools/MayaExporter/MayaExporter/MayaIncludes.h b/tools/MayaExporter/MayaExporter/MayaIncludes.h new file mode 100644 index 00000000..3573d30d --- /dev/null +++ b/tools/MayaExporter/MayaExporter/MayaIncludes.h @@ -0,0 +1,62 @@ +#ifndef MAYAINCLUDES_H +#define MAYAINCLUDES_H + +#define NT_PLUGIN +#define REQUIRE_IOSTREAM +#define EXPORT __declspec(dllexport) + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Wrappers +#include +#include + +#include + + +// Messages +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Commands +#include + +// Libraries to link from Maya +#pragma comment(lib,"Foundation.lib") +#pragma comment(lib,"OpenMaya.lib") +#pragma comment(lib,"OpenMayaUI.lib") + +#endif \ No newline at end of file diff --git a/tools/MayaExporter/MayaExporter/Menu.cpp b/tools/MayaExporter/MayaExporter/Menu.cpp new file mode 100644 index 00000000..6af300aa --- /dev/null +++ b/tools/MayaExporter/MayaExporter/Menu.cpp @@ -0,0 +1,239 @@ +#include "Menu.h" +#include + +using namespace std; + +Menu::Menu() +{ +} + +Menu::Menu(QDialog* dialog) +{ + // Save the dialog pointer. Needed when the application gets destroyed + dialogPointer = dialog; + + // Create QpushButtons & give them names + exportSelectedButton = new QPushButton("&Export Selected", this); + browseButton = new QPushButton("&...", this); + exportAllButton = new QPushButton("&Export All", this); + cancelButton = new QPushButton("&Cancel", this); + + // Option box and checkboxes + QGroupBox *optionsBox = new QGroupBox(tr("Options")); + + exportAnimationsButton = new QCheckBox(tr("&Export Animations")); + copyTexturesButton = new QCheckBox(tr("&Copy Textures")); + button3 = new QCheckBox(tr("option3")); + + exportAnimationsButton->setChecked(true); + copyTexturesButton->setChecked(true); + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(exportAnimationsButton); + vbox->addWidget(copyTexturesButton); + vbox->addWidget(button3); + vbox->addStretch(1); + optionsBox->setLayout(vbox); + + // Connect the buttons with signals & functions + connect(exportSelectedButton, SIGNAL(clicked(bool)), this, SLOT(ExportSelected(bool))); + connect(browseButton, SIGNAL(clicked(bool)), this, SLOT(ExportPathClicked(bool))); + connect(exportAllButton, SIGNAL(clicked(bool)), this, SLOT(ExportAll(bool))); + connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(CancelClicked(bool))); + + connect(exportAnimationsButton, SIGNAL(clicked(bool)), this, SLOT(Button1Clicked(bool))); + connect(copyTexturesButton, SIGNAL(clicked(bool)), this, SLOT(Button2Clicked(bool))); + connect(button3, SIGNAL(clicked(bool)), this, SLOT(Button3Clicked(bool))); + + // Creating several layouts, adding widgets & adding them to one layout in the end + QHBoxLayout* topLayout = new QHBoxLayout; + QVBoxLayout* midLayout = new QVBoxLayout; + QHBoxLayout* botLayout = new QHBoxLayout; + QVBoxLayout* baseLayout = new QVBoxLayout; + + exportPath = new QLineEdit; + fileDialog = new QFileDialog; + + QLabel* exportLabel = new QLabel; + exportLabel->setText("Export Path:"); + + midLayout->addWidget(optionsBox); + + topLayout->addWidget(exportLabel); + topLayout->addWidget(exportPath); + topLayout->addWidget(browseButton); + + botLayout->addWidget(exportSelectedButton); + botLayout->addWidget(exportAllButton); + botLayout->addWidget(cancelButton); + + baseLayout->addLayout(topLayout); + baseLayout->addLayout(midLayout); + + baseLayout->addSpacing(10); + + baseLayout->addLayout(botLayout); + baseLayout->addStretch(); + + // Set the layout for our window + dialog->setLayout(baseLayout); + +} + +void Menu::ExportSelected(bool checked) +{ + // Retrieving the objects we currently have selected + MSelectionList selected; + MGlobal::getActiveSelectionList(selected); + + // Loop through or list of selection(s) + for (unsigned int i = 0; i < selected.length();i++) + { + MObject object; + selected.getDependNode(i, object); + MFnDependencyNode thisNode(object); + + cout << thisNode.name().asChar() << endl; + GetMeshData(object); + } + if (exportPath->text().isEmpty()) + cout << "Please select a folder." << endl; + else + cout << exportPath->text().toLocal8Bit().constData() << endl; +} + +void Menu::ExportPathClicked(bool) +{ + // Opens up a file dialog. Save/Changes the name in the exportPath + fileDialog->setFileMode(QFileDialog::Directory); + fileDialog->setOption(QFileDialog::ShowDirsOnly); + QString fileName = fileDialog->getExistingDirectory(this, "Select", "/home", QFileDialog::ShowDirsOnly); + exportPath->setText(fileName); +} + +void Menu::ExportAll(bool) +{ + MDagPath path; + + // Loop through all nodes in the scene + MItDependencyNodes it(MFn::kInvalid); + for (;!it.isDone();it.next()) + { + MObject node = it.thisNode(); + if (node.hasFn(MFn::kMesh)) + { + MFnDependencyNode thisNode(node); + + cout << thisNode.name().asChar() << endl; + GetMeshData(node); + } + } + if (exportPath->text().isEmpty()) + cout << "Please select a folder." << endl; + else + cout << exportPath->text().toLocal8Bit().constData() << endl; +} + +void Menu::CancelClicked(bool) +{ + dialogPointer->close(); +} + +void Menu::Button1Clicked(bool) +{ + if(exportAnimationsButton->isChecked()) + cout << "1 checked!" << endl; + else + cout << "1 unchecked!" << endl; +} + +void Menu::Button2Clicked(bool) +{ + if (copyTexturesButton->isChecked()) + cout << "2 checked!" << endl; + else + cout << "2 unchecked!" << endl; +} + +void Menu::Button3Clicked(bool) +{ + if (button3->isChecked()) + cout << "3 checked!" << endl; + else + cout << "3 unchecked!" << endl; +} + +void Menu::GetMeshData(MObject object) +{ + // In here, we retrieve triangulated polygons from the mesh + MFnMesh mesh(object); + + map> vertexToIndex; + + vector verticesData; + vectorindexArray; + + MIntArray intdexOffsetVertexCount, vertices, triangleList; + MPointArray dummy; + + UINT vertexIndex; + MVector normal; + MPoint pos; + float2 UV; + VertexLayout thisVertex; + + for (MItMeshPolygon meshPolyIter(object); !meshPolyIter.isDone(); meshPolyIter.next()) + { + vector localVertexToGlobalIndex; + meshPolyIter.getVertices(vertices); + + meshPolyIter.getTriangles(dummy, triangleList); + UINT indexOffset = verticesData.size(); + + for (UINT i = 0; i < vertices.length(); i++) + { + vertexIndex = meshPolyIter.vertexIndex(i); + pos = meshPolyIter.point(i); + pos.get(thisVertex.pos); + + meshPolyIter.getNormal(i, normal); + thisVertex.normal[0] = normal[0]; + thisVertex.normal[1] = normal[1]; + thisVertex.normal[2] = normal[2]; + + meshPolyIter.getUV(i, UV); + thisVertex.uv[0] = UV[0]; + thisVertex.uv[1] = UV[1]; + + verticesData.push_back(thisVertex); + localVertexToGlobalIndex.push_back(vertexIndex); + + cout << "Pos: " << thisVertex.pos[0] << "/" << thisVertex.pos[1] << "/" << thisVertex.pos[2] << endl; + cout << "Normals: " << thisVertex.normal[0] << "/" << thisVertex.normal[1] << "/" << thisVertex.normal[2] << endl; + cout << "UV: " << thisVertex.uv[0] << "/" << thisVertex.uv[1] << endl; + } + for (UINT i = 0; i < triangleList.length(); i++) + { + UINT k = 0; + while (localVertexToGlobalIndex[k] != triangleList[i]) + k++; + indexArray.push_back(indexOffset + k); + } + } + +} + +void Menu::exportMaterial(MObject object) +{ + MItDependencyNodes matIt(MFn::kLambert); + + +} + +Menu::~Menu() +{ + //delete exportSelectedButton; + //delete browseButton; + //delete exportPath; + //delete fileDialog; + fileDialog->~QFileDialog(); +} \ No newline at end of file diff --git a/tools/MayaExporter/MayaExporter/Menu.h b/tools/MayaExporter/MayaExporter/Menu.h new file mode 100644 index 00000000..44eca702 --- /dev/null +++ b/tools/MayaExporter/MayaExporter/Menu.h @@ -0,0 +1,79 @@ +#ifndef BUTTONS_H +#define BUTTONS_H + +#include +#include + +#include "MayaIncludes.h" +// Qt +#pragma comment(lib, "QtCore4") +#pragma comment(lib, "QtGui4") + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct VertexLayout +{ + float pos[3]; + float normal[3]; + float uv[2]; +}; + +class Menu : public QWidget +{ + Q_OBJECT +public: + Menu(QDialog* dialog); + ~Menu(); + + void GetMeshData(MObject object); + void exportMaterial(MObject object); + +private slots: + void ExportSelected(bool checked); + void ExportPathClicked(bool); + void ExportAll(bool); + void CancelClicked(bool); + + void Button1Clicked(bool); + void Button2Clicked(bool); + void Button3Clicked(bool); + + +private: + Menu(); + QPushButton* exportSelectedButton; + QPushButton* browseButton; + QPushButton* exportAllButton; + QPushButton* cancelButton; + + QCheckBox* exportAnimationsButton; + QCheckBox* copyTexturesButton; + QCheckBox* button3; + + QLineEdit* exportPath; + QFileDialog* fileDialog; + QDialog* dialogPointer; + +}; + +#endif \ No newline at end of file diff --git a/tools/MayaExporter/MayaExporter/leeeeel.qrc b/tools/MayaExporter/MayaExporter/leeeeel.qrc new file mode 100644 index 00000000..60a924dc --- /dev/null +++ b/tools/MayaExporter/MayaExporter/leeeeel.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/tools/TogglToSpreadSheetScript/TogglToSpreadSheet-cca18cfac737.json b/tools/TogglToSpreadSheetScript/TogglToSpreadSheet-cca18cfac737.json deleted file mode 100644 index 781d3f15..00000000 --- a/tools/TogglToSpreadSheetScript/TogglToSpreadSheet-cca18cfac737.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "service_account", - "private_key_id": "cca18cfac73794c4d2976833949829fe150ead81", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCvgdm4HeS54TS9\nS58jhxbaxrFL5yOyyofJo51CtBAMT0aCuV41ngoethfJArjwO1ZziaPRX0ZrQvBC\n3XtIcBblkR/6w0uYF3lTcwuxqpbNrkptQNc7ms91pYHeRJS/u+U0hmnmS+TI8q4c\nm47xbtpw2ym8Uvq1anvYgmnlQQNNgaFcuYSgFLPhRL2TdOR82fz055rHUeEIT3YG\n7RpZBokWQFaZT5KsWbBjjEMlfexg11/9tK1zbDCjqU/JSBRmzmXh0kEbRCWQWC5k\n+ZHSrcD8Sj3d6nfBsxiu8yAW0pYqMEDNnlX69ovqjVlfa1PO+J+7IwY1svde872C\nzrC1huyzAgMBAAECggEASiq2he7kDIUWE3SUkJ/y0Ysru2a3GEQsM9LXjyumqH0L\n0AxjuobJwgazcHedDbAVrYeZ2c3IZWWJQMh147uygVrdx8ul82TgGZrBc1gimFKy\nEw9WpVKbnxzND8+tiITvrE2tDOw/h4e+ekpmkrKEzzJepb3vQqD4KxuZgo8BxUtw\n1bBAq2hKKukc1IlzXv0cegWYqfw1wA3vFngQh+B/ueR3kbLUWu130z2Ls/SnBdHt\nYaIbER6YUrQ6eG2cQrjh711zMjMgMsinyh+MR/VHERspPR7HnNJkEb8LXivoLQE4\nUbBTihups769NJUr3CSqKXHIwv8QO9EfJ6IN8pglwQKBgQDyMEJW3iE0tKaBgtXY\nzJ4TWOkTOoKAnbuZd19ZbqARPfa+6apT4NWCz7pVXcZKv7rsMZTbCHAf3HfptCAq\nQSVkuRZaCv6SOUaWp0kk8cxIJpbvwMeqBY/BDmQr8SzUir6N0M+7G3tV/joqpY5c\n2V1udZeR0Ch4V+F9M/osmyvOIQKBgQC5hBpQlMmeQivk9P1eHkiB1w9RlLIrYjcQ\ndaSFOwgMiswK2/I04P/9BhXXeIin5r5EmpfHOM32wTdu5RkU5Ts428JqAshQBSwZ\nEciofEJ0fvmxCR+d+imG+Kq2BOneatOC6aYBVWr2VUDq8KyD4jL8tju6KOLvssRR\nsoK26wAYUwKBgQCexHpI3jfgiGj7UB0GkiUyw7+P5nR1AnJgSfxM8ZOnmfpu71nE\nwQjXR3x8yAvdJtHQUzSlXmO6z1og7/+CE9ECtb9safa3PysCSkpOGOF1jy61n6iE\n0j6KLfgHQoTEFOyUpYX4wCxblFznZj7sqWZxqk8hvNc7BUmCPZfMtDDEYQKBgQCP\nK+ZrHgjjvEnH71LCmjh3DBRkb495b9jzOPd5Yu95TnzePJSWPrcQ/OtKWVmNysQ4\nid5s/+fkcYVobiKHP8oOvXsy+WbCatt3lYP4k71tzrjA6jueXfxCkBKfWvdqkaMe\nu1dEXDmqVm09Y/Sf66hR5AoAR6GsP5jHPC8pH//4xQKBgQDlVw8Q6Xq5FFUfURvF\n6p8XsCgheykLDzFZHv2neL4ESXpt2flCaLcb+pC8+IrNDorC8BX6JiZD2WngMn+s\nClAkq4TgGE5Mjmk5ZOhrpg69H7O87OcNK5Cc12+tnoPsnvEcuF8CoGWIy3A6PNt+\nROnL6yOGeh2IHowPjrO3ODKO4Q==\n-----END PRIVATE KEY-----\n", - "client_email": "account-1@toggltospreadsheet.iam.gserviceaccount.com", - "client_id": "108608534336227301760", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://accounts.google.com/o/oauth2/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/account-1%40toggltospreadsheet.iam.gserviceaccount.com" -} diff --git a/tools/TogglToSpreadSheetScript/TogglToSpreadsheet.py b/tools/TogglToSpreadSheetScript/TogglToSpreadsheet.py deleted file mode 100644 index a184d914..00000000 --- a/tools/TogglToSpreadSheetScript/TogglToSpreadsheet.py +++ /dev/null @@ -1,101 +0,0 @@ -import base64 -import sys -import re -import pip -try: - import requests -except ImportError: - print 'requests module not installed.' - print 'Installing requests...' - pip.main(['install', 'requests']) - import requests - -try: - import gspread -except ImportError: - print 'gspread module not installed.' - print 'Installing gspread...' - pip.main(['install', 'gspread']) - import gspread - -import json -import time -from oauth2client.client import SignedJwtAssertionCredentials - -def write_to_sheet(values, estimatedTime): - # Note: This is Andreas client email & private google API key. Plz no share - client_email = 'account-1@toggltospreadsheet.iam.gserviceaccount.com' - private_key = 'nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCvgdm4HeS54TS9\nS58jhxbaxrFL5yOyyofJo51CtBAMT0aCuV41ngoethfJArjwO1ZziaPRX0ZrQvBC\n3XtIcBblkR/6w0uYF3lTcwuxqpbNrkptQNc7ms91pYHeRJS/u+U0hmnmS+TI8q4c\nm47xbtpw2ym8Uvq1anvYgmnlQQNNgaFcuYSgFLPhRL2TdOR82fz055rHUeEIT3YG\n7RpZBokWQFaZT5KsWbBjjEMlfexg11/9tK1zbDCjqU/JSBRmzmXh0kEbRCWQWC5k\n+ZHSrcD8Sj3d6nfBsxiu8yAW0pYqMEDNnlX69ovqjVlfa1PO+J+7IwY1svde872C\nzrC1huyzAgMBAAECggEASiq2he7kDIUWE3SUkJ/y0Ysru2a3GEQsM9LXjyumqH0L\n0AxjuobJwgazcHedDbAVrYeZ2c3IZWWJQMh147uygVrdx8ul82TgGZrBc1gimFKy\nEw9WpVKbnxzND8+tiITvrE2tDOw/h4e+ekpmkrKEzzJepb3vQqD4KxuZgo8BxUtw\n1bBAq2hKKukc1IlzXv0cegWYqfw1wA3vFngQh+B/ueR3kbLUWu130z2Ls/SnBdHt\nYaIbER6YUrQ6eG2cQrjh711zMjMgMsinyh+MR/VHERspPR7HnNJkEb8LXivoLQE4\nUbBTihups769NJUr3CSqKXHIwv8QO9EfJ6IN8pglwQKBgQDyMEJW3iE0tKaBgtXY\nzJ4TWOkTOoKAnbuZd19ZbqARPfa+6apT4NWCz7pVXcZKv7rsMZTbCHAf3HfptCAq\nQSVkuRZaCv6SOUaWp0kk8cxIJpbvwMeqBY/BDmQr8SzUir6N0M+7G3tV/joqpY5c\n2V1udZeR0Ch4V+F9M/osmyvOIQKBgQC5hBpQlMmeQivk9P1eHkiB1w9RlLIrYjcQ\ndaSFOwgMiswK2/I04P/9BhXXeIin5r5EmpfHOM32wTdu5RkU5Ts428JqAshQBSwZ\nEciofEJ0fvmxCR+d+imG+Kq2BOneatOC6aYBVWr2VUDq8KyD4jL8tju6KOLvssRR\nsoK26wAYUwKBgQCexHpI3jfgiGj7UB0GkiUyw7+P5nR1AnJgSfxM8ZOnmfpu71nE\nwQjXR3x8yAvdJtHQUzSlXmO6z1og7/+CE9ECtb9safa3PysCSkpOGOF1jy61n6iE\n0j6KLfgHQoTEFOyUpYX4wCxblFznZj7sqWZxqk8hvNc7BUmCPZfMtDDEYQKBgQCP\nK+ZrHgjjvEnH71LCmjh3DBRkb495b9jzOPd5Yu95TnzePJSWPrcQ/OtKWVmNysQ4\nid5s/+fkcYVobiKHP8oOvXsy+WbCatt3lYP4k71tzrjA6jueXfxCkBKfWvdqkaMe\nu1dEXDmqVm09Y/Sf66hR5AoAR6GsP5jHPC8pH//4xQKBgQDlVw8Q6Xq5FFUfURvF\n6p8XsCgheykLDzFZHv2neL4ESXpt2flCaLcb+pC8+IrNDorC8BX6JiZD2WngMn+s\nClAkq4TgGE5Mjmk5ZOhrpg69H7O87OcNK5Cc12+tnoPsnvEcuF8CoGWIy3A6PNt+\nROnL6yOGeh2IHowPjrO3ODKO4Q==' - - # Change the path, otherwise the the json_key will not be found and writing to the Sheet will fail. - json_key = json.load(open('TogglToSpreadSheet-cca18cfac737.json')) - scope = ['https://spreadsheets.google.com/feeds'] - - credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'].encode(), scope) - gc = gspread.authorize(credentials) - sh = gc.open_by_url('https://docs.google.com/spreadsheets/d/1P8HFfktwSAF0rgi9rxpNvdMdR0GYuo845qAGikeJUh8/edit#gid=0') - worksheet = sh.get_worksheet(0) - - currentDate = time.strftime("%Y-%m-%d") - results = [currentDate,values] - worksheet.insert_row(results, 3) - worksheet.update_acell("F2", estimatedTime) - return; - -def get_totaltime_data(): - api_token = '136ab033e06f9202497093b989f59f39' - _workspace_id = 1190663 - print 'Sending Request...' - - r = requests.get('https://toggl.com/reports/api/v2/summary', auth=(api_token, 'api_token'), params={'workspace_id': _workspace_id, 'since' : '2015-11-01', 'user_agent': 'api_test'}) - if r.status_code != 200: - print 'Request Failed. Check your API Token' - return; - index = [] - - rWorkspace = requests.get('https://www.toggl.com/api/v8/workspaces/1190663/projects', auth=(api_token, 'api_token')) - workspaceText = rWorkspace.text - taskMap = map(int, re.findall(r'\d+', workspaceText)) - estimatedTime = 0 - counter = 0 - index = [x-1 for x, i in enumerate(taskMap) if i == 1190663] - - - for x in index: - timeMap = [] - rProject = requests.get('https://www.toggl.com/reports/api/v2/project', auth=(api_token, 'api_token'), params={'user_agent': 'api_test','workspace_id': _workspace_id, 'project_id': taskMap[x]}) - if r.status_code != 200: - print 'rProject request Failed. Check your API Token' - return; - projectText = rProject.text - text = projectText.replace('null','0') - finalText = text.replace('0.0', '0') - timeMap = map(int, re.findall(r'\d+', finalText)) - estimatedTime = estimatedTime + timeMap[6] - counter+= 1 - - wholeText = r.text - allNumbers = map(int, re.findall('\d+', wholeText)) - totalTime = allNumbers[0] - timeleft = totalTime - hours = totalTime / 3600000 - timeleft -= hours * 3600000 - min = timeleft / 60000 - timeleft -= min * 60000 - sec = timeleft / 1000 - estimatedTimeInHours = estimatedTime / 3600 - - str = 'Total Time: ' + repr(hours) +':' + repr(min) + ':' + repr(sec) - print str - result = repr(hours) + ':' + repr(min) +':' + repr(sec) - #result = [] - #result.append(hours); - #result.append(min); - #result.append(sec); - - print 'Writing to Sheet...' - write_to_sheet(result, estimatedTimeInHours) - return; - -get_totaltime_data() -print 'Done!'