Maya Exporter WIP
This commit is contained in:
@@ -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
|
||||
@@ -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 <QObject>."
|
||||
#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<Menu *>(_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<void*>(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
|
||||
@@ -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 <QtCore/qglobal.h>
|
||||
|
||||
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))
|
||||
|
||||
@@ -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 <QtCore/QVariant>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <QtGui/QStatusBar>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
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
|
||||
@@ -0,0 +1,42 @@
|
||||
#include "MayaIncludes.h"
|
||||
#include "Menu.h"
|
||||
#include <iostream>
|
||||
#include <maya/MFnPlugin.h>
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<UI version="4.0" >
|
||||
<class>leeeeelClass</class>
|
||||
<widget class="QMainWindow" name="leeeeelClass" >
|
||||
<property name="objectName" >
|
||||
<string notr="true">leeeeelClass</string>
|
||||
</property>
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>leeeeel</string>
|
||||
</property>
|
||||
<widget class="QMenuBar" name="menuBar" />
|
||||
<widget class="QToolBar" name="mainToolBar" />
|
||||
<widget class="QWidget" name="centralWidget" />
|
||||
<widget class="QStatusBar" name="statusBar" />
|
||||
</widget>
|
||||
<layoutDefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<resources>
|
||||
<include location="leeeeel.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</UI>
|
||||
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B12702AD-ABFB-343A-A199-8E24837244A3}</ProjectGuid>
|
||||
<Keyword>Qt4VSv1.0</Keyword>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
<ProjectName>MayaExporter</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>14.0.23107.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<TargetExt>.mll</TargetExt>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<TargetExt>.mll</TargetExt>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;QT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\Maya2016\include;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\Maya2016\lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>qtmaind.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>QT_DLL;QT_NO_IMPORT_QT47_QML;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\Maya2016\include;.\GeneratedFiles;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\Maya2016\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalOptions> /SUBSYSTEM:WINDOWS</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;QT_DLL;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat />
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<AdditionalDependencies>qtmain.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;QT_DLL;QT_NO_DEBUG;QT_NO_IMPORT_QT47_QML;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<AdditionalDependencies>qtmain.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalOptions> /SUBSYSTEM:WINDOWS</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Menu.cpp" />
|
||||
<ClCompile Include="GeneratedFiles\Debug\moc_Menu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\qrc_leeeeel.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\Release\moc_Menu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="MayaExporter.ui">
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Uic%27ing %(Identity)...</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Uic%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Uic%27ing %(Identity)...</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Uic%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="Menu.h">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing Menu.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(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)\."</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Moc%27ing Menu.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(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)\."</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing Menu.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(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)\."</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Moc%27ing Menu.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(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)\."</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="GeneratedFiles\ui_MayaExporter.h" />
|
||||
<ClInclude Include="MayaIncludes.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="leeeeel.qrc">
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Rcc%27ing %(Identity)...</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Rcc%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Rcc%27ing %(Identity)...</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Rcc%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties MocDir=".\GeneratedFiles\$(ConfigurationName)" UicDir=".\GeneratedFiles" RccDir=".\GeneratedFiles" lupdateOptions="" lupdateOnBuild="0" lreleaseOptions="" Qt5Version_x0020_Win32="4.8.6" Qt5Version_x0020_x64="Maya2016" MocOptions="" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;cxx;c;def</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||
<Extensions>qrc;*</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files">
|
||||
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||
<Extensions>moc;h;cpp</Extensions>
|
||||
<SourceControlFiles>False</SourceControlFiles>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files\Debug">
|
||||
<UniqueIdentifier>{bd033994-5bd0-43b7-8fdf-7b8a213a1c55}</UniqueIdentifier>
|
||||
<Extensions>cpp;moc</Extensions>
|
||||
<SourceControlFiles>False</SourceControlFiles>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files\Release">
|
||||
<UniqueIdentifier>{f53efcfb-95d1-44a6-a82f-295bb0b0509c}</UniqueIdentifier>
|
||||
<Extensions>cpp;moc</Extensions>
|
||||
<SourceControlFiles>False</SourceControlFiles>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GeneratedFiles\qrc_leeeeel.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\Debug\moc_Menu.cpp">
|
||||
<Filter>Generated Files\Debug</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\Release\moc_Menu.cpp">
|
||||
<Filter>Generated Files\Release</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Menu.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="leeeeel.qrc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Menu.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="MayaExporter.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="MayaIncludes.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GeneratedFiles\ui_MayaExporter.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
<QTDIR>C:\Program Files\Autodesk\Maya2016</QTDIR>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
<QTDIR>C:\Program Files\Autodesk\Maya2016</QTDIR>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
<QTDIR>C:\Program Files\Autodesk\Maya2016</QTDIR>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
<QTDIR>C:\Program Files\Autodesk\Maya2016</QTDIR>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,62 @@
|
||||
#ifndef MAYAINCLUDES_H
|
||||
#define MAYAINCLUDES_H
|
||||
|
||||
#define NT_PLUGIN
|
||||
#define REQUIRE_IOSTREAM
|
||||
#define EXPORT __declspec(dllexport)
|
||||
|
||||
|
||||
#include <maya/MFnMesh.h>
|
||||
#include <maya/MFnTransform.h>
|
||||
#include <maya/MFloatPointArray.h>
|
||||
#include <maya/MPointArray.h>
|
||||
#include <maya/MIntArray.h>
|
||||
#include <maya/MPoint.h>
|
||||
#include <maya/MMatrix.h>
|
||||
#include <maya/MEulerRotation.h>
|
||||
#include <maya/MVector.h>
|
||||
#include <maya/MItDag.h>
|
||||
#include <maya/MFnCamera.h>
|
||||
#include <maya/M3dView.h>
|
||||
#include <maya/MItMeshPolygon.h>
|
||||
#include <maya/MPlugArray.h>
|
||||
#include <maya/MFnDependencyNode.h>
|
||||
#include <maya/MFnLambertShader.h>
|
||||
#include <maya/MFnBlinnShader.h>
|
||||
#include <maya/MFnPhongShader.h>
|
||||
#include <maya/MImage.h>
|
||||
#include <maya/MFnPointLight.h>
|
||||
#include <maya/MSelectionList.h>
|
||||
#include <maya/MItDependencyNodes.h>
|
||||
#include <maya/MFnNurbsCurve.h>
|
||||
#include <maya/MCommandMessage.h>
|
||||
|
||||
|
||||
// Wrappers
|
||||
#include <maya/MGlobal.h>
|
||||
#include <maya/MCallbackIdArray.h>
|
||||
|
||||
#include <maya/MQtUtil.h>
|
||||
|
||||
|
||||
// Messages
|
||||
#include <maya/MMessage.h>
|
||||
#include <maya/MTimerMessage.h>
|
||||
#include <maya/MDGMessage.h>
|
||||
#include <maya/MEventMessage.h>
|
||||
#include <maya/MPolyMessage.h>
|
||||
#include <maya/MNodeMessage.h>
|
||||
#include <maya/MDagPath.h>
|
||||
#include <maya/MDagMessage.h>
|
||||
#include <maya/MUiMessage.h>
|
||||
#include <maya/MModelMessage.h>
|
||||
|
||||
// Commands
|
||||
#include <maya/MPxCommand.h>
|
||||
|
||||
// Libraries to link from Maya
|
||||
#pragma comment(lib,"Foundation.lib")
|
||||
#pragma comment(lib,"OpenMaya.lib")
|
||||
#pragma comment(lib,"OpenMayaUI.lib")
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,239 @@
|
||||
#include "Menu.h"
|
||||
#include <iostream>
|
||||
|
||||
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<UINT, vector<UINT>> vertexToIndex;
|
||||
|
||||
vector<VertexLayout> verticesData;
|
||||
vector<UINT>indexArray;
|
||||
|
||||
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<UINT> 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();
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
#ifndef BUTTONS_H
|
||||
#define BUTTONS_H
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "MayaIncludes.h"
|
||||
// Qt
|
||||
#pragma comment(lib, "QtCore4")
|
||||
#pragma comment(lib, "QtGui4")
|
||||
|
||||
#include <QtCore/qcoreapplication.h>
|
||||
|
||||
#include <maya/MQtUtil.h>
|
||||
#include <QtGui/qwidget.h>
|
||||
#include <QtGui/qapplication.h>
|
||||
#include <QtGui/qdialog.h>
|
||||
#include <QtGui/qpushbutton.h>
|
||||
#include <QtGui/qboxlayout.h>
|
||||
#include <QtGui/qformlayout.h>
|
||||
#include <QtCore/qthread.h>
|
||||
#include <QtCore/qpointer.h>
|
||||
#include <QtCore/qlist.h>
|
||||
#include <QtGui/qlistwidget.h>
|
||||
#include <QtUiTools/quiloader.h>
|
||||
#include <QtCore/qfile.h>
|
||||
#include <QtGui/qlabel.h>
|
||||
#include <QtGui/qcheckbox.h>
|
||||
#include <QtGui/qradiobutton.h>
|
||||
#include <QtGui/qfiledialog.h>
|
||||
#include <QtGui/qlineedit.h>
|
||||
#include <QtGui/qgroupbox.h>
|
||||
|
||||
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
|
||||
@@ -0,0 +1,4 @@
|
||||
<RCC>
|
||||
<qresource prefix="leeeeel">
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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!'
|
||||
Reference in New Issue
Block a user