-
Notifications
You must be signed in to change notification settings - Fork 232
[plugin] Draft: Develop Blender plugin #1309
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
base: master
Are you sure you want to change the base?
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
…/OpenCue into blender-addon-dev
Edits config file and restart container
Adds tag to Blender RQD container
…/OpenCue into blender-addon-dev
…/OpenCue into blender-addon-dev
…/OpenCue into blender-addon-dev
…/OpenCue into blender-addon-dev
Associated with ci/fix_compiled_proto.py
…/OpenCue into fix-integration-test-script
Render without using .blend file
…/OpenCue into blender-addon-dev
ci/run_integration_test.sh
Outdated
|
|
||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an accidental change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use platform.system() to get the correct OS similar to the way rqmachine.py does it.
|
|
||
| bl_info = { | ||
| "name": "OpenCue", | ||
| "author": "Nuwan Jayawardene", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid authors on the source file. If a author field is require, please use Academy Software Foundation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you just need to depend on opencue-outline instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you mean OpenCue-Blender?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Link the Issue(s) this Pull Request is related to.
#312
Summarize your change.
A standalone Blender addon for submitting OpenCue jobs.