Tag: python

Execute Python Script from Photoshop

In this post we explore two ways to run a python script from Photoshop providing arguments (like the Photoshop file name). Those simple scripts helped us create complex behaviours to process results of Photoshop scripts for the Set department of the feature film Dilili in Paris or in our recent project for the Lodève Museum. The background artists could work in Photoshop and start those procedures without exciting software. Using such scripts to push previews to the production manager software, moving files, starting a blender playblast to get a preview of the updated scene, etc. Saving a lot of time.

How to install python libs in Blender (part 1)

EDIT 2020: This series is now obsolete since Blender 2.80. Please see this answer on StackExchange. Here is a possible function to install modules inside Blender, provided you can modify the Blender directory:

import subprocess

def install_pip_dep(module_name):
    python_path = bpy.app.binary_path_python
    subp = subprocess.run([python_path, "-m", "ensurepip"])
    if subp.returncode != 0:
        return False
    subp = subprocess.run([python_path, "-m", "pip", "install", module_name])
    if subp.returncode != 0:
        return False
    return True

if __name__ == '__main__':
    install_pip_dep("triangle")

In this article, we share some tips to install third-party python libraries for your scripts and add-ons. This is the easy way, when the library exists on repositories accessible to package managers such as pip.