0
$\begingroup$

I am currently working on automating a data processing pipeline in Blender using Python scripting. To enhance the automation process, I want to utilize the functionality provided by a Blender addon called Eyek. When working within the Blender IDE, I have no issues accessing and using Eyek's features via scripting, but I have no idea how to incorporate Eyek (or any addon for that matter) into my actual workflow within Visual Studio Code. Ultimately I want to have everything packaged in VScode so that I can run the workflow automatically and without user input.

What steps or configurations are needed to ensure that I can access features from addons while running Blender automation scripts from outside the Blender IDE? Any suggestions or examples would be highly appreciated.

Thank you!

$\endgroup$
3
  • $\begingroup$ Since that's a third-party addon you're going to have to ask the addon's developer directly. We can't help with external addons or with VScode for that matter. $\endgroup$
    – John Eason
    Jul 20, 2023 at 9:45
  • $\begingroup$ @JohnEason I mean, it's applicable to any addon I want to work with, I don't know how to import them into VScode to use, scripting in the Blender IDE just works since the addon already installed there... $\endgroup$
    – Mark
    Jul 20, 2023 at 10:36
  • $\begingroup$ No idea in that case. There are no Blender developers here, nor does anyone here have any association with the Blender Foundation so I'm not sure where you should ask that one. $\endgroup$
    – John Eason
    Jul 20, 2023 at 11:17

2 Answers 2

0
$\begingroup$

If you set your VScode up to work with Blender like this video explains: https://www.youtube.com/watch?v=YUytEtaVrrc then its just like developing within Blender but you get debugging etc. write the code, launch a linked Blender instance, then run the script. Can place breakpoints etc. can also use the debug terminal while a script is stopped to mess about with things.

$\endgroup$
1
  • $\begingroup$ Complicating things, I'm running this all in a container, so it would be best to avoid running an instance of blender live as shown here. Is there no way of modifying addon .py files to import certain functions, or is running blender in the container the only path forward? $\endgroup$
    – Mark
    Jul 21, 2023 at 11:49
0
$\begingroup$

For future reference:

First of all, it ended up not making sense trying to adapt the addon file for direct integration in pure Python. The correct path forward was running Blender in headless mode in VScode, as described in one of the answers here. The difficulty came from installing and running Blender in a docker containers, and also installing an addon in this headless Blender.

The solution was to download the blender-VERSION.VERSION.VERSION-linux-x64.tar.xz distribution of blender and move that file to the same directory as the dockerfile. Then you can install and run it headlessly by calling it in your dockerfile:

COPY blender-3.5.1-linux-x64.tar.xz /tmp/

Then downloading the .zip of the addon you want, and unzipping it. Move the folder of your unzipped addon into the same directory as your dockerfile again, and install it into the addon folder of your newly installed Blender by using:

COPY --chown=$MAMBA_USER:$MAMBA_USER your_unzipped_addon_folder_name /usr/local/blender-3.5.1-linux-x64/3.5/scripts/addons/your_addon

Then you can install it in your main python script:

bpy.ops.preferences.addon_enable(module="your_addon")

And use it in your main script like you would in the Blender IDE. Hope this helps someone!

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .