Updated windows batch script for setting up environment for blenderbim

Previous batch scripts was resulting in broken sym links (probably because mklink and some other comands were expecting full paths). New script provide required full paths and also use 1 line to set up blenderbim location.
This commit is contained in:
Andrej730
2022-10-17 12:19:53 +06:00
parent 90f1a179bc
commit 871f6ebdf1
+37 -24
View File
@@ -102,37 +102,50 @@ For Linux or Mac:
$ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/schema $ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/schema
$ wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl $ wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
Or, if you're on Windows: Or, if you're on Windows, you can use the batch script below.
Before running it follow the instructions descibed after `rem` tags.
:: .. code-block:: bat
$ git clone https://github.com/IfcOpenShell/IfcOpenShell.git @echo off
$ cd IfcOpenShell
# Remove the Blender add-on Python code rem SETUP BLENDER-BIM LIVE DEVELOPMENT ENVIRONMENT
$ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\core\" rem Setup blenderbim addon location below (probably just need to change "x.x" for your Blender version).
$ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\tool\" rem Put the script to the folder where IfcOpenShell git repository is located
$ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\bim\" rem (script will try to clone IfcOpenShell.git if it's not present).
SET blenderbim=%appdata%\Blender Foundation\Blender\x.x\scripts\addons\blenderbim
# Replace them with links to the Git repository git clone https://github.com/IfcOpenShell/IfcOpenShell.git
$ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\core" "src\blenderbim\blenderbim\core" cd IfcOpenShell
$ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\tool" "src\blenderbim\blenderbim\tool"
$ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\bim" "src\blenderbim\blenderbim\bim"
# Remove the IfcOpenShell dependency Python code echo Removing the Blender add-on Python code...
$ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\api" rd /S /Q "%blenderbim%\core\"
$ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util" rd /S /Q "%blenderbim%\tool\"
rd /S /Q "%blenderbim%\bim\"
# Replace them with links to the Git repository
$ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\api" "src\ifcopenshell-python\ifcopenshell\api"
$ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util" "src\ifcopenshell-python\ifcopenshell\util"
# Manually download some third party dependencies echo Replacing them with links to the Git repository...
$ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/data/gantt mklink /D "%blenderbim%\core" "%cd%\src\blenderbim\blenderbim\core"
$ curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js -outfile jsgantt.js mklink /D "%blenderbim%\tool" "%cd%\src\blenderbim\blenderbim\tool"
$ curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css -outfile jsgantt.css mklink /D "%blenderbim%\bim" "%cd%\src\blenderbim\blenderbim\bim"
$ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/schema
$ curl https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl -o Brick.ttl
echo Remove the IfcOpenShell dependency Python code...
rd /S /Q "%blenderbim%\libs\site\packages\ifcopenshell\api"
rd /S /Q "%blenderbim%\libs\site\packages\ifcopenshell\util"
echo Replacing them with links to the Git repository...
mklink /D "%blenderbim%\libs\site\packages\ifcopenshell\api" "%cd%\src\ifcopenshell-python\ifcopenshell\api"
mklink /D "%blenderbim%\libs\site\packages\ifcopenshell\util" "%cd%\src\ifcopenshell-python\ifcopenshell\util"
echo Manually downloading some third party dependencies...
curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js -o "%blenderbim%\bim\data\gantt\jsgantt.js"
curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css -o "%blenderbim%\bim\data\gantt\jsgantt.css"
curl -L https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl -o "%blenderbim%\bim\schema\Brick.ttl"
pause
After you modify your code in the Git repository, you will need to restart After you modify your code in the Git repository, you will need to restart
Blender for the changes to take effect. Blender for the changes to take effect.