Skip to content

Conversation

@n-jay
Copy link
Contributor

@n-jay n-jay commented Jul 30, 2023

Link the Issue(s) this Pull Request is related to.
#312

Summarize your change.
A standalone Blender addon for submitting OpenCue jobs.

n-jay added 30 commits February 10, 2023 15:20
Include initial UI and organization metadata
Checks if dependencies were installed during first install of addon
For copying OpenCue dependencies for local Git repo
To avoid ModuleNotFoundException in first install
Resolve error when extracting data from 'cmd' dictionary inside layerData
Deletes opencue module when unregistering addon
In addon settings section
Will be addressed as system environment variable
Remove extra lines, comments and unused imports
Edits config file and restart container
Adds tag to Blender RQD container
Associated with ci/fix_compiled_proto.py
Render without using .blend file
@n-jay n-jay changed the title Draft: Develop Blender addon [plugin] Draft: Develop Blender plugin Nov 18, 2024

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"
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Comment on lines +288 to +305
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
Copy link
Collaborator

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.

Comment on lines +38 to +50
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"
Copy link
Collaborator

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",
Copy link
Collaborator

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

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@n-jay n-jay mentioned this pull request Sep 20, 2025
Copy link
Collaborator

@lithorus lithorus Sep 22, 2025

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

Copy link
Collaborator

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.

Copy link
Contributor Author

@n-jay n-jay Sep 22, 2025

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?

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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`
Copy link
Collaborator

@lithorus lithorus Sep 22, 2025

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?

Copy link
Contributor Author

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.

Comment on lines +103 to +110
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 -----")

Copy link
Collaborator

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.

Comment on lines +36 to +42
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}"
}
Copy link
Collaborator

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.

@n-jay
Copy link
Contributor Author

n-jay commented Oct 9, 2025

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants