Skip to content

Commit

Permalink
Update to python==3.11 bpy==4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
araistrick authored and pvl-bot committed Nov 11, 2024
1 parent 525c473 commit a4b73b5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion infinigen/core/constraints/constraint_language/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion infinigen/core/execute_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
26 changes: 13 additions & 13 deletions scripts/install/interactive_blender.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 .
CFLAGS="-I/usr/include/python3.11 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -e .

0 comments on commit a4b73b5

Please sign in to comment.