Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugin] Draft: Develop Blender plugin #1309

Draft
wants to merge 150 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
0628f08
Add initial code
n-jay Feb 10, 2023
ef55258
Add preliminary version of dependency installer
n-jay Apr 8, 2023
cec3089
Add addon init file
n-jay Apr 12, 2023
2eb2927
Rename addon init file
n-jay Apr 12, 2023
77f9717
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Apr 12, 2023
444bbc8
Add test job data
n-jay Jun 3, 2023
8fa46dd
Add dependencies list
n-jay Jun 3, 2023
134c3ce
Add initial job submission file
n-jay Jun 3, 2023
b4a21ab
Add dependency install check
n-jay Jun 5, 2023
2656031
Install external dependencies from text file
n-jay Jun 5, 2023
6d12198
Add cp module as dependency
n-jay Jun 13, 2023
a58b3d8
Implement OpenCue dependency install
n-jay Jun 13, 2023
9c3c0d0
Reorganize imports
n-jay Jun 13, 2023
4162226
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jun 13, 2023
a46f2bf
Add function to remove OpenCue dependencies when unregistering
n-jay Jun 16, 2023
be6c6e5
Remove external cp dependency
n-jay Jun 16, 2023
f9b1ea7
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jun 16, 2023
96c45b0
Resolve AttributeError
n-jay Jun 22, 2023
9f4a668
Add new external dependencies
n-jay Jun 23, 2023
f06019c
Add opencue dependency import
n-jay Jun 23, 2023
734c677
Set install directory for external python dependencies
n-jay Jun 23, 2023
c1b7ea1
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jun 23, 2023
9b69961
Add opencue module deletion
n-jay Jun 23, 2023
2bdd58b
Add text field for OpenCue home path
n-jay Jul 21, 2023
7cbb52e
Remove text field for OpenCue home path
n-jay Jul 25, 2023
370ff6c
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jul 30, 2023
fe2e08a
Remove unused imports and commented lines
n-jay Jul 30, 2023
96608df
Add render engine option to command
n-jay Oct 8, 2023
16e6c79
Cleanup code
n-jay Oct 8, 2023
949cb2a
Add Blender API to retrieve file path
n-jay Oct 8, 2023
4f9f17a
Add new fields to AddonPreferences
n-jay Nov 3, 2023
27991c1
Enable hardware rendering option in render command
n-jay Nov 3, 2023
e102e7d
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Nov 3, 2023
8e3e12d
Add missing FileSequence install code
n-jay Nov 6, 2023
fff01a8
Update command for enabling Nvidia CUDA rendering
n-jay Nov 6, 2023
1a63e39
Amend render command format
n-jay Nov 7, 2023
8ae92ab
Merge branch 'blender-addon-dev' of https://github.com/n-jay/OpenCue …
n-jay Nov 26, 2023
d84505f
Move addon code into blender subdirectory
n-jay Nov 26, 2023
43f125b
Add readme file with blender addon subdirectory details
n-jay Nov 26, 2023
65726ef
Set global variables
n-jay Nov 26, 2023
b90a212
Implement file operations via shutil module
n-jay Nov 26, 2023
2485e66
Fix addon registration bug
n-jay Dec 19, 2023
a99108a
Print terminal outputs in new lines
n-jay Dec 19, 2023
e7bf1c2
Update text field descriptions
n-jay Dec 19, 2023
a1e922d
Hide visibility of toggle in GUI
n-jay Dec 19, 2023
7b0f6df
Fix incorrect path
n-jay Dec 20, 2023
018e604
Read output path string
n-jay Dec 21, 2023
1e4cd63
Add python doc comments
n-jay Dec 23, 2023
e384e3b
Add missing license headers
n-jay Dec 23, 2023
5a7c837
Reformat code
n-jay Dec 23, 2023
13c2959
Rename addon
n-jay Mar 30, 2024
258235e
Move output path field
n-jay Mar 30, 2024
aeee004
Pin addon to output properties tab
n-jay Apr 1, 2024
f7e6bfa
Enable animation rendering
n-jay Apr 15, 2024
ae7faa7
Add success return for job submission button
n-jay May 26, 2024
d1dd023
Add continuous delivery for Blender addon
n-jay May 26, 2024
7d47230
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay May 29, 2024
fb0a902
Parameterize rqd service image in docker compose
n-jay Jun 2, 2024
e0d34cc
Run rqd blender image in integration script
n-jay Jun 2, 2024
3e95db6
Add Blender job to integration test script
n-jay Jun 3, 2024
a7b61fb
Add sample blender file
n-jay Jun 3, 2024
3b515c6
Temp: Add CI build
n-jay Jun 11, 2024
b657ea8
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jun 11, 2024
895b066
Add frame-spec parameter format check
n-jay Jun 19, 2024
e4a176c
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jun 19, 2024
8dcdc31
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jun 20, 2024
e01daeb
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jun 21, 2024
44950d2
Add Blender addon build script
n-jay Jun 30, 2024
7fa8a25
Add Blender addon build to CI workflow
n-jay Jun 30, 2024
f809128
Add CI environment check
n-jay Jul 4, 2024
b01400a
Remove Dockerfile
n-jay Jul 4, 2024
b05f70a
Fix blender addon build shell script
n-jay Jul 4, 2024
8c13425
Support dependencies contained within addon
n-jay Jul 14, 2024
0fde3e7
Enhance Qt compatibility and fix QtGui.QPalette bug in cuegui (#1376)
lithorus Jul 5, 2024
f87d65b
Bump tj-actions/changed-files from 35 to 41 in /.github/workflows (#1…
dependabot[bot] Jul 5, 2024
66cad82
Bump grpcio from 1.47.0 to 1.53.2 (#1403)
dependabot[bot] Jul 5, 2024
4cea175
[rqd] Fix non ASCII chars (#1335)
ramonfigueiredo Jul 10, 2024
7d8518c
Fix CI/CD checks that uses old docker images (#1405)
lithorus Jul 10, 2024
5c7870a
Redesign free temp dir monitoring feature (#1394)
DiegoTavares Jul 10, 2024
3cae77a
New email template (#1382)
DiegoTavares Jul 10, 2024
dd66ec9
Add framespec parameter format check (#1389)
n-jay Jul 10, 2024
4cc8bf5
Add FileSequence (#1396)
lithorus Jul 10, 2024
5c36ced
Order layer outputs in the order they were added (#1399)
lithorus Jul 10, 2024
fb3f6cb
Fix nullpointer condition on healthcheck (#1412)
DiegoTavares Jul 13, 2024
bb099f8
Add prometheus metrics collecting (#1408)
DiegoTavares Jul 15, 2024
e3f4aca
Run dispatch queries with preparedStatements (#1410)
DiegoTavares Jul 15, 2024
f545809
Remove ThreadPoolTaskExecutorWrapper (#1413)
DiegoTavares Jul 15, 2024
007e66e
Use opencue.properties for smtp host (#1414)
DiegoTavares Jul 15, 2024
1e5d8d3
Add support for Sentry to log (#1411)
DiegoTavares Jul 16, 2024
e7bf2c6
Apply same node fix as for testing-pipeline (#1415)
lithorus Jul 16, 2024
128eeac
Implement feature to override frame state display text/color in UI (#…
RosaBehrensCamp Jul 16, 2024
1248c5a
Fix file logging to handle non-ASCII characters without timestamp (#1…
ramonfigueiredo Jul 16, 2024
723f03a
[pycue] Minor API improvements (#1418)
DiegoTavares Jul 17, 2024
da7104f
[pycue] Add interactive functions to reboot hosts using the api (#1419)
DiegoTavares Jul 17, 2024
35f0410
Avoid creating the cuebot connection twice (#1420)
DiegoTavares Jul 17, 2024
d3a4d3f
Fix reading CUEGUI window states in config file (#1421)
lithorus Jul 17, 2024
2dcfd92
[pycue] Fix typeError on criterion search (#1422)
DiegoTavares Jul 17, 2024
2830d51
Add links to the Opencue meeting notes (#1424)
ramonfigueiredo Jul 18, 2024
18ae9df
Cy2024 (#1416)
lithorus Jul 23, 2024
f0a14fa
Cuesubmit jobs from config file with dynamic widgets (#1425)
lithorus Jul 24, 2024
ba4fa97
Fix "Monitor Cue" with incorrect column indexing (#1431)
ramonfigueiredo Jul 26, 2024
8582eba
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jul 26, 2024
bf982bf
Test addon build in packaging-pipeline
n-jay Jul 26, 2024
4268906
Temp: Remove addon build in packaging-pipeline
n-jay Jul 26, 2024
f8b4c9d
Fix addon build in packaging pipeline
n-jay Jul 31, 2024
3207241
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Jul 31, 2024
cf29086
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 1, 2024
06cf224
Update rqd dockerfile
n-jay Aug 1, 2024
267d70e
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 1, 2024
2bf06f2
Remove deprecated setuptool commands
n-jay Aug 8, 2024
4b45c2d
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 8, 2024
9db01e8
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 8, 2024
3a8fe6a
Merge branch 'dockerfile-updates' into blender-addon-dev
n-jay Aug 13, 2024
d5263a7
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 14, 2024
d109eea
Remove deprecated dependencies
n-jay Aug 14, 2024
d9d915a
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 16, 2024
7fa2269
Add xz tool installation
n-jay Aug 16, 2024
bc34849
Merge branch 'blender-docker-update' into blender-addon-dev
n-jay Aug 16, 2024
021f527
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 17, 2024
6733231
Fix docker compose command
n-jay Aug 17, 2024
9316aa7
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 23, 2024
54d2245
Temp: Remove RQD shutdown process
n-jay Aug 23, 2024
7529e81
Add force recreate flag to Blender RQD container
n-jay Aug 23, 2024
d496c3e
Fix docker compose command format
n-jay Aug 23, 2024
cbd97b8
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 28, 2024
f07cd4b
Remove docker compose Blender deployment
n-jay Aug 31, 2024
794909c
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Aug 31, 2024
becf3be
Remove output location parameter from Blender test command
n-jay Sep 9, 2024
43075cb
Update docker run command
n-jay Sep 9, 2024
59a18e4
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Sep 9, 2024
0e1bf72
Add missing shebang line
n-jay Sep 10, 2024
ae9b94b
Add missing permission to sample Blender job
n-jay Sep 10, 2024
6ed032c
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Sep 18, 2024
4446292
Fix Blender job name error
n-jay Sep 18, 2024
469af67
Edit Blender RQD container config file
n-jay Sep 23, 2024
c779c60
Add tag to Blender RQD container
n-jay Sep 23, 2024
d08e1dc
Update variable in add tag function
n-jay Sep 23, 2024
604a44b
Fix loop to check RQD Blender container connecting in Cuebot
n-jay Sep 25, 2024
89e7963
Fix array iteration to check if RQD Blender container connecting to C…
n-jay Oct 23, 2024
4161535
Add RQD tag addition to integration test
n-jay Oct 23, 2024
9ad0725
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Oct 23, 2024
17a6d18
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Nov 3, 2024
3d31512
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Nov 13, 2024
f9187f9
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Nov 15, 2024
dc9d99b
Fix filepath
n-jay Nov 15, 2024
31c2f97
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Nov 15, 2024
d74905c
Amend Blender render command
n-jay Nov 16, 2024
1f8d35c
Remove .blend file input in integration tests
n-jay Nov 16, 2024
fb62c9e
Merge branch 'master' of https://github.com/AcademySoftwareFoundation…
n-jay Nov 16, 2024
e81ed48
Merge branch 'fix-integration-test-script' into blender-addon-dev
n-jay Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/packaging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: OpenCue Packaging Pipeline
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
integration_test:
Expand All @@ -16,6 +18,15 @@ jobs:
- name: Run test
run: ci/run_integration_test.sh

- name: Build blender addon
run: ci/build_blender_addon.sh

- name: Upload blender addon artifact
uses: actions/upload-artifact@v3
with:
name: OpenCue-Blender
path: ${GITHUB_WORKSPACE}/artifacts/OpenCue-Blender.zip

- name: Archive log files
uses: actions/upload-artifact@v3
if: ${{ always() }}
Expand Down Expand Up @@ -57,6 +68,10 @@ jobs:
NAME: CueAdmin
ARTIFACTS: cueadmin-${BUILD_ID}-all.tar.gz

- component: OpenCue_Blender
NAME: OpenCue-Blender
ARTIFACTS: OpenCue-Blender-${BUILD_ID}-all.zip

name: Build ${{ matrix.NAME }}
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -97,6 +112,15 @@ jobs:
context: .
push: true

- name: Build Blender addon Docker image
if: matrix.component == 'OpenCue_Blender'
uses: docker/build-push-action@v3
with:
file: cuesubmit/plugins/blender/${{ matrix.component }}/Dockerfile
tags: opencuebuild/${{ matrix.component }}:${{ env.BUILD_ID }}
context: .
push: true

- name: Extract Artifacts
run: |
set -e
Expand Down
60 changes: 60 additions & 0 deletions ci/build_blender_addon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
# Copyright Contributors to the OpenCue Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# OpenCue integration test script
#
# Stands up a clean environment using Docker compose and verifies all
# components are functioning as expected.
#
# Run with:
# ./ci/build_blender_addon.sh

set -e

PYOUTLINE_PATH="pyoutline/outline"
FILESEQUENCE_PATH="pycue/FileSequence"
OPENCUE_PATH="pycue/opencue"

ADDON_PATH="cuesubmit/plugins/blender/OpenCue-Blender/"

log() {
echo "$(date "+%Y-%m-%d %H:%M:%S") $1 $2"
}

copy_dependencies() {
DEPENDENCIES_PATH="${ADDON_PATH}/dependencies"
mkdir -p "${DEPENDENCIES_PATH}"
cp -r "${PYOUTLINE_PATH}" "${DEPENDENCIES_PATH}"
cp -r "${FILESEQUENCE_PATH}" "${DEPENDENCIES_PATH}"
cp -r "${OPENCUE_PATH}" "${DEPENDENCIES_PATH}"
}

main() {
log INFO "Copying dependencies into ${ADDON_PATH}"
copy_dependencies
# Check if script is running within GitHub Actions pipeline
if [ "$GITHUB_ACTIONS" == "true" ]; then
log INFO "Generating zip in ${GITHUB_WORKSPACE}/artifacts/"
mkdir -p "${GITHUB_WORKSPACE}/artifacts/"
cd cuesubmit/plugins/blender
zip -r "${GITHUB_WORKSPACE}/artifacts/OpenCue-Blender.zip" OpenCue-Blender/
else
log INFO "Generating zip in cuesubmit/plugins/blender/"
cd cuesubmit/plugins/blender
zip -r "OpenCue-Blender.zip" OpenCue-Blender/
fi
}

main
55 changes: 54 additions & 1 deletion ci/run_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,40 @@ run_job() {
log INFO "Job succeeded (PASS)"
}

run_blender_job() {
cp samples/pyoutline/sample.blend $RQD_ROOT
samples/pyoutline/blender_job.py
job_name="testing-shot02-${USER}_blender_job"
samples/pycue/wait_for_job.py "${job_name}" --timeout 300
log INFO "Blender job succeeded (PASS)"
}

add_RQD_tag() {
container_id=$(docker ps --filter "name=blender" --format "{{.ID}}")
got_hosts=$(python -c 'import opencue; print([host.name() for host in opencue.api.getHosts()])')
host_exists=false
for host in $(echo "${got_hosts}" | tr -d '[],' | tr -d "'" | tr ' ' '\n'); do
if [[ "$host" == "$container_id" ]]; then
host_exists=true
break
fi
done

if [[ "$host_exists" == true ]]; then
log INFO "Adding tag to Blender RQD"
python -c "import opencue; import opencue.wrappers.host; \
host=opencue.api.findHost('${container_id}'); \
tags = ['blender']; \
host.addTags(tags)"
else
log ERROR "Blender RQD not detected by Cuebot. Unable to add tag"
exit 1
fi
}

cleanup() {
docker compose rm --stop --force >>"${DOCKER_COMPOSE_LOG}" 2>&1
docker rm -f blender
rm -rf "${RQD_ROOT}" || true
rm -rf "${DB_DATA_DIR}" || true
rm -rf "${VENV}" || true
Expand Down Expand Up @@ -222,9 +254,11 @@ main() {
log INFO "$(docker compose version)"

log INFO "Building Cuebot image..."
docker build -t opencue/cuebot -f cuebot/Dockerfile . &>"${TEST_LOGS}/docker-build-cuebot.log"
# docker build -t opencue/cuebot -f cuebot/Dockerfile . &>"${TEST_LOGS}/docker-build-cuebot.log"
log INFO "Building RQD image..."
docker build -t opencue/rqd -f rqd/Dockerfile . &>"${TEST_LOGS}/docker-build-rqd.log"
log INFO "Building RQD Blender image..."
docker build -t opencue/blender -f samples/rqd/blender/Dockerfile . &>"${TEST_LOGS}/docker-build-rqd-blender.log"

log INFO "Starting Docker compose..."
docker compose up &>"${DOCKER_COMPOSE_LOG}" &
Expand All @@ -251,6 +285,25 @@ main() {

run_job

log INFO "Starting RQD Blender..."
docker run -td --name blender \
--env CUEBOT_HOSTNAME=cuebot \
--volume "/tmp/rqd/shots:/tmp/rqd/shots" \
--volume "/tmp/rqd/logs:/tmp/rqd/logs" \
-p 8441:8441 \
--network opencue_default \
opencue/blender

docker exec blender sh -c 'echo "RQD_USE_IP_AS_HOSTNAME=False" >> /etc/opencue/rqd.conf'
log INFO "Restarting RQD Blender..."
docker restart blender
sleep 3

add_RQD_tag

log INFO "Testing Blender job..."
run_blender_job

cleanup

log INFO "Success"
Expand Down
117 changes: 117 additions & 0 deletions cuesubmit/plugins/blender/OpenCue-Blender/Setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Copyright Contributors to the OpenCue Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import shutil
import sys
import subprocess
import os
import platform
import bpy

blender_dependencies_directory = "lib/python3.10/site-packages"
blender_dependencies_path = os.path.join(sys.prefix, blender_dependencies_directory)
opencue_blender_path = os.path.dirname(__file__)

pyoutline_path = os.path.join(opencue_blender_path, "dependencies", "outline")
filesequence_path = os.path.join(opencue_blender_path, "dependencies", "FileSequence")
opencue_path = os.path.join(opencue_blender_path, "dependencies", "opencue")

pyoutline_directory = "outline"
opencue_imported_directory = "opencue"
filesequence_imported_directory = "FileSequence"
pyoutline_directory_path = os.path.join(sys.prefix, blender_dependencies_directory, pyoutline_directory)
opencue_directory_path = os.path.join(sys.prefix, blender_dependencies_directory, opencue_imported_directory)
filesequence_directory_path = os.path.join(sys.prefix, blender_dependencies_directory, filesequence_imported_directory)


def isWindows():
"""Checks if host OS is Windows"""
return os.name == 'nt'


def isMacOS():
"""Checks if host OS is macOS"""
return os.name == 'posix' and platform.system() == "Darwin"


def isLinux():
"""Checks if host OS is Linux"""
return os.name == 'posix' and platform.system() == "Linux"


def python_exec():
"""Sets Blender local python based on host OS"""
if isWindows():
return os.path.join(sys.prefix, 'bin', 'python.exe')
elif isMacOS():
try:
# 2.92 and older
path = bpy.app.binary_path_python
except AttributeError:
# 2.93 and later
path = sys.executable
return os.path.abspath(path)
elif isLinux():
return os.path.join(sys.prefix, 'bin', 'python3.10') # Works on Blender 3.3.1 LTS
else:
print("sorry, still not implemented for ", os.name, " - ", platform.system)
return os.path.join(sys.prefix, 'sys.prefix/bin', 'python')


def installModule():
"""Installs all addon dependencies during registration"""
# Install OpenCue dependencies
installOpencueModules()

# installs External modules from requirements.txt file
installExternalModules()

print("\n----- OpenCue-Blender Installed Successfully -----")


def installExternalModules():
"""Installs externals dependencies onto Blender python environment with pip"""
# Get path of requirements file
script_file = os.path.realpath(__file__)
directory = os.path.dirname(script_file)
file_name = "requirements.txt"
requirements = os.path.join(directory, file_name)

# identify for platform
python_exe = python_exec()

# upgrade pip
print("\n----- Installing External Dependencies -----")
subprocess.call([python_exe, "-m", "ensurepip"])
subprocess.call([python_exe, "-m", "pip", "install", "--upgrade", "pip"])
# install required external packages
subprocess.call([python_exe, "-m", "pip", "install", "-r", requirements, "-t", blender_dependencies_path])
print("\n----- External Dependencies Installed Successfully -----")


def installOpencueModules():
"""Installs OpenCue dependencies onto Blender python environment"""
print("----- Installing OpenCue Dependencies -----")
shutil.copytree(pyoutline_path, pyoutline_directory_path)
shutil.copytree(opencue_path, opencue_directory_path)
shutil.copytree(filesequence_path, filesequence_directory_path)
print("\n----- OpenCue Dependencies Installed Successfully -----")


def removeOpencueModules():
"""Removes OpenCue dependencies from Blender python environment"""
# remove installed opencue dependencies
shutil.rmtree(pyoutline_directory_path)
shutil.rmtree(opencue_directory_path)
shutil.rmtree(filesequence_directory_path)
Loading
Loading