Adapt to blender5.0#118
Open
mayloglog wants to merge 34 commits into
Open
Conversation
By removing functions that are not supported by blender 4.4, the plugin can be adapted to blender 4.4.
XNALaraMesh-blender4.4
**Performance Optimization:** Upgraded the method for importing UV and vertex color data to use **`foreach_set` for batch assignment**, resulting in a significant performance boost for large models. **性能优化:** 升级了 UV 和顶点颜色的数据导入方式,改用 **`foreach_set` 批量赋值**,显著提升了导入大型模型的性能。
We have switched the default export format to ASCII and disabled the binary XPS option due to persistent compatibility bugs. ASCII is highly reliable and should work seamlessly for everyone. I am still working on my technical skills and haven't found a permanent fix for the binary issue yet—if anyone in the community can help, I would greatly appreciate a code submission on GitHub. Thanks for sticking with me!
OBJ export function refactored to use Blender's official C++ OBJ exporter, significantly improving compatibility and stability Support for exporting XPS format bone data (.arl files) Support for adding bw and vc lines in OBJ files to store vertex bone weight information and vertex colors
Completely resolved the RuntimeError caused by illegal operations on armature.data.collections in EDIT mode, which previously caused significant slowdowns in import speed.
## 问题分析 在 import_xnalara_model.py 中,当启用 joinMeshRips 选项时,顶点会根据坐标和法线进行合并。但代码存在一个关键错误: 1. 顶点合并过程 : processVertices 函数生成了 vertexDict (原始索引→合并后索引的映射)和 mergedVertexList (合并后的顶点列表) 2. 网格创建 :使用 mergedVertexList 创建 Blender 网格,所以 Blender 中的顶点索引是合并后的索引 3. 权重分配 : makeVertexGroups 函数被调用时传入的是 原始 顶点列表 meshInfo.vertices ,导致权重被分配到错误的顶点上 ## 修复方案 修改了两个函数: 1. setupMaterialAndRigging :添加了 mergedVertexList 参数,并传递给 makeVertexGroups 2. importMesh :调用 setupMaterialAndRigging 时传入 mergedVertexList 这样权重就会正确地分配到合并后的顶点上,修复了权重结果不正确的问题。 修复涉及的文件: - import_xnalara_model.py:591 - 修改函数签名 - import_xnalara_model.py:625 - 更新函数调用
* AI修复权重错误问题 ## 问题分析 在 import_xnalara_model.py 中,当启用 joinMeshRips 选项时,顶点会根据坐标和法线进行合并。但代码存在一个关键错误: 1. 顶点合并过程 : processVertices 函数生成了 vertexDict (原始索引→合并后索引的映射)和 mergedVertexList (合并后的顶点列表) 2. 网格创建 :使用 mergedVertexList 创建 Blender 网格,所以 Blender 中的顶点索引是合并后的索引 3. 权重分配 : makeVertexGroups 函数被调用时传入的是 原始 顶点列表 meshInfo.vertices ,导致权重被分配到错误的顶点上 ## 修复方案 修改了两个函数: 1. setupMaterialAndRigging :添加了 mergedVertexList 参数,并传递给 makeVertexGroups 2. importMesh :调用 setupMaterialAndRigging 时传入 mergedVertexList 这样权重就会正确地分配到合并后的顶点上,修复了权重结果不正确的问题。 修复涉及的文件: - import_xnalara_model.py:591 - 修改函数签名 - import_xnalara_model.py:625 - 更新函数调用 * 修复闭合问题
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.