diff --git a/src/bonsai/docs/guides/development/ide/images/dev-environment-sh-executed.png b/src/bonsai/docs/guides/development/ide/images/dev-environment-sh-executed.png deleted file mode 100644 index 1bcb042e51..0000000000 Binary files a/src/bonsai/docs/guides/development/ide/images/dev-environment-sh-executed.png and /dev/null differ diff --git a/src/bonsai/docs/guides/development/ide/images/dev-environment-sh.png b/src/bonsai/docs/guides/development/ide/images/dev-environment-sh.png deleted file mode 100644 index 11f35fb9e4..0000000000 Binary files a/src/bonsai/docs/guides/development/ide/images/dev-environment-sh.png and /dev/null differ diff --git a/src/bonsai/docs/guides/development/ide/images/run-as-administrator.png b/src/bonsai/docs/guides/development/ide/images/run-as-administrator.png deleted file mode 100644 index 560c8bcf8b..0000000000 Binary files a/src/bonsai/docs/guides/development/ide/images/run-as-administrator.png and /dev/null differ diff --git a/src/bonsai/docs/guides/development/ide/images/running-dev_environment-bat.png b/src/bonsai/docs/guides/development/ide/images/running-dev_environment-bat.png deleted file mode 100644 index 429404547c..0000000000 Binary files a/src/bonsai/docs/guides/development/ide/images/running-dev_environment-bat.png and /dev/null differ diff --git a/src/bonsai/docs/guides/development/ide/linux/dev_environment.sh b/src/bonsai/docs/guides/development/ide/linux/dev_environment.sh deleted file mode 100644 index a172a0ae4a..0000000000 --- a/src/bonsai/docs/guides/development/ide/linux/dev_environment.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# Please update REPO_PATH and BLENDER_PATH in the script below. -# Default BLENDER_PATH on Mac: "/Users/$USER/Library/Application Support/Blender/4.5" -# Default BLENDER_PATH on Linux: "$HOME/.config/blender/4.5" -# REPO_PATH="/path/to/where/your/git/repository/is/cloned/IfcOpenShell" -set -e -REPO_PATH="$HOME/bonsaiDevel/IfcOpenShell" -BLENDER_PATH="$HOME/.config/blender/4.5" -PACKAGE_PATH="${BLENDER_PATH}/extensions/.local/lib/python3.11/site-packages" -# If you are installing offline, use this instead: -# BONSAI_PATH="${BLENDER_PATH}/extensions/user_default/bonsai" -BONSAI_PATH="${BLENDER_PATH}/extensions/raw_githubusercontent_com/bonsai" - -# Changing to the Git repository directory -cd "${REPO_PATH}" - - -# Add files that need to be ignored in push to GiHub (.gitignore). Namely *.so files are very big and do not need to be pushed -FILE=".gitignore" -STRING="*.so" - -# Check if the file exists and contains the string -if [ ! -f "$FILE" ] || ! grep -qxF "$STRING" "$FILE"; then - echo "$STRING" >> "$FILE" - echo "Added '$STRING' to $FILE" -else - echo "'$STRING' already exists in $FILE" -fi - - - -# Print summary of PATHs -echo "Please review if the following is right:" -echo "PWD: ${PWD}" -echo "REPO PATH (...../IfcOpenshell): ${REPO_PATH}" -echo "BLENDER PATH: ${BLENDER_PATH}" -echo "PACKAGE PATH (...../etensions/.local/lib/python3.11/site-packages): ${PACKAGE_PATH}" -echo "BONSAI PATH (...../extensions/raw_githubusercontent_com/bonsai): ${BONSAI_PATH}" -read -p "Press any key to START or CTRL-C to stop ..." - -# Copy over compiled IfcOpenShell files -for src_file in "${PACKAGE_PATH}/ifcopenshell/"*_wrapper*; do - dest_file="${PWD}/src/ifcopenshell-python/ifcopenshell/$(basename "$src_file")" - # Only copy if source and destination are not the same file - if [ "$(realpath "$src_file")" != "$(realpath "$dest_file")" ]; then - cp "$src_file" "$dest_file" - echo "Copied: $(basename "$src_file")" - else - echo "Skipped (same file): $(basename "$src_file")" - fi -done - - - - -# Remove extension and link to Git -rm "${BONSAI_PATH}/__init__.py" -rm -r "${PACKAGE_PATH}/bonsai" -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" - -ln -s "${PWD}/src/bonsai/bonsai/__init__.py" "${BONSAI_PATH}/__init__.py" -ln -s "${PWD}/src/bonsai/bonsai" "${PACKAGE_PATH}/bonsai" -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 "${PACKAGE_PATH}/bonsai/bim/data/gantt" -wget -O jsgantt.js https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js -wget -O jsgantt.css https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css - -[ -d "$PACKAGE_PATH/bonsai/bim/schema" ] || mkdir -p "$PACKAGE_PATH/bonsai/bim/schema" -cd "${PACKAGE_PATH}/bonsai/bim/schema" -wget -O Brick.ttl https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl diff --git a/src/bonsai/docs/guides/development/ide/linux_ide.rst b/src/bonsai/docs/guides/development/ide/linux_ide.rst index 6381ff47b8..f0867e3fe7 100644 --- a/src/bonsai/docs/guides/development/ide/linux_ide.rst +++ b/src/bonsai/docs/guides/development/ide/linux_ide.rst @@ -395,45 +395,11 @@ Now let's find out how to interact with GitHub in order to make changes to the B .. image:: images/cloned-repo.png :width: 1000 px -10. **Link the Bonsai addon to the local cloned repository**: We will now edit the following - script that establishes links from the unstable-installation to the cloned repository so we - can easily see the changes done in the cloned repository taken effect when we load blender - locally. - - .. container:: blockbutton - - :download:`Download dev_environment.sh ` - - Edit the file to match the paths in your system. In our case we will edit the following lines: - - - REPO_PATH="$HOME/bonsaiDevel/IfcOpenShell" - - BLENDER_PATH="$HOME/.config/blender/4.2" - - PACKAGE_PATH="${BLENDER_PATH}/extensions/.local/lib/python3.11/site-packages" - - BONSAI_PATH="${BLENDER_PATH}/extensions/raw_githubusercontent_com/bonsai" - - We execute the script in the terminal. Confirm the data and the script will create the necessary links. - - .. code-block:: bash - - ./dev_environment.sh - - .. image:: images/dev-environment-sh.png - :width: 1000 px - - .. image:: images/dev-environment-sh-executed.png - :width: 1000 px - - .. warning:: - - If you receive an error like this: - - .. code-block:: bash - - cp: cannot stat '/home/falken10vdl/.config/blender/4.2/extensions/.local/lib/python3.11/site-packages/ifcopenshell/*_wrapper*': No such file or directory - - It means that you have not installed the Bonsai Blender extension. Please refer to tha - last part of point 2. above and follow the `Unstable installation `__. - +10. **Link the Bonsai addon to the local cloned repository**: We will now run a script that + establishes links from the unstable-installation to the cloned repository so we + can easily see the changes done in the cloned repository taken effect when we load blender + locally. Follow the :ref:`guides/development/installation:Live development + environment` section to run ``dev_environment.py``. 11. **Adjust the VSCode Blender extension**: We will now make some adjustments to the VSCode Blender extension to ease the reload of the addon. Select the Extensions tool. Then :menuselection:`Blender Development` and then select :menuselection:`Settings`. diff --git a/src/bonsai/docs/guides/development/ide/windows/dev_environment.bat b/src/bonsai/docs/guides/development/ide/windows/dev_environment.bat deleted file mode 100644 index a5007aa19d..0000000000 --- a/src/bonsai/docs/guides/development/ide/windows/dev_environment.bat +++ /dev/null @@ -1,100 +0,0 @@ -@echo off - -setlocal enabledelayedexpansion - - -rem ADAPT setting REPO_PATH to use custom path for IfcOpenShell repository. -rem Otherwise by default it is assumed script is executed from IfcOpenShell directory. -SET REPO_PATH=%HOMEDRIVE%\Users\%USERNAME%\Documents\bonsaiDevel\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 BONSAI_PATH=%BLENDER_PATH%\extensions\raw_githubusercontent_com\bonsai - -echo SETUP BONSAI ADD-ON LIVE DEVELOPMENT ENVIRONMENT -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 Make sure you have followed these steps before proceeding :) -echo. -echo Currently set paths: -if not defined REPO_PATH ( - echo REPO_PATH is not set, assuming we're already in IfcOpenShell directory. - set REPO_PATH=%cd% -) -rem Print summary of paths -echo. -echo Please review if the following is right: -echo PWD: %CD% -echo REPO PATH (.....\IfcOpenshell): %REPO_PATH% -echo BLENDER PATH: %BLENDER_PATH% -echo PACKAGE PATH (.....\extensions\.local\lib\python3.11\site-packages): %PACKAGE_PATH% -echo BONSAI PATH (.....\extensions\raw_githubusercontent_com\bonsai): %BONSAI_PATH% -echo. -rem Prompt user to continue -pause - - -echo Changing to the Git repository directory... -cd %REPO_PATH% - -rem Add files that need to be ignored in push to GiHub (.gitignore) -set "FILE=.gitignore" -set "STRING=*.so" - -rem Check if the file exists and contains the string -if not exist "%FILE%" ( - echo %STRING% >> "%FILE%" - echo "%FILE%" does not exist - echo Added '%STRING%' to %FILE% -) else ( - findstr /L "%STRING%" "%FILE%" >nul - if errorlevel 1 ( - echo %STRING% >> "%FILE%" - echo %STRING% not found in %FILE% - echo Added %STRING% to %FILE% - ) else ( - echo '%STRING%' already exists in %FILE% - ) -) - -echo Copy over compiled IfcOpenShell files... -copy "%PACKAGE_PATH%\ifcopenshell\*_wrapper*" "%CD%\src\ifcopenshell-python\ifcopenshell\" - -echo Remove extension and link to Git... -del "%BONSAI_PATH%\__init__.py" -rd /S /Q "%PACKAGE_PATH%\bonsai" -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" - -mklink "%BONSAI_PATH%\__init__.py" "%CD%\src\bonsai\bonsai\__init__.py" -mklink /D "%PACKAGE_PATH%\bonsai" "%CD%\src\bonsai\bonsai" -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 "%PACKAGE_PATH%\bonsai\bim\data\gantt\jsgantt.js" -curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css -o "%PACKAGE_PATH%\bonsai\bim\data\gantt\jsgantt.css" -IF NOT EXIST "%PACKAGE_PATH%\bonsai\bim\schema" mkdir "%PACKAGE_PATH%\bonsai\bim\schema" -curl -L https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl -o "%PACKAGE_PATH%\bonsai\bim\schema\Brick.ttl" - - -pause \ No newline at end of file diff --git a/src/bonsai/docs/guides/development/ide/windows_ide.rst b/src/bonsai/docs/guides/development/ide/windows_ide.rst index a8e91ebfd1..c916e124a6 100644 --- a/src/bonsai/docs/guides/development/ide/windows_ide.rst +++ b/src/bonsai/docs/guides/development/ide/windows_ide.rst @@ -338,44 +338,12 @@ Now let's find out how to interact with GitHub in order to make changes to the B .. image:: images/cloned-repo.png :width: 1000 px -10. **Link the Bonsai addon to the local cloned repository**: We will now edit the following - script that establishes links from the unstable-installation to the cloned repository so we - can easily see the changes done in the cloned repository taken effect when we load blender - locally. - - .. container:: blockbutton - - :download:`Download dev_environment.bat ` - - Edit the file to match the paths in your system. In our case we will edit the following lines: - - - SET REPO_PATH=%HOMEDRIVE%\\Users\\%USERNAME%\\Documents\\bonsaiDevel\\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 BONSAI_PATH=%BLENDER_PATH%\\extensions\\raw_githubusercontent_com\\bonsai - - You need to run it as an administrator. - - .. image:: images/run-as-administrator.png - :width: 1000 px - - Confirm the data and the script will create the necessary links. - - .. image:: images/running-dev_environment-bat.png - :width: 1000 px - - - .. warning:: - - If you receive errors like this: - - .. code-block:: bash - - The system cannot find the path specified. - - It means that you have not installed the Bonsai Blender extension. Please refer to tha - last part of point 2. above and follow the `Unstable installation `__. - +10. **Link the Bonsai addon to the local cloned repository**: We will now run a script that + establishes links from the unstable-installation to the cloned repository so we + can easily see the changes done in the cloned repository taken effect when we load blender + locally. Follow the :ref:`guides/development/installation:Live development + environment` section to run ``dev_environment.py``. You need to run it as an + administrator, with Blender closed. 11. **Adjust the VSCode Blender extension**: We will now make some adjustments to the VSCode Blender extension to ease the reload of the addon. Select the Extensions tool. Then :menuselection:`Blender Development` and then select :menuselection:`Settings`.