[plugin] Draft: Develop Blender plugin#1309
[plugin] Draft: Develop Blender plugin#1309n-jay wants to merge 163 commits intoAcademySoftwareFoundation:masterfrom
Conversation
Include initial UI and organization metadata
…/OpenCue into blender-addon-dev
Checks if dependencies were installed during first install of addon
For copying OpenCue dependencies for local Git repo
To avoid ModuleNotFoundException in first install
…/OpenCue into blender-addon-dev
…/OpenCue into blender-addon-dev
Resolve error when extracting data from 'cmd' dictionary inside layerData
…/OpenCue into blender-addon-dev
Deletes opencue module when unregistering addon
In addon settings section
Will be addressed as system environment variable
…/OpenCue into blender-addon-dev
Remove extra lines, comments and unused imports
|
|
||
| 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" |
There was a problem hiding this comment.
Is this an accidental change?
There was a problem hiding this comment.
Yup, sorry about that.
Fixed with latest merge.
| 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 |
There was a problem hiding this comment.
This PR ends up polluting the integration test script with several blender specific steps. I feel the changes are impactful enough that it makes sense to isolate blender in its own integration test.
I suggest creating ci/run_blender_integration_test.sh to maintain the general integration test script simple.
There was a problem hiding this comment.
@DiegoTavares I separated the test in 1b285ed.
I was under the impression that this new script should be added to the packaging_pipeline.yaml, ideally somewhere here:
https://github.com/AcademySoftwareFoundation/OpenCue/pull/1309/changes#diff-f7ff6bba1497d8cf2c231a66ff51ef7dceb715b8a237b102973d7e4ef9417e45R160
But it doesn't seem to execute with the build.
| 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" |
There was a problem hiding this comment.
Please use platform.system() to get the correct OS similar to the way rqmachine.py does it.
There was a problem hiding this comment.
Binary files are problematic on the repo due to security risks. We should find a way to test without keeping the binary on the repo.
There was a problem hiding this comment.
@DiegoTavares is there a recommended way to download a temporary binary (in this case the .blend file) during a build from something like an isolated AWS storage?
There are sample .blend files on the Blender official site, but they are quite large and complex for a simple CI pipeline. This is why I opted to go with a .blend if our own and also so that the build wouldn't break if the URL changes.
There was a problem hiding this comment.
This file needs to be removed. We don't use requirements files anymore, but have it in the pyptoject.toml file instead
There was a problem hiding this comment.
Wait. is this used by blender to install packages needed? If so, then it just needs to depend on the relevant opencue packages.
There was a problem hiding this comment.
Iirc these are the dependencies that were needed by the Blender addon to send a job to Cuebot. I believe I got these from Cuesubmit. I'll look into making this into toml format, but I need to verify the Python version that's running inside Blender. I think the latest LTS version includes 3.11 so it should be fine.
If so, then it just needs to depend on the relevant opencue packages.
As in use an existing Cuesubmit or related dependency file instead of creating a new file?
There was a problem hiding this comment.
I think you just need to depend on opencue-outline instead.
There was a problem hiding this comment.
One could also argue that the OpenCue-Blender addon and the cuesubmit plugin are 2 different things. They don't share any code and are 2 different ways of submitting things.
There was a problem hiding this comment.
I think you just need to depend on opencue-outline instead.
It's been a while, I'm not sure which one it was but either considered cueoutline or cuesubmit and found the minimum required dependencies through the method of testing and elimination.
One could also argue that the OpenCue-Blender addon and the cuesubmit plugin are 2 different things
I think I made this design choice because the Blender addon is installed as a .zip, and the files within the OpenCue Blender subdirectory are the source files, which the CI pipeline will use to generate the zip. This makes the addon standalone, for the most part.
There was a problem hiding this comment.
But the OpenCue-Blender addon does not need any of the files in the cuesubmit plugin folder and cuesubmit plugin does not need anything from the OpenCue-Blender addon, right?
IMO, we should have a seperate folder in the root of the repo for DCC plugins/addons.
| The OpenCue Blender addon provides a standalone job submission interface | ||
| from within Blender. This directory consists of the following: | ||
|
|
||
| - addon source code under the `OpenCue` |
There was a problem hiding this comment.
Don't you mean OpenCue-Blender?
There was a problem hiding this comment.
Yes, my bad. Will fix naming references throughout.
| 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 -----") | ||
|
|
There was a problem hiding this comment.
I don't think this will work when it's packaged up as a zip file.
If you need to install the python modules, use the published packages instead.
| 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}" | ||
| } |
There was a problem hiding this comment.
Not sure it's a good idea to copy the modules into the addon. You will want to be able to use the addon with a newer version of opencue, without having to update the addon.
|
@DiegoTavares @lithorus I've linked the Blender addon doc in this PR thread a while back here: #1309 (comment). If the content in the draft is ok, I could make a separate PR for this. |
|
As discussed in the previous TSC meeting, this PR is getting moved to the new repo OpenCue_extensions |
Link the Issue(s) this Pull Request is related to.
#312
Summarize your change.
A standalone Blender addon for submitting OpenCue jobs.