Skip to content

Commit b00cd28

Browse files
committed
Fixed import model surface error.
1 parent 9323072 commit b00cd28

File tree

20 files changed

+40
-35
lines changed

20 files changed

+40
-35
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
/release
2+
3+
sdk_r20/frameworks/
4+
sdk_s22/frameworks/
5+
sdk_r21/frameworks/
6+
sdk_r23/frameworks/
7+
sdk_s24/frameworks/
8+
sdk_r25/frameworks/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,12 @@ If there is a problem with selecting multiple-parts when the model is imported,
350350
4. Optimize import speed and stability.
351351
5. Fixed import normal inversion problem for versions below R23.
352352

353+
**version 0.4.5.1** Fixed import model surface error.
354+
353355
## Author
354356

355357
AiMiDi
356358

357359
[![](https://img.shields.io/badge/-@AiMiDi-%23181717?style=flat-square&logo=github)](https://github.com/AiMiDi)
358360

359-
[![](https://img.shields.io/badge/-%40艾米蒂aimidi-blue?style=flat-square&logo=bilibili)](https://space.bilibili.com/30898053)
361+
[![](https://img.shields.io/badge/-%40艾米蒂aimidi-blue?style=flat-square&logo=bilibili)](https://space.bilibili.com/30898053)

README_zh.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ Cinema 4D的mmdtool。
364364
4. 优化导入速度,稳定性。
365365
5. 修复R23以下版本导入法线反转问题。
366366

367+
**version 0.4.5.1** 修复导入模型面错误的问题。
368+
367369
## 作者
368370

369371
AiMiDi

sdk_r20/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
frameworks/
21
## Ignore Visual Studio temporary files, build results, and
32
## files generated by popular Visual Studio add-ons.
43
##

sdk_r21/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
frameworks/
21
## Ignore Visual Studio temporary files, build results, and
32
## files generated by popular Visual Studio add-ons.
43
##

sdk_r23/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
frameworks/
21
## Ignore Visual Studio temporary files, build results, and
32
## files generated by popular Visual Studio add-ons.
43
##

sdk_r25/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
frameworks/
21
## Ignore Visual Studio temporary files, build results, and
32
## files generated by popular Visual Studio add-ons.
43
##
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
#include "maxon/ioconnection.h"
2+
#include "maxon/iostreams.h"
13
#include "maxon/datetime.h"
24
#include "maxon/iobrowse.h"
3-
#include "maxon/iostreams.h"
4-
#include "maxon/ioconnection.h"
55
#include "maxon/url.h"
Binary file not shown.

sdk_r25/plugins/mmdtool/mmdtool.xdl64

-7.62 MB
Binary file not shown.

sdk_r25/plugins/mmdtool/mmdtool.xdl64.manifest

Lines changed: 0 additions & 2 deletions
This file was deleted.

sdk_r25/plugins/mmdtool/res/c4d_symbols.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ enum
3333
IDS_MES_CONFIRM_DELETE_FILE,
3434
IDS_MES_CANNOT_DELETE_DEFAULT,
3535

36+
IDS_MES_IMPORT_MOD_OK,
37+
IDS_MES_IMPORT_MOD_INFO_A,
38+
IDS_MES_IMPORT_MOD_INFO_B,
39+
3640
IDS_MES_BONE_MORPH_DELETE,
3741
IDS_MES_DELETE_ALL_ANIM,
3842
IDS_MES_DELETE_BONE_ANIM,

sdk_r25/plugins/mmdtool/res/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ PMX_MOD_IMPORT_WEIGHTS: true
3030
PMX_MOD_IMPORT_IK: true
3131
PMX_MOD_IMPORT_INHERIT: true
3232
PMX_MOD_IMPORT_EXPRESSION: true
33-
PMX_MOD_IMPORT_MULTIPART: false
33+
PMX_MOD_IMPORT_MULTIPART: true
3434
PMX_MOD_IMPORT_ENGLISH: false
3535
PMX_MOD_IMPORT_ENGLISH_CHECK: false

sdk_r25/plugins/mmdtool/res/description/TMMDBone.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
enum
55
{
66
PMX_BONE_INFO_GRP = 10000,
7-
PMX_BONE_INDEX_TEXT,
87
PMX_BONE_INDEX,
98
PMX_BONE_NAME_LOCAL,//骨骼本地名称
109
PMX_BONE_NAME_UNIVERSAL,//骨骼通用名称
@@ -64,6 +63,8 @@ enum
6463
PMX_BONE_MORPH_ADD_NAME,
6564
PMX_BONE_MORPH_ADD_BUTTON,
6665

66+
PMX_BONE_INDEX_TEXT,
67+
6768
PMX_BONE_TAG_XCURVE = 0,
6869
PMX_BONE_TAG_YCURVE = 1,
6970
PMX_BONE_TAG_ZCURVE = 2,
@@ -73,8 +74,8 @@ enum
7374
PMX_BONE_NAME_IS_LOCAL = 0,//骨骼使用本地名称
7475
PMX_BONE_NAME_IS_UNIVERSAL = 1,//骨骼使用通用名称
7576

76-
PMX_BONE_TAIL_IS_INDEX = 0,//是连接子骨骼
77-
PMX_BONE_TAIL_IS_POSITION = 1,//是连接相对位置
77+
PMX_BONE_TAIL_IS_POSITION = 0,//是连接子骨骼
78+
PMX_BONE_TAIL_IS_INDEX = 1,//是连接相对位置
7879

7980
};
8081
#endif _PMX_BONE_TAG_H_

sdk_r25/plugins/mmdtool/res/strings_en-US/c4d_strings.str

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ STRINGTABLE
88
IDS_MES_SELECT_ERR "Please select an object";
99

1010
IDS_MES_IMPORT_ERR "Import failed:";
11-
IDS_MES_IMPORT_TYPE_ERR "File is not a vmd file";
11+
IDS_MES_IMPORT_TYPE_ERR "File is not a # file";
1212
IDS_MES_IMPORT_READ_ERR "Cannot read file";
1313
IDS_MES_IMPORT_CAM_ERR "It's not a camera VMD file";
1414
IDS_MES_IMPORT_MOD_ERR "It's not a model VMD file";
@@ -23,14 +23,18 @@ STRINGTABLE
2323
IDS_MES_CONVER_ERR "Conversion failed:";
2424
IDS_MES_CONVER_TYPE_ERR "The selected object is not a camera.";
2525

26-
IDS_MES_IMPORT_MOT_OK "Successfully imported # bone's and # morph's # Frame(s) at # ms!";
26+
IDS_MES_IMPORT_MOT_OK "Successfully imported animation: # bone's and # morph's # Frame(s) at # ms!";
2727
IDS_MES_IMPORT_MOT_CF_BONE "Can't find # bone(s)";
2828
IDS_MES_IMPORT_MOT_CF_MORPH "Can't find # morph(s)";
2929

3030
IDS_MES_INQUIRY_OVERWRITING_FILE "Do you want to overwrite the file?";
3131
IDS_MES_CONFIRM_DELETE_FILE "Do you want to delete all animations of the selected model?";
3232
IDS_MES_CANNOT_DELETE_DEFAULT "The default configuration file cannot be deleted!";
3333

34+
IDS_MES_IMPORT_MOD_OK "Successfully imported model:Name: #Comment:#English name: #English comment:#";
35+
IDS_MES_IMPORT_MOD_INFO_A "Vertex Count: #Surface Count: #Texture Count: #Material Count: #";
36+
IDS_MES_IMPORT_MOD_INFO_B "Bone Count: #Morph Count: #Use time: # ms";
37+
3438
IDS_MES_BONE_MORPH_DELETE "Do you want to delete # bone morph?";
3539
IDS_MES_DELETE_ALL_ANIM "Do you want to delete all the animation data of the model?";
3640
IDS_MES_DELETE_BONE_ANIM "Do you want to delete all the bone animation data of the model?";

sdk_r25/plugins/mmdtool/res/strings_zh-CN/c4d_strings.str

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ STRINGTABLE {
55
IDS_MES_OPEN_FILE_ERR "\u65e0\u6cd5\u6253\u5f00\u6587\u4ef6";
66
IDS_MES_SELECT_ERR "\u8bf7\u9009\u62e9\u4e00\u4e2a\u5bf9\u8c61";
77
IDS_MES_IMPORT_ERR "\u5bfc\u5165\u5931\u8d25:";
8-
IDS_MES_IMPORT_TYPE_ERR "\u9009\u62e9\u7684\u6587\u4ef6\u4e0d\u662fvmd\u6587\u4ef6\uff01";
8+
IDS_MES_IMPORT_TYPE_ERR "\u9009\u62e9\u7684\u6587\u4ef6\u4e0d\u662f # \u6587\u4ef6\uff01";
99
IDS_MES_IMPORT_READ_ERR "\u4e0d\u80fd\u8bfb\u53d6\u6587\u4ef6\uff01";
1010
IDS_MES_IMPORT_CAM_ERR "\u9009\u62e9\u7684\u6587\u4ef6\u4e0d\u662f\u6444\u50cf\u673a\u52a8\u4f5c\u6587\u4ef6\uff01";
1111
IDS_MES_IMPORT_MOD_ERR "\u9009\u62e9\u7684\u6587\u4ef6\u4e0d\u662f\u6a21\u578b\u52a8\u4f5c\u6587\u4ef6";
@@ -23,6 +23,9 @@ STRINGTABLE {
2323
IDS_MES_INQUIRY_OVERWRITING_FILE "\u6587\u4ef6\u5df2\u5b58\u5728\uff0c\u786e\u5b9a\u8981\u8986\u76d6\u5417\uff1f";
2424
IDS_MES_CONFIRM_DELETE_FILE "\u662f\u5426\u8981\u5220\u9664 # \u914d\u7f6e\u6587\u4ef6\uff1f";
2525
IDS_MES_CANNOT_DELETE_DEFAULT "\u4e0d\u80fd\u5220\u9664\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\uff01";
26+
IDS_MES_IMPORT_MOD_OK "\u6210\u529f\u5bfc\u5165\u6a21\u578b:\u540d\u79f0: #\u8bf4\u660e:#\u82f1\u6587\u540d\u79f0: #\u82f1\u6587\u8bf4\u660e:#";
27+
IDS_MES_IMPORT_MOD_INFO_A "\u9876\u70b9\u6570: #\u9762\u6570: #\u8d34\u56fe\u6570: #\u6750\u8d28\u6570: #";
28+
IDS_MES_IMPORT_MOD_INFO_B "\u9aa8\u9abc\u6570: #\u8868\u60c5\u6570: #\u4f7f\u7528\u65f6\u95f4: # ms";
2629
IDS_MES_BONE_MORPH_DELETE "\u662f\u5426\u786e\u5b9a\u8981\u5220\u9664 # \u9aa8\u9abc\u8868\u60c5\uff1f";
2730
IDS_MES_DELETE_ALL_ANIM "\u662f\u5426\u786e\u5b9a\u8981\u5220\u9664\u9009\u4e2d\u6a21\u578b\u7684\u6240\u6709\u52a8\u753b\uff1f";
2831
IDS_MES_DELETE_BONE_ANIM "\u662f\u5426\u786e\u5b9a\u8981\u5220\u9664\u9009\u4e2d\u6a21\u578b\u7684\u6240\u6709\u9aa8\u9abc\u52a8\u753b\uff1f";

sdk_r25/plugins/mmdtool/res/strings_zh-CN/description/TMMDBone.str

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ STRINGTABLE TMMDBone
22
{
33
TMMDBone "MMD \u9aa8\u9abc\u6807\u7b7e";
44
PMX_BONE_INFO_GRP "MMD \u9aa8\u9abc\u4fe1\u606f";
5-
PMX_BONE_INDEX_TEXT " \u9aa8\u9abc\u7d22\u5f15 ";
5+
PMX_BONE_INDEX_TEXT " \u9aa8\u9abc\u7d22\u5f15 ";
66
PMX_BONE_INDEX "";
77
PMX_BONE_NAME_LOCAL "\u9aa8\u9abc\u672c\u5730\u540d\u79f0(\u548c)";
88
PMX_BONE_NAME_UNIVERSAL "\u9aa8\u9abc\u901a\u7528\u540d\u79f0(\u82f1)";

sdk_s22/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
frameworks/
21
## Ignore Visual Studio temporary files, build results, and
32
## files generated by popular Visual Studio add-ons.
43
##

sdk_s24/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
frameworks/
21
## Ignore Visual Studio temporary files, build results, and
32
## files generated by popular Visual Studio add-ons.
43
##

source/MMD_PMX_model.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,29 +1765,23 @@ namespace mmd {
17651765
}
17661766
#if API_VERSION >= 23000
17671767
g_spinlock.Lock();
1768-
part_polygon[surface_index].a = vertex_a_index;
1769-
part_polygon[surface_index].b = vertex_b_index;
1770-
part_polygon[surface_index].c = vertex_c_index;
1768+
part_polygon[surface_index] = CPolygon(vertex_a_index, vertex_b_index, vertex_c_index);
17711769
g_spinlock.Unlock();
17721770
#else
17731771
g_spinlock.Lock();
1774-
part_polygon[surface_index].a = vertex_c_index;
1775-
part_polygon[surface_index].b = vertex_b_index;
1776-
part_polygon[surface_index].c = vertex_a_index;
1772+
part_polygon[surface_index] = CPolygon(vertex_c_index, vertex_b_index, vertex_a_index);
17771773
g_spinlock.Unlock();
17781774
#endif
17791775
if (this->m_import_settings.import_normal)
17801776
{
17811777
Vector normal0 = (Vector)vertex0.normal;
17821778
Vector normal1 = (Vector)vertex1.normal;
1783-
Vector normal2 = (Vector)vertex2.normal;
1784-
Vector normal3(0, 0, 0);
1779+
Vector normal2 = (Vector)vertex2.normal;
17851780
normal0.Normalize();
17861781
normal1.Normalize();
17871782
normal2.Normalize();
1788-
normal3.Normalize();
17891783
g_spinlock.Lock();
1790-
NormalTag::Set(normal_handle, surface_index, NormalStruct(normal0, normal1, normal2, normal3));
1784+
NormalTag::Set(normal_handle, surface_index, NormalStruct(normal0, normal1, normal2, Vector(0, 0, 0)));
17911785
g_spinlock.Unlock();
17921786
}
17931787
if (this->m_import_settings.import_uv)
@@ -2398,18 +2392,14 @@ namespace mmd {
23982392
PMXVertexData& vertex1 = this->m_vertex_data[surface.b];
23992393
PMXVertexData& vertex2 = this->m_vertex_data[surface.c];
24002394
g_spinlock.Lock();
2401-
model_polygon[surface_index].a = surface.a;
2402-
model_polygon[surface_index].b = surface.b;
2403-
model_polygon[surface_index].c = surface.c;
2395+
model_polygon[surface_index] = CPolygon(surface.a, surface.b, surface.c);
24042396
g_spinlock.Unlock();
24052397
#else
24062398
PMXVertexData& vertex0 = this->m_vertex_data[surface.c];
24072399
PMXVertexData& vertex1 = this->m_vertex_data[surface.b];
24082400
PMXVertexData& vertex2 = this->m_vertex_data[surface.a];
24092401
g_spinlock.Lock();
2410-
model_polygon[surface_index].a = surface.c;
2411-
model_polygon[surface_index].b = surface.b;
2412-
model_polygon[surface_index].c = surface.a;
2402+
model_polygon[surface_index] = CPolygon(surface.c, surface.b, surface.a);
24132403
g_spinlock.Unlock();
24142404
#endif
24152405
if (this->m_import_settings.import_normal)

0 commit comments

Comments
 (0)