From 871f6ebdf1fb67fc7dd5755cfca8690b24285418 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 17 Oct 2022 12:19:53 +0600 Subject: [PATCH] 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. --- src/blenderbim/docs/devs/installation.rst | 61 ++++++++++++++--------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/src/blenderbim/docs/devs/installation.rst b/src/blenderbim/docs/devs/installation.rst index 5386e9be53..37894e9f9e 100644 --- a/src/blenderbim/docs/devs/installation.rst +++ b/src/blenderbim/docs/devs/installation.rst @@ -102,37 +102,50 @@ For Linux or Mac: $ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/schema $ 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 - $ cd IfcOpenShell + @echo off - # Remove the Blender add-on Python code - $ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\core\" - $ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\tool\" - $ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\bim\" + rem SETUP BLENDER-BIM LIVE DEVELOPMENT ENVIRONMENT + rem Setup blenderbim addon location below (probably just need to change "x.x" for your Blender version). + rem Put the script to the folder where IfcOpenShell git repository is located + 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 - $ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\core" "src\blenderbim\blenderbim\core" - $ 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" + git clone https://github.com/IfcOpenShell/IfcOpenShell.git + cd IfcOpenShell - # Remove the IfcOpenShell dependency Python code - $ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\api" - $ rd /S /Q "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util" + echo Removing the Blender add-on Python code... + rd /S /Q "%blenderbim%\core\" + 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 - $ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/data/gantt - $ curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js -outfile jsgantt.js - $ curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css -outfile jsgantt.css - $ 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 Replacing them with links to the Git repository... + mklink /D "%blenderbim%\core" "%cd%\src\blenderbim\blenderbim\core" + mklink /D "%blenderbim%\tool" "%cd%\src\blenderbim\blenderbim\tool" + mklink /D "%blenderbim%\bim" "%cd%\src\blenderbim\blenderbim\bim" + + + 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 Blender for the changes to take effect.