Skip to content

Instantly share code, notes, and snippets.

@orklann
Forked from xunkai55/setup_bpy.sh
Created July 25, 2018 09:23
Show Gist options
  • Save orklann/9479f46e8dd3de2ad09781f3ac82b2f0 to your computer and use it in GitHub Desktop.
Save orklann/9479f46e8dd3de2ad09781f3ac82b2f0 to your computer and use it in GitHub Desktop.
Setup bpy (Blender as a python module) on Mac OS X
# Do not excute the script directly. It is just for demonstration.
# If you followed the documentation and got the errors below, please take a look at this guide.
# Color management: using fallback mode for management
# bpy: couldnt find 'scripts/modules', blender probably wont start.
# Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.
# ImportError: No module named 'bpy_types'
# ImportError: No module named 'bpy_types'
# pyrna_srna_ExternalType: failed to find 'bpy_types' module
# ImportError: No module named 'bpy_types'
# ImportError: No module named 'bpy_types'
# pyrna_srna_ExternalType: failed to find 'bpy_types' module
# ImportError: No module named 'bpy_types'
# pyrna_srna_ExternalType: failed to find 'bpy_types' module
# F0102 21:06:58.742173 1895752448 utilities.cc:322] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!
# "
# Firstly, download the source and excute "make bpy" things.
cd $THE_FOLDER_YOU_BUILD/bin
# Now you should find bpy.so and 2.xx directory here.
# If you type python3 and `import bpy` here, you would get the error messages above.
# Don't worry.
mkdir ../Resources
mv 2.78 ../Resources/
# Change the version number if is out of date.
# Try the test script. It could be good now.
python3 -c "import bpy ; bpy.ops.render.render(write_still=True)"
# Of course, if you want to setup bpy in somewhere else,
# you have to do something just like `mkdir ../Resources; mv 2.78 ../Resources`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment