5 Commits

Author SHA1 Message Date
b425eded3b Merge branch 'main' of https://github.com/LinoSchmidt/StickExporterTX 2022-05-16 23:45:21 +02:00
429e4a28a3 Fixed blenderScript.py permission Problem 2022-05-16 23:45:15 +02:00
bf131e1f13 Added Icons for other platforms 2022-05-16 23:44:18 +02:00
LinoSchmidt
195e153403 Added Licence to README.md 2022-05-16 22:29:44 +02:00
LinoSchmidt
87290b8437 Create LICENSE.md 2022-05-16 22:24:27 +02:00
9 changed files with 40 additions and 45 deletions

21
LICENSE.md Normal file
View File

@@ -0,0 +1,21 @@
# MIT License
Copyright (c) 2022 [Lino Schmidt](https://github.com/LinoSchmidt)
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.

View File

@@ -2,20 +2,19 @@
A 3D Sticks Exporter for EdgeTX/OpenTX logs. A 3D Sticks Exporter for EdgeTX/OpenTX logs.
Setup: ## Setup:
------
- Download [Blender (Portable)](https://www.blender.org/download) and unpack it with the name `blender` in the folder `<Project folder>/assets`. - Download [Blender (Portable)](https://www.blender.org/download) and unpack it with the name `blender` in the folder `<Project folder>/assets`.
- Start a console in the project folder and execute the command `npm install` to install the necessary packages. - Start a console in the project folder and execute the command `npm install` to install the necessary packages.
Test: ## Test:
------
To test the program, execute the command `npm start` in the project folder. To test the program, execute the command `npm start` in the project folder.
Build (Windows): ## Build:
------
### Windows:
To build the program, execute the command `npm run package-win` in the project folder. To build the program, execute the command `npm run package-win` in the project folder.
After that, open the file `installer-builder.iss` with the program [Inno Setup Compiler](https://jrsoftware.org/isdl.php#stable) and compile it. After that, open the file `installer-builder.iss` with the program [Inno Setup Compiler](https://jrsoftware.org/isdl.php#stable) and compile it.
The finished installer should be inside `<Project Folder>/output`. The finished installer should be inside `<Project Folder>/output`.
## Licence:
Copyright © 2022 Lino Schmidt. All rights reserved. his project is released under the MIT license, for more information, check the [LICENSE](LICENSE.md) file.

View File

@@ -6,7 +6,10 @@ import sys
import bpy import bpy
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
settings = ET.parse("") argv = sys.argv
argv = argv[argv.index("--") + 1:]
settings = ET.parse(argv[0])
logger = logging.getLogger('simple_example') logger = logging.getLogger('simple_example')
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)

BIN
icon.icns Normal file

Binary file not shown.

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "StickExporterTX" #define MyAppName "StickExporterTX"
#define MyAppVersion "0.6.1" #define MyAppVersion "0.6.2"
#define MyAppPublisher "Lino Schmidt" #define MyAppPublisher "Lino Schmidt"
#define MyAppURL "https://stickexportertx.lino3d.de" #define MyAppURL "https://stickexportertx.lino3d.de"
#define MyAppExeName "stickexportertx.exe" #define MyAppExeName "stickexportertx.exe"

18
package-lock.json generated
View File

@@ -1,18 +1,17 @@
{ {
"name": "stickexportertx", "name": "stickexportertx",
"version": "0.6.1", "version": "0.6.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "stickexportertx", "name": "stickexportertx",
"version": "0.6.1", "version": "0.6.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@electron/remote": "^2.0.8", "@electron/remote": "^2.0.8",
"electron-log": "^4.4.7", "electron-log": "^4.4.7",
"electron-squirrel-startup": "^1.0.0", "electron-squirrel-startup": "^1.0.0",
"line-replace": "^2.0.1",
"xml-formatter": "^2.6.1" "xml-formatter": "^2.6.1"
}, },
"devDependencies": { "devDependencies": {
@@ -4286,14 +4285,6 @@
"json-buffer": "3.0.0" "json-buffer": "3.0.0"
} }
}, },
"node_modules/line-replace": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/line-replace/-/line-replace-2.0.1.tgz",
"integrity": "sha512-CSr3f6gynLCA9R+RBS0IDIfv7a8OAXcuyq+CHgq0WzbQ7KSJQfF5DgtpRVxpSp1KBNXogtzbNqAeUjrmHYTPYA==",
"bin": {
"line-replace": "bin/index.js"
}
},
"node_modules/load-json-file": { "node_modules/load-json-file": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
@@ -10165,11 +10156,6 @@
"json-buffer": "3.0.0" "json-buffer": "3.0.0"
} }
}, },
"line-replace": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/line-replace/-/line-replace-2.0.1.tgz",
"integrity": "sha512-CSr3f6gynLCA9R+RBS0IDIfv7a8OAXcuyq+CHgq0WzbQ7KSJQfF5DgtpRVxpSp1KBNXogtzbNqAeUjrmHYTPYA=="
},
"load-json-file": { "load-json-file": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",

View File

@@ -1,7 +1,7 @@
{ {
"name": "stickexportertx", "name": "stickexportertx",
"productName": "StickExporterTX", "productName": "StickExporterTX",
"version": "0.6.1", "version": "0.6.2",
"description": "A 3D Stick Exporter for EdgeTX/OpenTX Logs.", "description": "A 3D Stick Exporter for EdgeTX/OpenTX Logs.",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
@@ -10,7 +10,9 @@
"make": "electron-forge make", "make": "electron-forge make",
"publish": "electron-forge publish", "publish": "electron-forge publish",
"lint": "echo \"No linting configured\"", "lint": "echo \"No linting configured\"",
"package-win": "electron-packager . stickexportertx --overwrite --asar=true --platform=win32 --arch=ia32 --icon=icon.ico --prune=true --out=release-builds --version-string.CompanyName=\"Lino Schmidt\" --version-string.FileDescription=\"3D Stick Exporter for EdgeTX/OpenTX Logs\" --version-string.ProductName=StickExporterTX" "package-win": "electron-packager . stickexportertx --overwrite --asar=true --platform=win32 --arch=ia32 --icon=icon.ico --prune=true --out=release-builds --version-string.CompanyName=\"Lino Schmidt\" --version-string.FileDescription=\"3D Stick Exporter for EdgeTX/OpenTX Logs\" --version-string.ProductName=StickExporterTX",
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=icon.icns --prune=true --out=release-builds",
"package-lx": "electron-packager . stickexportertx --overwrite --asar=true --platform=linux --arch=x64 --icon=icon.png --prune=true --out=release-builds"
}, },
"keywords": [], "keywords": [],
"author": { "author": {
@@ -49,7 +51,6 @@
"@electron/remote": "^2.0.8", "@electron/remote": "^2.0.8",
"electron-log": "^4.4.7", "electron-log": "^4.4.7",
"electron-squirrel-startup": "^1.0.0", "electron-squirrel-startup": "^1.0.0",
"line-replace": "^2.0.1",
"xml-formatter": "^2.6.1" "xml-formatter": "^2.6.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -24,7 +24,6 @@ const fs = require("fs");
const formatXml = require("xml-formatter"); const formatXml = require("xml-formatter");
const {dialog, app} = require("@electron/remote"); const {dialog, app} = require("@electron/remote");
const path = require('path'); const path = require('path');
const lineReplace = require('line-replace');
const dataFolder = app.getPath('userData'); const dataFolder = app.getPath('userData');
const SettingFolder = path.join(dataFolder, "settings.xml"); const SettingFolder = path.join(dataFolder, "settings.xml");
@@ -33,27 +32,13 @@ const blenderPath = path.join("assets", "blender", "blender");
const templatePath = path.join("assets", "template.blend"); const templatePath = path.join("assets", "template.blend");
const blenderScriptPath = path.join("assets", "blenderScript.py"); const blenderScriptPath = path.join("assets", "blenderScript.py");
lineReplace({
file: blenderScriptPath,
line: 9,
text: 'settings = ET.parse("' + SettingFolder.replaceAll('\\', '/') + '")',
addNewLine: true,
callback: ({error}) => {
if(error != null) {
statusDisplay.innerHTML = "Something went wrong! Check Logs.";
statusDisplay.style.color = "red";
logger.error(error);
}
}
});
logger.transports.console.format = "{h}:{i}:{s} {text}"; logger.transports.console.format = "{h}:{i}:{s} {text}";
logger.transports.file.getFile(); logger.transports.file.getFile();
logger.transports.file.resolvePath = () => path.join(dataFolder, "logs", "main.log"); logger.transports.file.resolvePath = () => path.join(dataFolder, "logs", "main.log");
function startRender() { function startRender() {
const {exec} = require("child_process"); const {exec} = require("child_process");
var blenderCons = exec('"' + blenderPath + '" "' + templatePath + '" --background --python "' + blenderScriptPath + '"', {maxBuffer: Infinity}); var blenderCons = exec('"' + blenderPath + '" "' + templatePath + '" --background --python "' + blenderScriptPath + '" -- "' + SettingFolder.replaceAll('\\', '/') + '"', {maxBuffer: Infinity});
frames = "0"; frames = "0";
lastFrame = "0"; lastFrame = "0";