Blender的编译
概述
编译Blender最难的是下载外部lib。如果你按官网使用cmake现在源代码并使用camke update自动下载外部的关联的lib很有情况下,你可能下载会失败或下载不停被中断。报错fatal :clone of https://projects/blender.org/blender/lib-windows_x64.git' ...failed.或者下载速度很慢只有几kBytes/s.所有dll差不多有8个G。不知道下到什么时候。
另一种方法是使用TortoiseSVN客户端进行Check Out。地址为https://svn.blender.org/svnroot/bf-blender/trunk/lib/win64_vc15/ 。记得在CheckOut之前设置下TortoiseSVN。右键文件夹,【TortoiseSVN】|【Setting】面板|【Icon OVerlays】|【Icon OVerlays】面板讲中的【Status cache】中的Default改成None.你的TortoiseSVN速度将从几kb提升到100多kb。快的时候有800多kb.(记住一定要该这个,我开始没改这个,就几kb。)有可能因为超时或连接不上,你需要进入目录右键cleanUp操作,clearUp面板中记得勾上【Break write lock】.然后再执行 Update操作
方案一:使用make update 方式自动检测依赖的lib并下载
1.碰到的问题,执行 make udpate报如下错误
Warning: Python not found, there is likely an issue with the library folder
No explicit msvc version requested, autodetecting version.
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.26
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Compiler Detection successful, detected VS2019
Building blender with VS2019 for x64 in C:\blender36\blender\..\build_windows_x64_vc16_Release
Python not found in external libraries, updating to latest version
fatal: cannot change to 'C:\blender36\blender" submodule update lib/windows_x64': Invalid argument
根据这个连接Make update failing先git pull 再 make update ,但无法解决问题,决定放弃,重新按官方指导再来一遍。
步骤
1.创建存放目录,并clone代码到本地
cd d:\blend36
git clone https://github.com/blender/blender.git
2.切换分支(笔者以3.6版本作为编译代码)
cd cd d:\blend36\blender
git checkout --track origin/blender-v3.6-release
3.自动探测所需依赖库并下载
make update
参考链接
1.官方Windows平台编译指导
2.cmake 编译blender源码_关于blender获取源码的一些坑
3.从源代码编译Blender