From a4b73b56c41f12d1107d9b4c1880801d0e223bd5 Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Sat, 27 Jul 2024 23:25:18 -0400 Subject: [PATCH] Update to python==3.11 bpy==4.2 --- .github/workflows/checks.yml | 4 +-- Dockerfile | 2 +- docs/Installation.md | 2 +- .../constraint_language/geometry.py | 2 +- infinigen/core/execute_tasks.py | 2 +- pyproject.toml | 5 ++-- scripts/install/interactive_blender.sh | 26 +++++++++---------- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6d962e8fd..97b46fc08 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -36,10 +36,10 @@ jobs: # default set of ruff rules with GitHub Annotations ruff check --output-format=github . - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install infinigen & dependencies run: | diff --git a/Dockerfile b/Dockerfile index 37cca12c5..a51b9547d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,6 @@ WORKDIR /opt/infinigen COPY . . RUN conda init bash && \ . ~/.bashrc && \ - conda create --name infinigen python=3.10 -y && \ + conda create --name infinigen python=3.11 -y && \ conda activate infinigen && \ pip install -e ".[dev]" diff --git a/docs/Installation.md b/docs/Installation.md index 1fbad7bf8..a7d9ac7e1 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -61,7 +61,7 @@ First, download the repo and set up a conda environment (you may need to [instal ```bash git clone https://github.com/princeton-vl/infinigen.git cd infinigen -conda create --name infinigen python=3.10 +conda create --name infinigen python=3.11 conda activate infinigen ``` diff --git a/infinigen/core/constraints/constraint_language/geometry.py b/infinigen/core/constraints/constraint_language/geometry.py index 5448d4982..aa15002d6 100644 --- a/infinigen/core/constraints/constraint_language/geometry.py +++ b/infinigen/core/constraints/constraint_language/geometry.py @@ -20,7 +20,7 @@ class center_stable_surface_dist(ScalarExpression): class accessibility_cost(ScalarExpression): objs: ObjectSetExpression others: ObjectSetExpression - normal: np.array = field(default=np.array([1, 0, 0])) + normal: np.array = field(default_factory=lambda: np.array([1, 0, 0])) dist: float = 1.0 def __post_init__(self): diff --git a/infinigen/core/execute_tasks.py b/infinigen/core/execute_tasks.py index 1436b5b13..a7d8e53d9 100644 --- a/infinigen/core/execute_tasks.py +++ b/infinigen/core/execute_tasks.py @@ -347,7 +347,7 @@ def execute_tasks( def main(input_folder, output_folder, scene_seed, task, task_uniqname, **kwargs): - version_req = ["3.6.0"] + version_req = ["3.6.0", "4.2.0"] assert bpy.app.version_string in version_req, ( f"You are using blender={bpy.app.version_string} which is " f"not supported. Please use {version_req}" diff --git a/pyproject.toml b/pyproject.toml index 5f9a973eb..0ad95e6ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,12 +17,11 @@ keywords = [ classifiers = [ "Framework :: Blender", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10" ] -requires-python = "==3.10.*" +requires-python = "==3.11.*" dependencies = [ - "bpy==3.6.0", + "bpy==4.2.0", "frozendict", # TODO remove "geomdl", # used only for creatures "gin_config>=0.5.0", diff --git a/scripts/install/interactive_blender.sh b/scripts/install/interactive_blender.sh index a64fb9ad4..495cecc60 100644 --- a/scripts/install/interactive_blender.sh +++ b/scripts/install/interactive_blender.sh @@ -12,33 +12,33 @@ OS=$(uname -s) ARCH=$(uname -m) if [ "${OS}" = "Linux" ]; then - BLENDER_WGET_LINK='https://download.blender.org/release/Blender3.6/blender-3.6.0-linux-x64.tar.xz' + BLENDER_WGET_LINK='https://download.blender.org/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz' BLENDER_WGET_FILE='blender.tar.xz' - BLENDER_UNTAR_DIR='blender-3.6.0-linux-x64' + BLENDER_UNTAR_DIR='blender-4.2.0-linux-x64' BLENDER_DIR='blender' - BLENDER_PYTHON="${BLENDER_DIR}/3.6/python/bin/python3.10" - BLENDER_INCLUDE="${BLENDER_DIR}/3.6/python/include/python3.10" - BLENDER_PACKAGES="${BLENDER_DIR}/3.6/python/lib/python3.10/site-packages" - BLENDER_ADDONS="${BLENDER_DIR}/3.6/scripts/addons" + BLENDER_PYTHON="${BLENDER_DIR}/4.2/python/bin/python3.11" + BLENDER_INCLUDE="${BLENDER_DIR}/4.2/python/include/python3.11" + BLENDER_PACKAGES="${BLENDER_DIR}/4.2/python/lib/python3.11/site-packages" + BLENDER_ADDONS="${BLENDER_DIR}/4.2/scripts/addons" BLENDER_EXE="${BLENDER_DIR}/blender" elif [ "${OS}" = "Darwin" ]; then if [ "${ARCH}" = "arm64" ]; then - BLENDER_WGET_LINK='https://download.blender.org/release/Blender3.6/blender-3.6.0-macos-arm64.dmg' + BLENDER_WGET_LINK='https://download.blender.org/release/Blender4.2/blender-4.2.0-macos-arm64.dmg' else - BLENDER_WGET_LINK='https://download.blender.org/release/Blender3.6/blender-3.6.0-macos-x64.dmg' + BLENDER_WGET_LINK='https://download.blender.org/release/Blender4.2/blender-4.2.0-macos-x64.dmg' fi BLENDER_WGET_FILE='blender.dmg' BLENDER_VOLM='/Volumes/Blender' BLENDER_DIR='./Blender.app' - BLENDER_PYTHON="${BLENDER_DIR}/Contents/Resources/3.6/python/bin/python3.10" - BLENDER_INCLUDE="${BLENDER_DIR}/Contents/Resources/3.6/python/include/python3.10" - BLENDER_PACKAGES="${BLENDER_DIR}/Contents/Resources/3.6/python/lib/python3.10/site-packages" - BLENDER_ADDONS="${BLENDER_DIR}/Contents/Resources/3.6/scripts/addons" + BLENDER_PYTHON="${BLENDER_DIR}/Contents/Resources/4.2/python/bin/python3.11" + BLENDER_INCLUDE="${BLENDER_DIR}/Contents/Resources/4.2/python/include/python3.11" + BLENDER_PACKAGES="${BLENDER_DIR}/Contents/Resources/4.2/python/lib/python3.11/site-packages" + BLENDER_ADDONS="${BLENDER_DIR}/Contents/Resources/4.2/scripts/addons" BLENDER_EXE="${BLENDER_DIR}/Contents/MacOS/Blender" else @@ -66,4 +66,4 @@ fi # Install Blender dependencies "${BLENDER_PYTHON}" -m ensurepip -CFLAGS="-I/usr/include/python3.10 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -e . \ No newline at end of file +CFLAGS="-I/usr/include/python3.11 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -e . \ No newline at end of file