Package: kabaret.blender-session
kabaret.blender_sessionKabaret integration into blender GUIWith kabaret, you design your pipelines/workflows and your users will access them using the standalone GUI provided by the Qt basedKabaretStandaloneGUISession.When your workflows use Qt based DCCs like Maya, Nuke, Houdini, ... you can use theKabaretEmbeddedGUISessionto 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:SynopsisWhen running Blender from your flow, you will set theBLENDER_USER_SCRIPTSenv var to the result ofkabaret.blender_session.get_blender_startup_dir().
This will letkabaret.blender_sessionconfigure 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 theObjectpointed to by theKABARET_SESSION_HOMEenv var. This Panel will let you navigate the whole Objet tree (but not its parent or sibblings), changeParamvalues, and triggerAction. Pretty much like theKabaretEmbeddedGUISessiondoes (with limited ui configuration support though).Add all sites listed in theBLENDER_EXTRA_SITESenv 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 theBLENDER_EXTRA_SCRIPTSenv var (";" separated list) as if they were set asBLENDER_SCRIPTWith this set up, you will be able to control blender from your flowAction.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 theBLENDER_EXTRA_SITESand/or to theBLENDER_EXTRA_SCRIPTSenv var.We recommend using thekabaret.subprocess_managerpackage 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.AdvancedCustom SessionAs wiht all kabaret sessions, you can use extensions to add views and actors to theBlenderEmbeddedSession.If you do so,kabaret.blender_sessionneeds to use your session class instead of the default one. TheKABARET_BLENDER_SESSION_TYPEenv var can be used to provide the full qualified class name of you session class (for examplemy_studio.blender_session.MyBlenderSession).Note that your session constructorMUSTmatch 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 thekabaret discordif you absolutly need this now.)Flow Code SharingAs 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 thekabaret discord;)