【Blender源代码观察】了解模块的大致分类

目标

在上一篇博客《从源代码编译Blender》中我成功地建立起了一个可以编译Blender源代码的VS工程。

从VS的“解决方案资源管理”中可以看到,其中有很多“项目”:
在这里插入图片描述
每一个“项目”都对应一个vcxproj文件,可以看作是一个模块

而这样的模块 又被放在了若干“文件夹”(filter)中。这可以看作是若干分类

本篇的目标是:

  • 根据官方文档的说明,简单了解模块的大致分类

参考文档:

模块分类

“分类”的层级关系以及它所包含的模块数量如下:

21
15
22
22
44
4
5
Blender.sln
CMakePredefinedTargets
extern
intern
source
其他模块
ALL_BUILD
INSTALL
PACKAGE
RUN_TESTS
ZERO_CHECK
draco
draco
extern_XXX
cycles
bf_intern_cycles
bf_intern_XXX
blender
editors
imbuf
io
makesdna
makesrna
python
bf_XXX
bf_editor_XXX
bf_imbuf_XXX
bf_alembic
bf_avi
bf_collada
bf_io_common
bf_usd
bf_dna
bf_dna_blenlib
bf_rna
bf_python_XXX

其中:

  • 最上面的CMakePredefinedTargets中应该是为编译所服务的一些内容。
  • 最下面的“其他模块”暂时还不了解。只知道其中的blender.vcxproj是当前的“启动项目”。(我猜测这一部分属于偏上层的模块)
  • 因此,重点是中间三个大分类:externinternsource

extern(External Library Code,外部库)

This directory contains source-code imported from other projects and not apart of Blender (strictly speaking).
Each library is stand-alone and typically included because they aren’t common system libraries we can rely on the system providing (such as libjpeg, zlib and libc).

这里面包含了从其他项目导入的源文件,严格意义上讲并不属于Blender。

每一个库都是独立的。导入它们是因为他们并不是系统常见的库,对于系统常见的库我们可以依赖系统所提供(如libjpegzliblibc

intern(Internal Library Code,内部库)

This directory contains source-code maintained by Blender developers but kept as isolated modules/libraries.
Some of these modules are C-API’s to libraries written in C++, since much of Blender’s core is written in C and can’t call into C++ code directly.

这里面的源代码是Blender开发者维护的,但是保持为独立的模块/库。

有些库是用C++写的,但是导出了C形式的接口。因为Blender的核心是用C写的,不能直接调用C++的代码。

source(Application Code,应用层)

Main source code directory for code maintained by Blender developers.

Blender开发者所维护的主要源代码目录

在其下有:

editors

Graphical editor code, tools, UI … (most of the interesting code is in there)

编辑器界面的代码,工具,UI等。大多数有趣的代码都在这里

imbuf

Image buffer API and functions (loading, writing and manipulating different image formats); seq just has it’s own buffer structure, but the loading is still done by imbuf; imbuf also has code for loading textures into openGL for display and all that

图像缓冲API和函数(读取,写入,操作不同的图像格式)。seq just has it’s own buffer structure,但是“读取”仍然由imbuf完成; imbuf还具有用于将纹理加载到openGL中进行显示的代码

io

看起来是一些3D格式的输入输出:
在这里插入图片描述

makesdna

DNA structures definition: All data structures that are saved into files are here

DNA结构体定义。保存到文件中的所有数据结构都在这里。

makesrna

RNA definitions and functions. Sits on top of DNA to provide a low level data access and definition API

RNA定义和函数。在DNA之上,提供底层数据的访问和API定义。

python

Python API, source files that embed the Python scripting language into Blender, as well as the API’s Blender exposes which are written in C.
See: Python API Reference.

将Python脚本嵌入到Blender中的源代码,和一些Blender中用C写的暴露为Python的接口。

详见 Python API Reference

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值