This is the documentation explaining how bpy
should be built.
I think it is outdated, for the following reasons:
It does not mention that
make
provides a convenience target calledbpy
, which sets the build variables automatically as recommended by the documentation (blender\build_files\cmake\config\bpy_module.cmake
).It recommends that once building is complete, the following instructions be run:
copy bin\bpy.pyd C:\Python37\Lib\site-packages\
copy bin\*.dll C:\Python37\Lib\site-packages\
del C:\Python37\Lib\site-packages\python37.dll
xcopy /E bin\2.81 C:\Python37\
A minor issue with the above instructions is that it seems to have the file structure of the build output wrong. In my case, I have bin\Releases\bpy.pyd
etc., not bin\bpy.d
.
A possibly minor issue is that it while it recommends deteting the copied over python37.dll
(or alternatively, not copying it over in the first place), it does not recommend deleting python3.dll
.
A major issue is that placing the folders under \bin\Releases\2.xy
directly in the Python37
seems to not work, because running import bpy
produces the following errors:
Color management: using fallback mode for management
Color management: Error could not find role data role.
Color management: scene view "Filmic" not found, setting default "Standard".
blf_load_font_default: 'fonts' data path not found for 'droidsans.ttf', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'bmonofont-i18n.ttf', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'bmonofont-i18n.ttf', will not be able to display text
bpy: couldn't find 'scripts/modules', blender probably wont start.
Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\bhmer\blender-git\blender\source\blender\python\intern\bpy_rna.c:7263 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\bhmer\blender-git\blender\source\blender\python\intern\bpy_rna.c:7263 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\bhmer\blender-git\blender\source\blender\python\intern\bpy_rna.c:7263 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\bhmer\blender-git\blender\source\blender\python\intern\bpy_rna.c:7263 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\bhmer\blender-git\blender\source\blender\python\intern\bpy_rna.c:7263 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\bhmer\blender-git\blender\source\blender\python\intern\bpy_rna.c:7263 pyrna_srna_ExternalType: failed to find 'bpy_types' module
F0718 15:21:13.967409 3600 utilities.cc:346] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!
*** Check failure stack trace: ***
@ 00007FFA676DF6DB google::LogMessage::Flush
@ 00007FFA676DED29 google::LogMessageFatal::~LogMessageFatal
@ 00007FFA676E3683 google::glog_internal_namespace_::InitGoogleLoggingUtilities
@ 00007FFA6737079B libmv_initLogging
@ 00007FFA669D6ED7 main_python_enter
@ 00007FFA66E98134 dealloc_obj_dealloc
@ 00007FFA88723B4A PyDict_SetItem
@ 00007FFA88717A9B PyModule_AddObject
@ 00007FFA88733D30 _PyType_Name
@ 00007FFA88733B97 _PyType_Name
@ 00007FFA88733AFD _PyType_Name
@ 00007FFA8870B7E0 _PyMethodDef_RawFastCallDict
@ 00007FFA88708E12 PyObject_SetAttr
@ 00007FFA887266C5 _PyEval_EvalFrameDefault
@ 00007FFA8870CDB6 _PyEval_EvalCodeWithName
@ 00007FFA887253EC _PyMethodDef_RawFastCallKeywords
@ 00007FFA88725E02 _PyEval_EvalFrameDefault
@ 00007FFA887252D3 _PyMethodDef_RawFastCallKeywords
@ 00007FFA88725953 _PyEval_EvalFrameDefault
@ 00007FFA887252D3 _PyMethodDef_RawFastCallKeywords
@ 00007FFA887259FF _PyEval_EvalFrameDefault
@ 00007FFA887252D3 _PyMethodDef_RawFastCallKeywords
@ 00007FFA887259FF _PyEval_EvalFrameDefault
@ 00007FFA887252D3 _PyMethodDef_RawFastCallKeywords
@ 00007FFA887259FF _PyEval_EvalFrameDefault
@ 00007FFA8870C95D _PyFunction_FastCallDict
@ 00007FFA8871569F _PyObject_CallMethodIdObjArgs
@ 00007FFA88715565 _PyObject_CallMethodIdObjArgs
@ 00007FFA88731B82 _PyBuiltin_Init
@ 00007FFA887153A7 PyImport_ImportModuleLevelObject
@ 00007FFA886F12AB PyImport_ImportModuleLevel
@ 00007FFA66E9A170 BPy_init_modules
The initial complaints refer to not being able to find things that are in the datafiles
and scripts
sub-folders of bin\Release\2.xy\
. So, I think that means that these folders are not placed correctly in the Python37
directory?
Am I interpreting the error messages correctly, and if so, where should I place the datafiles
and scripts
directories output by building Blender for a standalone bpy
module?
make install
blender.stackexchange.com/… $\endgroup$