mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 04:04:00 +00:00
Update live install script on linux/mac and merge system support docs into dev setup docs
This commit is contained in:
@@ -1,70 +1,57 @@
|
||||
@echo off
|
||||
|
||||
echo SETUP BLENDERBIM ADD-ON LIVE DEVELOPMENT ENVIRONMENT
|
||||
echo Update BLENDER, BLENDER_VERSION, PYTHON_VERSION, BBIM_REPO, BLENDER_USER_NAME in the script bellow.
|
||||
echo Put the script at the root of your IfcOpenShell git repository
|
||||
echo Update REPO_PATH, BLENDER_PATH, PACKAGE_PATH, BLENDERBIM_PATH in the script below.
|
||||
echo This script needs to be run as administrator (to create symbolic links)
|
||||
echo Make sure you have followed these steps before proceeding :)
|
||||
|
||||
pause
|
||||
|
||||
SET BLENDER_VERSION=4.2
|
||||
SET PYTHON_VERSION=3.11
|
||||
SET BBIM_REPO=user_default
|
||||
rem Can be useful e.g. if you're running script from administrator account
|
||||
rem and need to setup dev environment for some other user.
|
||||
SET BLENDER_USER_NAME=%USERNAME%
|
||||
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 PACKAGE_PATH=%BLENDER_PATH%\extensions\.local\lib\python3.11\site-packages
|
||||
SET BLENDERBIM_PATH=%BLENDER_PATH%\extensions\user_default\blenderbim
|
||||
|
||||
SET BLENDER=%HOMEDRIVE%\Users\%BLENDER_USER_NAME%\AppData\Roaming\Blender Foundation\Blender\%BLENDER_VERSION%
|
||||
SET BLENDER_LOCAL=%BLENDER%\extensions\.local\lib\python%PYTHON_VERSION%\site-packages
|
||||
SET BLENDERBIM=%BLENDER_LOCAL%\blenderbim
|
||||
SET BLENDER_EXT=%BLENDER%\extensions\%BBIM_REPO%\blenderbim
|
||||
|
||||
echo Removing the Blender add-on Python code...
|
||||
del "%BLENDER_EXT%\__init__.py"
|
||||
rd /S /Q "%BLENDERBIM%"
|
||||
|
||||
echo Replacing them with links to the Git repository...
|
||||
mklink "%BLENDER_EXT%\__init__.py" "%CD%\src\blenderbim\blenderbim\__init__.py"
|
||||
mklink /D "%BLENDERBIM%" "%CD%\src\blenderbim\blenderbim"
|
||||
echo Changing to the Git repository directory...
|
||||
cd %REPO_PATH%
|
||||
|
||||
echo Copy over compiled IfcOpenShell files...
|
||||
copy "%BLENDER_LOCAL%\ifcopenshell\*_wrapper*" "%CD%\src\ifcopenshell-python\ifcopenshell\"
|
||||
copy "%PACKAGE_PATH%\ifcopenshell\*_wrapper*" "%CD%\src\ifcopenshell-python\ifcopenshell\"
|
||||
|
||||
echo Remove the IfcOpenShell dependency...
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifcopenshell"
|
||||
echo Remove extension and link to Git...
|
||||
del "%BLENDERBIM_PATH%\__init__.py"
|
||||
rd /S /Q "%PACKAGE_PATH%\blenderbim"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifcopenshell"
|
||||
del "%PACKAGE_PATH%\ifccsv.py"
|
||||
del "%PACKAGE_PATH%\ifcdiff.py"
|
||||
del "%PACKAGE_PATH%\bsdd.py"
|
||||
rd /S /Q "%PACKAGE_PATH%\bcf"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifc4d"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifc5d"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifccityjson"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifcclash"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifcpatch"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifctester"
|
||||
rd /S /Q "%PACKAGE_PATH%\ifcfm"
|
||||
|
||||
echo Replace them with links to the Git repository...
|
||||
mklink /D "%BLENDER_LOCAL%\ifcopenshell" "%CD%\src\ifcopenshell-python\ifcopenshell"
|
||||
|
||||
echo Remove and link other IfcOpenShell utilities...
|
||||
del "%BLENDER_LOCAL%\ifccsv.py"
|
||||
del "%BLENDER_LOCAL%\ifcdiff.py"
|
||||
del "%BLENDER_LOCAL%\bsdd.py"
|
||||
rd /S /Q "%BLENDER_LOCAL%\bcf"
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifc4d"
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifc5d"
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifccityjson"
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifcclash"
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifcpatch"
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifctester"
|
||||
rd /S /Q "%BLENDER_LOCAL%\ifcfm"
|
||||
|
||||
mklink "%BLENDER_LOCAL%\ifccsv.py" "%CD%\src\ifccsv\ifccsv.py"
|
||||
mklink "%BLENDER_LOCAL%\ifcdiff.py" "%CD%\src\ifcdiff\ifcdiff.py"
|
||||
mklink "%BLENDER_LOCAL%\bsdd.py" "%CD%\src\bsdd\bsdd.py"
|
||||
mklink /D "%BLENDER_LOCAL%\bcf" "%CD%\src\bcf\bcf"
|
||||
mklink /D "%BLENDER_LOCAL%\ifc4d" "%CD%\src\ifc4d\ifc4d"
|
||||
mklink /D "%BLENDER_LOCAL%\ifc5d" "%CD%\src\ifc5d\ifc5d"
|
||||
mklink /D "%BLENDER_LOCAL%\ifccityjson" "%CD%\src\ifccityjson\ifccityjson"
|
||||
mklink /D "%BLENDER_LOCAL%\ifcclash" "%CD%\src\ifcclash\ifcclash"
|
||||
mklink /D "%BLENDER_LOCAL%\ifcpatch" "%CD%\src\ifcpatch\ifcpatch"
|
||||
mklink /D "%BLENDER_LOCAL%\ifctester" "%CD%\src\ifctester\ifctester"
|
||||
mklink /D "%BLENDER_LOCAL%\ifcfm" "%CD%\src\ifcfm\ifcfm"
|
||||
mklink "%BLENDERBIM_PATH%\__init__.py" "%CD%\src\blenderbim\blenderbim\__init__.py"
|
||||
mklink /D "%PACKAGE_PATH%\blenderbim" "%CD%\src\blenderbim\blenderbim"
|
||||
mklink /D "%PACKAGE_PATH%\ifcopenshell" "%CD%\src\ifcopenshell-python\ifcopenshell"
|
||||
mklink "%PACKAGE_PATH%\ifccsv.py" "%CD%\src\ifccsv\ifccsv.py"
|
||||
mklink "%PACKAGE_PATH%\ifcdiff.py" "%CD%\src\ifcdiff\ifcdiff.py"
|
||||
mklink "%PACKAGE_PATH%\bsdd.py" "%CD%\src\bsdd\bsdd.py"
|
||||
mklink /D "%PACKAGE_PATH%\bcf" "%CD%\src\bcf\bcf"
|
||||
mklink /D "%PACKAGE_PATH%\ifc4d" "%CD%\src\ifc4d\ifc4d"
|
||||
mklink /D "%PACKAGE_PATH%\ifc5d" "%CD%\src\ifc5d\ifc5d"
|
||||
mklink /D "%PACKAGE_PATH%\ifccityjson" "%CD%\src\ifccityjson\ifccityjson"
|
||||
mklink /D "%PACKAGE_PATH%\ifcclash" "%CD%\src\ifcclash\ifcclash"
|
||||
mklink /D "%PACKAGE_PATH%\ifcpatch" "%CD%\src\ifcpatch\ifcpatch"
|
||||
mklink /D "%PACKAGE_PATH%\ifctester" "%CD%\src\ifctester\ifctester"
|
||||
mklink /D "%PACKAGE_PATH%\ifcfm" "%CD%\src\ifcfm\ifcfm"
|
||||
|
||||
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"
|
||||
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.css -o "%PACKAGE_PATH%\blenderbim\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"
|
||||
|
||||
pause
|
||||
|
||||
@@ -1,60 +1,52 @@
|
||||
git clone https://github.com/IfcOpenShell/IfcOpenShell.git
|
||||
cd IfcOpenShell
|
||||
# Please update REPO_PATH, BLENDER_PATH, PACKAGE_PATH, BLENDERBIM_PATH in the script below.
|
||||
# Default BLENDER_PATH on Mac: "/Users/$USER/Library/Application Support/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="/home/dion/Projects/ifcopenshell/"
|
||||
BLENDER_PATH="${HOME}/.config/blender/4.2"
|
||||
PACKAGE_PATH="${BLENDER_PATH}/extensions/.local/lib/python3.11/site-packages"
|
||||
BLENDERBIM_PATH="${BLENDER_PATH}/extensions/user_default/blenderbim"
|
||||
|
||||
# path to BlenderBIM addon
|
||||
# default path on Mac: "/Users/$USER/Library/Application Support/Blender/X.X/scripts/addons/blenderbim"
|
||||
# default path on Linux: "$HOME/.config/blender/X.X/"
|
||||
BLENDER_ADDON_PATH="/path/to/blender/X.XX/scripts/addons/blenderbim"
|
||||
|
||||
# Remove the Blender add-on Python code
|
||||
rm -r $BLENDER_ADDON_PATH/core/
|
||||
rm -r $BLENDER_ADDON_PATH/tool/
|
||||
rm -r $BLENDER_ADDON_PATH/bim/
|
||||
|
||||
# Replace them with links to the Git repository
|
||||
ln -s $PWD/src/blenderbim/blenderbim/core $BLENDER_ADDON_PATH/core
|
||||
ln -s $PWD/src/blenderbim/blenderbim/tool $BLENDER_ADDON_PATH/tool
|
||||
ln -s $PWD/src/blenderbim/blenderbim/bim $BLENDER_ADDON_PATH/bim
|
||||
# Changing to the Git repository directory
|
||||
cd $REPO_PATH
|
||||
|
||||
# Copy over compiled IfcOpenShell files
|
||||
cp $BLENDER_ADDON_PATH/libs/site/packages/ifcopenshell/*_wrapper* $PWD/src/ifcopenshell-python/ifcopenshell/
|
||||
cp $PACKAGE_PATH/ifcopenshell/*_wrapper* $PWD/src/ifcopenshell-python/ifcopenshell/
|
||||
|
||||
# Remove the IfcOpenShell dependency
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifcopenshell
|
||||
# Remove extension and link to Git
|
||||
rm $BLENDERBIM_PATH/__init__.py
|
||||
rm -r $PACKAGE_PATH/blenderbim
|
||||
rm -r $PACKAGE_PATH/ifcopenshell
|
||||
rm -r $PACKAGE_PATH/ifccsv.py
|
||||
rm -r $PACKAGE_PATH/ifcdiff.py
|
||||
rm -r $PACKAGE_PATH/bsdd.py
|
||||
rm -r $PACKAGE_PATH/bcf
|
||||
rm -r $PACKAGE_PATH/ifc4d
|
||||
rm -r $PACKAGE_PATH/ifc5d
|
||||
rm -r $PACKAGE_PATH/ifccityjson
|
||||
rm -r $PACKAGE_PATH/ifcclash
|
||||
rm -r $PACKAGE_PATH/ifcpatch
|
||||
rm -r $PACKAGE_PATH/ifctester
|
||||
rm -r $PACKAGE_PATH/ifcfm
|
||||
|
||||
# Replace them with links to the Git repository
|
||||
ln -s $PWD/src/ifcopenshell-python/ifcopenshell $BLENDER_ADDON_PATH/libs/site/packages/ifcopenshell
|
||||
|
||||
# Remove and link other IfcOpenShell utilities
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifccsv.py
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifcdiff.py
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/bsdd.py
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/bcf
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifc4d
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifc5d
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifccityjson
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifcclash
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifcpatch
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifctester
|
||||
rm -r $BLENDER_ADDON_PATH/libs/site/packages/ifcfm
|
||||
rm -r $BLENDER_ADDON_PATH/libs/Desktop
|
||||
|
||||
ln -s $PWD/src/ifccsv/ifccsv.py $BLENDER_ADDON_PATH/libs/site/packages/ifccsv.py
|
||||
ln -s $PWD/src/ifcdiff/ifcdiff.py $BLENDER_ADDON_PATH/libs/site/packages/ifcdiff.py
|
||||
ln -s $PWD/src/bsdd/bsdd.py $BLENDER_ADDON_PATH/libs/site/packages/bsdd.py
|
||||
ln -s $PWD/src/bcf/bcf $BLENDER_ADDON_PATH/libs/site/packages/bcf
|
||||
ln -s $PWD/src/ifc4d/ifc4d $BLENDER_ADDON_PATH/libs/site/packages/ifc4d
|
||||
ln -s $PWD/src/ifc5d/ifc5d $BLENDER_ADDON_PATH/libs/site/packages/ifc5d
|
||||
ln -s $PWD/src/ifccityjson/ifccityjson $BLENDER_ADDON_PATH/libs/site/packages/ifccityjson
|
||||
ln -s $PWD/src/ifcclash/ifcclash $BLENDER_ADDON_PATH/libs/site/packages/ifcclash
|
||||
ln -s $PWD/src/ifcpatch/ifcpatch $BLENDER_ADDON_PATH/libs/site/packages/ifcpatch
|
||||
ln -s $PWD/src/ifctester/ifctester $BLENDER_ADDON_PATH/libs/site/packages/ifctester
|
||||
ln -s $PWD/src/ifcfm/ifcfm $BLENDER_ADDON_PATH/libs/site/packages/ifcfm
|
||||
ln -s $PWD/src/blenderbim/blenderbim/libs/desktop $BLENDER_ADDON_PATH/libs/Desktop
|
||||
ln -s $PWD/src/blenderbim/blenderbim/__init__.py $BLENDERBIM_PATH/__init__.py
|
||||
ln -s $PWD/src/blenderbim/blenderbim $PACKAGE_PATH/blenderbim
|
||||
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/ifcdiff/ifcdiff.py $PACKAGE_PATH/ifcdiff.py
|
||||
ln -s $PWD/src/bsdd/bsdd.py $PACKAGE_PATH/bsdd.py
|
||||
ln -s $PWD/src/bcf/bcf $PACKAGE_PATH/bcf
|
||||
ln -s $PWD/src/ifc4d/ifc4d $PACKAGE_PATH/ifc4d
|
||||
ln -s $PWD/src/ifc5d/ifc5d $PACKAGE_PATH/ifc5d
|
||||
ln -s $PWD/src/ifccityjson/ifccityjson $PACKAGE_PATH/ifccityjson
|
||||
ln -s $PWD/src/ifcclash/ifcclash $PACKAGE_PATH/ifcclash
|
||||
ln -s $PWD/src/ifcpatch/ifcpatch $PACKAGE_PATH/ifcpatch
|
||||
ln -s $PWD/src/ifctester/ifctester $PACKAGE_PATH/ifctester
|
||||
ln -s $PWD/src/ifcfm/ifcfm $PACKAGE_PATH/ifcfm
|
||||
|
||||
# Manually download some third party dependencies
|
||||
cd $BLENDER_ADDON_PATH/bim/data/gantt
|
||||
cd $PACKAGE_PATH/blenderbim/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.css
|
||||
cd $BLENDER_ADDON_PATH/bim/schema
|
||||
cd $PACKAGE_PATH/blenderbim/bim/schema
|
||||
wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
|
||||
|
||||
Reference in New Issue
Block a user