bonsai dev_environment scripts #5178

This commit is contained in:
Andrej730
2024-08-14 15:46:52 +05:00
committed by Andrej
parent 3a9d79dcd3
commit a29806ef9e
2 changed files with 19 additions and 19 deletions
@@ -8,11 +8,11 @@ rem Otherwise by default it is assumed script is executed from IfcOpenShell dire
rem SET REPO_PATH=%HOMEDRIVE%\Users\%USERNAME%\Where\Your\Git\Repository\Is\Cloned\IfcOpenShell rem SET REPO_PATH=%HOMEDRIVE%\Users\%USERNAME%\Where\Your\Git\Repository\Is\Cloned\IfcOpenShell
SET BLENDER_PATH=%HOMEDRIVE%\Users\%USERNAME%\AppData\Roaming\Blender Foundation\Blender\4.2 SET BLENDER_PATH=%HOMEDRIVE%\Users\%USERNAME%\AppData\Roaming\Blender Foundation\Blender\4.2
SET PACKAGE_PATH=%BLENDER_PATH%\extensions\.local\lib\python3.11\site-packages SET PACKAGE_PATH=%BLENDER_PATH%\extensions\.local\lib\python3.11\site-packages
SET BLENDERBIM_PATH=%BLENDER_PATH%\extensions\user_default\blenderbim SET BONSAI_PATH=%BLENDER_PATH%\extensions\user_default\bonsai
echo SETUP BLENDERBIM ADD-ON LIVE DEVELOPMENT ENVIRONMENT echo SETUP BONSAI ADD-ON LIVE DEVELOPMENT ENVIRONMENT
echo Update REPO_PATH, BLENDER_PATH, PACKAGE_PATH, BLENDERBIM_PATH in the script above. echo Update REPO_PATH, BLENDER_PATH, PACKAGE_PATH, BONSAI_PATH in the script above.
echo This script needs to be run as administrator (to create symbolic links) echo This script needs to be run as administrator (to create symbolic links)
echo Make sure you have followed these steps before proceeding :) echo Make sure you have followed these steps before proceeding :)
echo. echo.
@@ -24,7 +24,7 @@ if not defined REPO_PATH (
echo REPO_PATH=%REPO_PATH% echo REPO_PATH=%REPO_PATH%
echo BLENDER_PATH=%BLENDER_PATH% echo BLENDER_PATH=%BLENDER_PATH%
echo PACKAGE_PATH=%PACKAGE_PATH% echo PACKAGE_PATH=%PACKAGE_PATH%
echo BLENDERBIM_PATH=%BLENDERBIM_PATH% echo BONSAI_PATH=%BONSAI_PATH%
pause pause
echo Changing to the Git repository directory... echo Changing to the Git repository directory...
@@ -34,8 +34,8 @@ echo Copy over compiled IfcOpenShell files...
copy "%PACKAGE_PATH%\ifcopenshell\*_wrapper*" "%CD%\src\ifcopenshell-python\ifcopenshell\" copy "%PACKAGE_PATH%\ifcopenshell\*_wrapper*" "%CD%\src\ifcopenshell-python\ifcopenshell\"
echo Remove extension and link to Git... echo Remove extension and link to Git...
del "%BLENDERBIM_PATH%\__init__.py" del "%BONSAI_PATH%\__init__.py"
rd /S /Q "%PACKAGE_PATH%\blenderbim" rd /S /Q "%PACKAGE_PATH%\bonsai"
rd /S /Q "%PACKAGE_PATH%\ifcopenshell" rd /S /Q "%PACKAGE_PATH%\ifcopenshell"
del "%PACKAGE_PATH%\ifccsv.py" del "%PACKAGE_PATH%\ifccsv.py"
del "%PACKAGE_PATH%\ifcdiff.py" del "%PACKAGE_PATH%\ifcdiff.py"
@@ -49,8 +49,8 @@ rd /S /Q "%PACKAGE_PATH%\ifcpatch"
rd /S /Q "%PACKAGE_PATH%\ifctester" rd /S /Q "%PACKAGE_PATH%\ifctester"
rd /S /Q "%PACKAGE_PATH%\ifcfm" rd /S /Q "%PACKAGE_PATH%\ifcfm"
mklink "%BLENDERBIM_PATH%\__init__.py" "%CD%\src\blenderbim\blenderbim\__init__.py" mklink "%BONSAI_PATH%\__init__.py" "%CD%\src\bonsai\bonsai\__init__.py"
mklink /D "%PACKAGE_PATH%\blenderbim" "%CD%\src\blenderbim\blenderbim" mklink /D "%PACKAGE_PATH%\bonsai" "%CD%\src\bonsai\bonsai"
mklink /D "%PACKAGE_PATH%\ifcopenshell" "%CD%\src\ifcopenshell-python\ifcopenshell" mklink /D "%PACKAGE_PATH%\ifcopenshell" "%CD%\src\ifcopenshell-python\ifcopenshell"
mklink "%PACKAGE_PATH%\ifccsv.py" "%CD%\src\ifccsv\ifccsv.py" mklink "%PACKAGE_PATH%\ifccsv.py" "%CD%\src\ifccsv\ifccsv.py"
mklink "%PACKAGE_PATH%\ifcdiff.py" "%CD%\src\ifcdiff\ifcdiff.py" mklink "%PACKAGE_PATH%\ifcdiff.py" "%CD%\src\ifcdiff\ifcdiff.py"
@@ -65,8 +65,8 @@ mklink /D "%PACKAGE_PATH%\ifctester" "%CD%\src\ifctester\ifctester"
mklink /D "%PACKAGE_PATH%\ifcfm" "%CD%\src\ifcfm\ifcfm" mklink /D "%PACKAGE_PATH%\ifcfm" "%CD%\src\ifcfm\ifcfm"
echo Manually downloading some third party dependencies... echo Manually downloading some third party dependencies...
curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js -o "%PACKAGE_PATH%\blenderbim\bim\data\gantt\jsgantt.js" curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js -o "%PACKAGE_PATH%\bonsai\bim\data\gantt\jsgantt.js"
curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css -o "%PACKAGE_PATH%\blenderbim\bim\data\gantt\jsgantt.css" curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css -o "%PACKAGE_PATH%\bonsai\bim\data\gantt\jsgantt.css"
curl -L https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl -o "%PACKAGE_PATH%\blenderbim\bim\schema\Brick.ttl" curl -L https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl -o "%PACKAGE_PATH%\bonsai\bim\schema\Brick.ttl"
pause pause
@@ -1,11 +1,11 @@
# Please update REPO_PATH, BLENDER_PATH, PACKAGE_PATH, BLENDERBIM_PATH in the script below. # Please update REPO_PATH, BLENDER_PATH, PACKAGE_PATH, BONSAI_PATH in the script below.
# Default BLENDER_PATH on Mac: "/Users/$USER/Library/Application Support/Blender/4.2/" # Default BLENDER_PATH on Mac: "/Users/$USER/Library/Application Support/Blender/4.2/"
# Default BLENDER_PATH on Linux: "$HOME/.config/blender/4.2/" # Default BLENDER_PATH on Linux: "$HOME/.config/blender/4.2/"
# REPO_PATH="/path/to/where/your/git/repository/is/cloned/IfcOpenShell" # REPO_PATH="/path/to/where/your/git/repository/is/cloned/IfcOpenShell"
REPO_PATH="/home/dion/Projects/ifcopenshell/" REPO_PATH="/home/dion/Projects/ifcopenshell/"
BLENDER_PATH="${HOME}/.config/blender/4.2" BLENDER_PATH="${HOME}/.config/blender/4.2"
PACKAGE_PATH="${BLENDER_PATH}/extensions/.local/lib/python3.11/site-packages" PACKAGE_PATH="${BLENDER_PATH}/extensions/.local/lib/python3.11/site-packages"
BLENDERBIM_PATH="${BLENDER_PATH}/extensions/user_default/blenderbim" BONSAI_PATH="${BLENDER_PATH}/extensions/user_default/bonsai"
# Changing to the Git repository directory # Changing to the Git repository directory
cd $REPO_PATH cd $REPO_PATH
@@ -14,8 +14,8 @@ cd $REPO_PATH
cp $PACKAGE_PATH/ifcopenshell/*_wrapper* $PWD/src/ifcopenshell-python/ifcopenshell/ cp $PACKAGE_PATH/ifcopenshell/*_wrapper* $PWD/src/ifcopenshell-python/ifcopenshell/
# Remove extension and link to Git # Remove extension and link to Git
rm $BLENDERBIM_PATH/__init__.py rm $BONSAI_PATH/__init__.py
rm -r $PACKAGE_PATH/blenderbim rm -r $PACKAGE_PATH/bonsai
rm -r $PACKAGE_PATH/ifcopenshell rm -r $PACKAGE_PATH/ifcopenshell
rm -r $PACKAGE_PATH/ifccsv.py rm -r $PACKAGE_PATH/ifccsv.py
rm -r $PACKAGE_PATH/ifcdiff.py rm -r $PACKAGE_PATH/ifcdiff.py
@@ -29,8 +29,8 @@ rm -r $PACKAGE_PATH/ifcpatch
rm -r $PACKAGE_PATH/ifctester rm -r $PACKAGE_PATH/ifctester
rm -r $PACKAGE_PATH/ifcfm rm -r $PACKAGE_PATH/ifcfm
ln -s $PWD/src/blenderbim/blenderbim/__init__.py $BLENDERBIM_PATH/__init__.py ln -s $PWD/src/bonsai/bonsai/__init__.py $BONSAI_PATH/__init__.py
ln -s $PWD/src/blenderbim/blenderbim $PACKAGE_PATH/blenderbim ln -s $PWD/src/bonsai/bonsai $PACKAGE_PATH/bonsai
ln -s $PWD/src/ifcopenshell-python/ifcopenshell $PACKAGE_PATH/ifcopenshell ln -s $PWD/src/ifcopenshell-python/ifcopenshell $PACKAGE_PATH/ifcopenshell
ln -s $PWD/src/ifccsv/ifccsv.py $PACKAGE_PATH/ifccsv.py ln -s $PWD/src/ifccsv/ifccsv.py $PACKAGE_PATH/ifccsv.py
ln -s $PWD/src/ifcdiff/ifcdiff.py $PACKAGE_PATH/ifcdiff.py ln -s $PWD/src/ifcdiff/ifcdiff.py $PACKAGE_PATH/ifcdiff.py
@@ -45,8 +45,8 @@ ln -s $PWD/src/ifctester/ifctester $PACKAGE_PATH/ifctester
ln -s $PWD/src/ifcfm/ifcfm $PACKAGE_PATH/ifcfm ln -s $PWD/src/ifcfm/ifcfm $PACKAGE_PATH/ifcfm
# Manually download some third party dependencies # Manually download some third party dependencies
cd $PACKAGE_PATH/blenderbim/bim/data/gantt cd $PACKAGE_PATH/bonsai/bim/data/gantt
wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css
cd $PACKAGE_PATH/blenderbim/bim/schema cd $PACKAGE_PATH/bonsai/bim/schema
wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl