BlenderCN论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1988|回复: 17

Blender开发常见问题-blender dev FAQ

[复制链接]
发表于 2015-5-14 22:35:27 | 显示全部楼层 |阅读模式
  1. [url=http://wiki.blender.org/index.php/Dev:Doc/FAQ]问答[/url]
复制代码
原文在这里。逐渐翻译
请勿跟帖
 楼主| 发表于 2015-5-14 22:40:59 | 显示全部楼层
Blender是由什么程序语言写的?
最简短的回答是:C/C++/Python.
     C -  blender的核心和多数的内部功能,工具,和编辑器
    C++ - 窗口关了,物理系统,声音,游戏引擎,cycles渲染引擎
    Python - 界面配置定义,插件,多数数据格式的导入/导出和一些工具
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:37:56 | 显示全部楼层
Blender的开发都是用什么样的编辑器或者集成开发环境?

使用CMake生成的Blender项目工程文件,集成开发环境可以很好适配的有:

    OSX的XCode  
    Windows的MSVC 2013
    Eclipse 多平台
    QtCreator  多平台
    Netbeans 多平台

一些开发用到比如 vim, emacs, geany, notepad++ 和scite 这样的编辑器

注意可能做 C/C++ 和 Python 代码的时候用的编辑器或者集成开发环境有所不同。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:41:01 | 显示全部楼层
哪里才是正确的提交Blender特性需求的地方?

潜在加入Blender的特性实在是太多而难以有效管理这些需求。所以我们并不支持特性需求的提交。

如果特性需求非常小,比如一个已经存在的工具的一个选项的话,你可以尝试去联系该工具的开发或者这个模块的维护者。请查看模块拥有者。

如果你的建议需要大改动,请先把这块建议放到邮件列表的 bf-funboard 列表中再获得反馈。请看  bf-funboard 邮件列表。

Where is the right place to request features in blender?

There are so many possible features to add to blender that its difficult to manage them usefully so we don't accept feature requests on our tracker as some projects do.

If the feature requests are small, like an option to an existing tool you could try to contact the developer of that tool, or at least the maintainer.
See Module Owners

If you're suggestion is a larger change, try make this a suggestion on bf-funboard and use this to get feedback,
See bf-funboard mailing list
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:41:11 | 显示全部楼层
Why did my Blender compile fail?

There may be many reason why it failed, but here are some common causes. Also remember to look for the first error that is printed, as this is usually the root cause, further errors may only be a result of this.
File not found or Unresolved Symbols

This usually means a library was not installed, not configured in the build system, or the wrong version of the library was used. Also make sure to download the lib/ folder on Window and Mac, and to install the needed development packages on windows. It's also possible to disable certain libraries when building Blender to avoid the issue. See the Building Blender documentation for details on dependencies.
Blenderplayer failed to compile due to missing functions

Many developers don't compile the blenderplayer, so don't notice this - if it happens grep the source, find the function prototype and copy and paste the function prototype in the stubs.c file with the appropriate NULL or 0 return. If a struct is return you should cast NULL to the appropriate struct type
DNA compile errors

Usually this means you added something to a struct in a header file and forgot to adjust the amount of padding in the struct. Blender requires that the structs be multiples of 8, see the SDNA Notes for more detail. So if you add a short, and there is a char pad[1]; you change it to char pad[7], to keep it a multiple of eight. Of course if you forget the rules just keep adding a char pad till it compiles without errors (which is what you will do if it compiles in your 32 bit machine and others say it is failing in their 64 bit ones... save some time and read the rules instead, alignment matters too, no matter how much padding you add).
RNA compile errors

This usually means the wrong DNA struct type or property name was specified.
Missing Interface Buttons and Menus

Usually this means you added something to the user interface python code and made a mistake. Check the console for errors, often this is because of mixing tabs and spaces. All python scripts in Blender uses spaces for indentation.
Menu or checkbox defaults to the wrong value

Make sure you added a default value in the function that creates the struct, and that you create a version patch in do_versions in readfile.c to initialize values on existing structs.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:41:19 | 显示全部楼层
Why did my Blender compile with warnings?

While Blender can compile warning-free on some platforms/configurations, some warnings persist and can't simply be "fixed" or supressed.

If you see warnings while compiling, you can assume Blender developers are aware of them and they're almost certainly false-positves, or at least not causing real-world problems.

(This goes for static analysis tools too).

However this doesn't mean you should ignore warnings completely, For code you write, check warnings carefully and resolve them where appropriate (fix/supress).
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:41:29 | 显示全部楼层
Whats the situation with automated testing?

Testing in Blender is a work in progress, and while we aren't anywhere near full coverage, we have tests for:

    Python: some basic tests exist already in: source/tests/.
    GTest: tests for C/C++ code.
    CTest (from CMake), can be used to call the tests above.

See the project-page: Automated Testing
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:41:37 | 显示全部楼层
How Does Blender Deal with Security?

Blender does not attempt to achieve the same level of security as many other applications (web browsers for example),

The ability to have blend files that execute bundled Python scripts does pose a security risk if you don't know who created the file.

The Trusted Source option has been added to the file so you can load a blend file without running scripts as a precaution to simple attacks.

However this is no protection against more advanced exploits such as hand crafting a blend file which uses buffer overflows to run malicious code.

For more discussion on this topic:

    http://lists.blender.org/piperma ... 13-June/040502.html 2013, Jun 4
    http://lists.blender.org/piperma ... 0-April/027216.html 2010, Apr 28
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:41:47 | 显示全部楼层
Why C/C++/Python?

Part of it is historic, part of it is convention and choice of the current developers.

Early on when Blender was developed, (1990's), C was very common for developing graphics applications (C++ compilers were expensive, where C compilers were free).

Python was selected because of its great community.

Nowadays Blenders core is still in C, some libraries are in C++, and OSX integration even uses Objective-C, Scripting is done in Python.

Currently this works fairly well and we don't have plans to rewrite large parts of Blender in some other languages.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-5-16 12:41:54 | 显示全部楼层
Source Code FAQ
How do I build Blender?

Follow the excellent instructions on Devoc/Building_Blender.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

Blender最新中文教学视频|Blender头条|小黑屋|手机版|Archiver|Blender中国 ( 蜀ICP备17002929号 )360网站安全检测平台

GMT+8, 2019-6-17 15:44 , Processed in 0.015247 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表