doc: modify document to mark changes

- add universal encoding infos in documentation.
- bump up version to 4.1 for release.
This commit is contained in:
yyc12345 2024-09-21 23:30:56 +08:00
parent c8d59ef5f4
commit c894d88c54
3 changed files with 21 additions and 15 deletions

View File

@ -6,7 +6,7 @@ schema_version = "1.0.0"
# Example of manifest file for a Blender extension
# Change the values according to your extension
id = "bbp_ng"
version = "4.0.0"
version = "4.1.0"
name = "Ballance Blender Plugin"
tagline = "The specialized add-on served for creating game map of Ballance"
maintainer = "yyc12345 <yyc12321@outlook.com>"

View File

@ -20,15 +20,18 @@ The default values for the options in the Conflict Options section are the solut
It is well known that Virtools uses a system-based multi-byte character encoding to process documents, and is therefore prone to what is known as garbling; Blender itself does not suffer from garbling, however, if we do not read a Virtools document with the correct encoding, the characters stored in it may still appear garbled when the Virtools document is imported into Blender. The Encodings property in the Virtools Params section specifies the encodings for reading Virtools documents. Multiple encodings can be specified, separated by a `;` (semicolon). Some common encodings are listed below:
* 1252 (Windows only): Western European encoding used by Ballance.
* 936 (Windows only): the default encoding for Chinese Windows system.
* CP1252 (non-Windows): Western European encoding used by Ballance.
* CP936 (non-Windows): the default encoding for Chinese Windows system.
* cp1252: Western European encoding used by Ballance.
* gb2312: The default encoding for Chinese Windows system.
The encoding attribute is very important, if you set the wrong encoding, the names of the various objects imported into Blender will be unrecognizable.
The encoding attribute is very important. If the wrong encoding is set, the names of the various objects imported into Blender will be unrecognizable, or will cause the program to make an error.
!!! warning "Encoding is a platform dependent setting"
According to the implementation of LibCmo, the underlying library used by BBP's Virtools documentation for the import module, the encoding attribute is a platform dependent setting. Under Windows, the [Windows Code Page](https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers) number is required here. Under other operating systems, LibCmo uses iconv for character encoding and decoding, so you need to use the legal [Iconv Encoding Identifier](https://www.gnu.org/software/libiconv/).
!!! info "What encodings are available?"
Since BBP version 4.1, the names of the encodings we use are basically just copied from the Python encoding names. Most of the commonly used encoding names in Most of the commonly used encoding names in Python are mapped, with only a few particularly rare encodings unsupported, and for specific supported encodings it is necessary to check the source code. See [Python documentation](https://docs.python.org/3/library/codecs.html#standard-encodings) for information on Python's supported encodings. Encodings are not case-sensitive.
!!! warning "Warning about migration from older versions"
Starting with BBP version 4.1, the version number of LibCmo, the underlying library used by BBP's Virtools document import module, has been bumped to 0.2. Before this version, the encoding attribute was a platform-dependent setting. Under Windows, the [Windows Code Page](https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers) number is required here. Under other operating systems, LibCmo uses iconv for character encoding decoding, so the legal [iconv encoding identifier](hhttps://www.gnu.org/software/libiconv/) is required.
This all changed with LibCmo 0.2, from which LibCmo uses Python-like universal encoding names. It is platform-independent, you no longer need to check whether the operating system you are using is Windows or Linux, the encoded characters are the same string for all platforms. This also means that if you have customized your encoding settings before, you need to be careful to convert them to the new universal encoding name, because the old encoding name may not have a corresponding mapping under the universal encoding name system, for example, `1252` specified on Windows before should be written as `cp1252` under the new universal encoding name, and the original encoding name won't be recognized correctly on the new system.
## Export Virtools File

View File

@ -20,15 +20,18 @@ Conflict Options冲突解决选项章节指示了当导入器遇到物体
众所周知Virtools使用基于系统的多字节字符编码来处理文档因而很容易出现所谓乱码问题。Blender本身不会出现乱码问题然而如果我们不能以正确的编码读取Virtools文档则当Virtools文档被导入Blender时其中存储的字符仍然可能会呈现乱码状态。Virtools ParamsVirtools参数章节的Encodings编码属性用于指定读取Virtools文档的编码。可以指定多个编码多个编码之间用`;`(分号)分隔。下面列出一些常用的编码:
* 1252Windows下Ballance所用的西欧编码
* 936Windows下中文Windows系统默认编码
* CP1252非Windows下Ballance所用的西欧编码
* CP936非Windows下中文默认编码
* cp1252Ballance所用的西欧编码
* gb2312中文Windows系统默认编码
编码属性非常重要如果设置了错误的编码导入Blender的各类物体的名称会出现不可认知的情况。
编码属性非常重要如果设置了错误的编码导入Blender的各类物体的名称会出现不可认知的情况又或者会导致程序出错。
!!! warning "编码是一个平台相关的设定"
根据BBP的Virtools文档导入模块使用的底层库LibCmo的实现编码属性是一个平台相关的设定。在Windows下这里需要填写的是[Windows代码页](https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers)数字。而在其它操作系统下LibCmo使用iconv进行字符编码解码因此需要使用合法的[iconv编码标识符](https://www.gnu.org/software/libiconv/)。
!!! info "有哪些编码可以使用?"
自BBP 4.1版本后我们使用编码的名字基本上就是照抄Python的编码名。大多数Python中常用的编码名都有映射只有一些特别罕见的编码没有支持对于具体支持的编码则需要查看源码。有关Python支持的编码请查看[Python相关文档](https://docs.python.org/3/library/codecs.html#standard-encodings)。编码名不区分大小写。
!!! warning "从旧版本迁移的警告"
自BBP 4.1版本开始BBP的Virtools文档导入模块使用的底层库LibCmo版本号提升为0.2。在此版本前编码属性是一个平台相关的设定。在Windows下这里需要填写的是[Windows代码页](https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers)数字。而在其它操作系统下LibCmo使用iconv进行字符编码解码因此需要使用合法的[iconv编码标识符](https://www.gnu.org/software/libiconv/)。
这一切在LibCmo 0.2后发生了改变从这个版本开始LibCmo采用了类似Python的统一编码名。它是平台无关的你不再需要检查你正在使用的操作系统是Windows还是Linux所有平台的编码字符均为相同的字符串。这也就意味着如果您之前自定义过编码设置你需要注意将他们转换到新的统一编码名因为旧的编码名可能在统一编码名下没有对应映射例如之前在Windows上指定的`1252`,在新的统一编码名下应当被书写为`cp1252`,原编码在新系统下无法被正确识别。
## 导出Virtools文档