Skip to main content

A Kabaret session usable in blender to have a Flow view in 3D view tools.

Project description

kabaret.blender_session

Code style: black

Kabaret integration into blender GUI

With kabaret, you design your pipelines/workflows and your users will access them using the standalone GUI provided by the Qt based KabaretStandaloneGUISession.

When your workflows use Qt based DCCs like Maya, Nuke, Houdini, ... you can use the KabaretEmbeddedGUISession to integrate all or parts of your flow into those DCCs.

Blender GUI isn't Qt based so you need another option, which this package provides: BlenderEmbeddedSession.

Here is an example of parameter, groups and actions defined in a flow and usable inside Blender:

Example Embedded Flow

Synopsis

When running Blender from your flow, you will set the BLENDER_USER_SCRIPTS env var to the result of kabaret.blender_session.get_blender_startup_dir(). This will let kabaret.blender_session configure your blender on startup so that it:

  • Shows a "Kabaret" tab on the 3D View UI with a "Flow Tools" panel showing the kabaret flow page of the Object pointed to by the KABARET_SESSION_HOME env var. This Panel will let you navigate the whole Objet tree (but not its parent or sibblings), change Param values, and trigger Action. Pretty much like the KabaretEmbeddedGUISession does (with limited ui configuration support though).
  • Add all sites listed in the BLENDER_EXTRA_SITES env var (";" separated list). This is usefull to access packages from virtual envs and other site-packages style path where you need to support .pth files for example.
  • Consider all paths listed in the BLENDER_EXTRA_SCRIPTS env var (";" separated list) as if they were set as BLENDER_SCRIPT

With this set up, you will be able to control blender from your flow Action.

In order for this to work, your flow code must be accessible from within blender. Depending on your setup, you will need to add one or more paths to the BLENDER_EXTRA_SITES and/or to the BLENDER_EXTRA_SCRIPTS env var.

We recommend using the kabaret.subprocess_manager package to run Blender from your flow.

Note that a more complete env vars system and a strategy for addons accessibility/activation is on the roadmap.

Advanced

Custom Session

As wiht all kabaret sessions, you can use extensions to add views and actors to the BlenderEmbeddedSession.

If you do so, kabaret.blender_session needs to use your session class instead of the default one. The KABARET_BLENDER_SESSION_TYPE env var can be used to provide the full qualified class name of you session class (for example my_studio.blender_session.MyBlenderSession).

Note that your session constructor MUST match the default session constructor. If you need to configure your session creation, we recommend using env vars to do so.

/!\ CUSTOM SESSION TYPE IS NOT IMPLEMENTED YET /!\

(Tell us on the kabaret discord if you absolutly need this now.)

Flow Code Sharing

As for any embedded session, your goal is to share your flow code between the python interpretor used for your standalone session and the one embedded in the DCC. One classic strategy is to have you python interpretor version match the one in your dcc (the "match" here is a loosy define concept ^^).

While this is easy to setup, it has a very limited strength and will limit the list of DCCs supported by your pipelines/workflows.

The pythonic approach is to install your flow and all its dependencies inside a virtual env specific for each interpretor / DCC / release / etc...

This setup sounds complicated but it is not, provided you properly package your code (with a proper setup.py for example). How to do so is out of kabaret studio scope, but we strongly encourage doing so and we can help you embrace the python packaging ecosystem. Feel free to ask for help on the kabaret discord ;)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kabaret.blender_session-0.0.17.tar.gz (31.8 kB view details)

Uploaded Source

File details

Details for the file kabaret.blender_session-0.0.17.tar.gz.

File metadata

  • Download URL: kabaret.blender_session-0.0.17.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for kabaret.blender_session-0.0.17.tar.gz
Algorithm Hash digest
SHA256 31e3da67a3a0ddb4ecb947a86ab33d4dd58e4ec28fb7c5a37ea42eb45bfdcf7a
MD5 39b9c1f15b3457ef68283533ae6bb48f
BLAKE2b-256 52607b1b9e6502a342c9f87a3b036ce89adc2c1035605d7c882f33fa857291b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page