mirror of
https://github.com/LinoSchmidt/StickExporterTX.git
synced 2026-03-21 01:51:15 +01:00
Added download script for blender
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -263,8 +263,9 @@ out/
|
|||||||
|
|
||||||
output/
|
output/
|
||||||
|
|
||||||
blender-win/
|
dependencies/windows/
|
||||||
blender-linux/
|
dependencies/darwin/
|
||||||
blender/
|
dependencies/linux/
|
||||||
|
|
||||||
index.build.js
|
index.build.js
|
||||||
|
index.build.js.LICENSE.txt
|
||||||
19
package.json
19
package.json
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"version": "0.6.2",
|
"version": "0.8.1",
|
||||||
"name": "stickexportertx",
|
"name": "stickexportertx",
|
||||||
"productName": "StickExporterTX",
|
"productName": "StickExporterTX",
|
||||||
"description": "3D stick exporter for EdgeTX/OpenTX logs",
|
"description": "3D stick exporter for EdgeTX/OpenTX logs",
|
||||||
"main": "src/index.build.js",
|
"main": "src/index.build.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"install:deps": "python ./scripts/download-blender.py",
|
||||||
"build:main": "cross-env NODE_ENV=production webpack --config configs/webpack.main.prod.config.babel.js",
|
"build:main": "cross-env NODE_ENV=production webpack --config configs/webpack.main.prod.config.babel.js",
|
||||||
"build:renderer": "cross-env NODE_ENV=production webpack --config configs/webpack.renderer.prod.config.babel.js",
|
"build:renderer": "cross-env NODE_ENV=production webpack --config configs/webpack.renderer.prod.config.babel.js",
|
||||||
"build": "cross-env npm run build:main && cross-env npm run build:renderer",
|
"build": "cross-env npm run build:main && cross-env npm run build:renderer",
|
||||||
@@ -29,8 +30,8 @@
|
|||||||
"package.json"
|
"package.json"
|
||||||
],
|
],
|
||||||
"extraFiles": [
|
"extraFiles": [
|
||||||
"assets/template.blend",
|
"dependencies/template.blend",
|
||||||
"assets/blenderScript.py"
|
"dependencies/blenderScript.py"
|
||||||
],
|
],
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
@@ -39,8 +40,8 @@
|
|||||||
],
|
],
|
||||||
"extraFiles": [
|
"extraFiles": [
|
||||||
{
|
{
|
||||||
"from": "assets/blender/",
|
"from": "dependencies/windows/",
|
||||||
"to": "assets/blender/",
|
"to": "dependencies/windows/",
|
||||||
"filter": [
|
"filter": [
|
||||||
"**/*"
|
"**/*"
|
||||||
]
|
]
|
||||||
@@ -62,8 +63,8 @@
|
|||||||
],
|
],
|
||||||
"extraFiles": [
|
"extraFiles": [
|
||||||
{
|
{
|
||||||
"from": "assets/blender/",
|
"from": "dependencies/linux/",
|
||||||
"to": "assets/blender/",
|
"to": "dependencies/linux/",
|
||||||
"filter": [
|
"filter": [
|
||||||
"**/*"
|
"**/*"
|
||||||
]
|
]
|
||||||
@@ -78,8 +79,8 @@
|
|||||||
],
|
],
|
||||||
"extraFiles": [
|
"extraFiles": [
|
||||||
{
|
{
|
||||||
"from": "assets/blender/",
|
"from": "dependencies/darwin/",
|
||||||
"to": "assets/blender/",
|
"to": "dependencies/darwin/",
|
||||||
"filter": [
|
"filter": [
|
||||||
"**/*"
|
"**/*"
|
||||||
]
|
]
|
||||||
|
|||||||
44
scripts/download-blender.py
Normal file
44
scripts/download-blender.py
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
from io import BytesIO
|
||||||
|
import urllib.request
|
||||||
|
from zipfile import ZipFile
|
||||||
|
import tarfile
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import time
|
||||||
|
|
||||||
|
windowsURL = 'https://ftp.halifax.rwth-aachen.de/blender/release/Blender3.2/blender-3.2.0-windows-x64.zip'
|
||||||
|
linuxURL = 'https://ftp.halifax.rwth-aachen.de/blender/release/Blender3.2/blender-3.2.0-linux-x64.tar.xz'
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
if(os.path.exists('./dependencies/windows')):
|
||||||
|
print("Removing old windows folder")
|
||||||
|
shutil.rmtree('./dependencies/windows')
|
||||||
|
|
||||||
|
print("Downloading windows version")
|
||||||
|
with urllib.request.urlopen(windowsURL) as zipresp:
|
||||||
|
with ZipFile(BytesIO(zipresp.read())) as zfile:
|
||||||
|
zfile.extractall('./dependencies/windows')
|
||||||
|
|
||||||
|
print("Adjust windows version")
|
||||||
|
oldWindowsName = windowsURL.split('/')[-1].replace('.zip', '')
|
||||||
|
os.rename('./dependencies/windows/' + oldWindowsName, './dependencies/windows/blender')
|
||||||
|
|
||||||
|
# Linux
|
||||||
|
if(os.path.exists('./dependencies/linux')):
|
||||||
|
print("Removing old linux folder")
|
||||||
|
shutil.rmtree('./dependencies/linux')
|
||||||
|
|
||||||
|
print("Downloading linux version")
|
||||||
|
os.mkdir('./dependencies/linux')
|
||||||
|
|
||||||
|
urllib.request.urlretrieve(linuxURL, './dependencies/linux/blender.tar.xz')
|
||||||
|
print("Extracting linux version")
|
||||||
|
with tarfile.open('./dependencies/linux/blender.tar.xz') as tfile:
|
||||||
|
tfile.extractall('./dependencies/linux')
|
||||||
|
|
||||||
|
print("Adjust linux version")
|
||||||
|
oldLinuxName = linuxURL.split('/')[-1].replace('.tar.xz', '')
|
||||||
|
os.rename('./dependencies/linux/' + oldLinuxName, './dependencies/linux/blender')
|
||||||
|
|
||||||
|
print("Clean up linux folder")
|
||||||
|
os.remove('./dependencies/linux/blender.tar.xz')
|
||||||
@@ -6,6 +6,15 @@ export const SettingPath = path.join(dataPath, "settings.xml");
|
|||||||
|
|
||||||
export const defaultOutputPath = path.join(app.getPath('videos'), "StickExporterTX");
|
export const defaultOutputPath = path.join(app.getPath('videos'), "StickExporterTX");
|
||||||
|
|
||||||
export const blenderPath = path.join("assets", "blender", "blender");
|
let platformFolder = "";
|
||||||
export const templatePath = path.join("assets", "template.blend");
|
if(process.platform === "win32"){
|
||||||
export const blenderScriptPath = path.join("assets", "blenderScript.py");
|
platformFolder = "windows";
|
||||||
|
} else if(process.platform === "darwin"){
|
||||||
|
platformFolder = "darwin";
|
||||||
|
} else if(process.platform === "linux"){
|
||||||
|
platformFolder = "linux";
|
||||||
|
}
|
||||||
|
|
||||||
|
export const blenderPath = path.join("dependencies", platformFolder, "blender", "blender");
|
||||||
|
export const templatePath = path.join("dependencies", "template.blend");
|
||||||
|
export const blenderScriptPath = path.join("dependencies", "blenderScript.py");
|
||||||
Reference in New Issue
Block a user