diff --git a/.gitignore b/.gitignore
index 1774c281..150f1194 100755
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,7 @@ bin/
lib/
# Because apparently nobody has any self control
*.orig
+
+tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT/x64/Debug/
+tools/LiveTexturing/mayaPluginRTT/x64/Debug/
+*.suo
diff --git a/tools/LiveTexturing/LiveTexturing/main.js b/tools/LiveTexturing/LiveTexturing/main.js
new file mode 100644
index 00000000..e9177937
--- /dev/null
+++ b/tools/LiveTexturing/LiveTexturing/main.js
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+(function () {
+ "use strict";
+ var start = 0;
+ var zmq = require('zmq');
+ var publisher = zmq.socket('pub');
+
+ publisher.bind('tcp://*:5555', function (err) {
+ if (err) {
+ console.log(err);
+ }
+ else {
+ console.log("5555");
+ }
+ });
+
+
+
+ process.on('SIGINT', function () {
+ publisher.close();
+ });
+
+
+ var PLUGIN_ID = require("./package.json").name,
+ MENU_ID = "TeamFisk plugins",
+ MENU_LABEL = "$$$/JavaScripts/Generator/TeamFisk plugins/Menu=Live Texturing RAMDisk";
+
+ var _generator = null;
+
+ // Initialize script here
+ function init(generator, config) {
+ _generator = generator;
+ _generator.addMenuItem(MENU_ID, MENU_LABEL, true, false)
+ .then(
+ function () {
+ console.log("Menu created", MENU_ID);
+ }, function () {
+ console.error("Menu creation failed", MENU_ID);
+ }
+ );
+
+ _generator.onPhotoshopEvent("imageChanged", handleImageChanged);
+ }
+
+ var lastSent = 0;
+ function handleImageChanged(document) {
+
+ var start = new Date().getTime();
+ if (start - lastSent > 200) {
+ _generator.getDocumentInfo(document.id).then(
+ function (document) {
+ // console.log(new Date().getTime() / 1000);
+ // console.log(stringify(document.timeStamp));
+
+ //lastSent = document.timeStamp
+ // console.log(stringify(document));
+ //console.log("Received complete document:", stringify(document));
+ //var str = 'var options = new PNGSaveOptions(); app.activeDocument.saveAs (new File("D:/HejHej.png"),options, false);';
+ var str = 'app.activeDocument.save()';
+ _generator.evaluateJSXString(str).done();
+
+ var size = (4 + document.file.length + 1);
+ var message = new Buffer(size);
+
+ var offset = 0;
+
+ //console.log("document.file.length: " + document.file.length);
+ //console.log("document.fileName: " + document.file);
+
+ message.writeInt32LE(document.file.length + 1, offset);
+
+ offset += 4;
+
+ var fileName = document.file.replace(/\\/g, "/");
+ message.write(fileName, offset, fileName.length, 'utf8');
+ offset += fileName.length;
+ message.writeUInt8(0, offset); //Null byte
+ offset += 1;
+
+ publisher.send(message);
+
+ var asd = new Date().getTime();
+ var time = asd - start;
+ console.log(time);
+ lastSent = new Date().getTime();
+ console.log("LastSent: " + lastSent);
+ });
+ }
+ }
+
+ function stringify(object) {
+ try {
+ return JSON.stringify(object, null, " ");
+ } catch (e) {
+ console.error(e);
+ }
+ return String(object);
+ }
+
+ //Declare entery function in the script
+ exports.init = init;
+}());
\ No newline at end of file
diff --git a/tools/LiveTexturing/LiveTexturing/package.json b/tools/LiveTexturing/LiveTexturing/package.json
new file mode 100644
index 00000000..dec32236
--- /dev/null
+++ b/tools/LiveTexturing/LiveTexturing/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "Live Textureing RAMDisk",
+ "version": "1.0.0",
+ "description": "Send image from Photoshop",
+ "main": "main.js",
+ "generator-core-version": "~3",
+ "license": "Public Domain",
+ "readmeFilename": "",
+ "scripts": {
+ },
+ "dependencies": {
+ },
+ "devDependencies": {
+ }
+}
diff --git a/tools/LiveTexturing/mayaPluginRTT/.vs/config/applicationhost.config b/tools/LiveTexturing/mayaPluginRTT/.vs/config/applicationhost.config
new file mode 100644
index 00000000..c2abfb48
--- /dev/null
+++ b/tools/LiveTexturing/mayaPluginRTT/.vs/config/applicationhost.config
@@ -0,0 +1,1030 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.opensdf b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.opensdf
new file mode 100644
index 00000000..31dea47b
Binary files /dev/null and b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.opensdf differ
diff --git a/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.sdf b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.sdf
new file mode 100644
index 00000000..92ccd791
Binary files /dev/null and b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.sdf differ
diff --git a/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.sln b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.sln
new file mode 100644
index 00000000..1e3c9af8
--- /dev/null
+++ b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT.sln
@@ -0,0 +1,28 @@
+
+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}") = "mayaPluginRTT", "mayaPluginRTT\mayaPluginRTT.vcxproj", "{C26D6DAB-3247-4782-94AC-738BDB20CFD0}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Debug|x64.ActiveCfg = Debug|x64
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Debug|x64.Build.0 = Debug|x64
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Debug|x86.ActiveCfg = Debug|Win32
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Debug|x86.Build.0 = Debug|Win32
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Release|x64.ActiveCfg = Release|x64
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Release|x64.Build.0 = Release|x64
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Release|x86.ActiveCfg = Release|Win32
+ {C26D6DAB-3247-4782-94AC-738BDB20CFD0}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT/libzmq-v120-mt-4_0_4.lib b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT/libzmq-v120-mt-4_0_4.lib
new file mode 100644
index 00000000..b2f765ca
Binary files /dev/null and b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT/libzmq-v120-mt-4_0_4.lib differ
diff --git a/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT/main.cpp b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT/main.cpp
new file mode 100644
index 00000000..21ceef7a
--- /dev/null
+++ b/tools/LiveTexturing/mayaPluginRTT/mayaPluginRTT/main.cpp
@@ -0,0 +1,427 @@
+// UD1414_Plugin.cpp : Defines the exported functions for the DLL application.
+#include "zmq.hpp"
+#include "maya_includes.h"
+#include
+#include
+#include