FXTD-ODYSSEY / renderdoc2fbx

renderdoc python extension for exporting FBX file
MIT License
209 stars 51 forks source link

Fbx in not correct on MeshLab or Blender #10

Open CatDroid opened 1 year ago

CatDroid commented 1 year ago
vertex_data = defaultdict(OrderedDict)

the order is 'insert' order , not base on IDX from 0 to MAX

CatDroid commented 1 year ago

the order as follow, idx = 0 is in the middle

idx 515 [-8.23947, 2.65952, -4.73619]
idx 515 [-0.96279, 0.02432, -0.26914]
idx 515 [-0.26813, 0.03792, 0.96263, 1.0]
idx 724 [-8.22847, 1.81354, -4.80518]
idx 724 [-0.93981, 0.00477, -0.34167]
idx 724 [-0.3416, 0.01057, 0.93978, 1.0]
idx 725 [-8.22756, 0.74954, -4.80497]
idx 725 [-0.93875, 0.00011, -0.3446]
idx 725 [-0.3446, 0.00155, 0.93875, 1.0]
idx 726 [-8.22847, -0.18721, -4.80518]
idx 726 [-0.94565, -0.02648, -0.3241]
idx 726 [-0.32384, -0.01375, 0.94601, 1.0]
idx 0 [-8.26099, -0.44879, -4.67448]
idx 0 [-0.96729, -0.05819, -0.2469]
idx 0 [-0.24492, -0.03919, 0.96875, 1.0]
idx 2848 [-8.14339, 3.02678, -4.49311]
idx 2848 [0.01272, 0.85022, -0.52627]
idx 2848 [-0.98093, 0.1127, 0.15837, 1.0]
idx 2849 [-8.05884, 3.01868, -4.47582]
idx 2849 [0.19433, 0.90475, -0.37904]
idx 2849 [-0.98082, 0.18517, -0.06086, 1.0]
idx 2850 [-8.02826, 2.72009, -4.7522]
idx 2850 [0.28408, 0.39832, -0.87215]
idx 2850 [-0.9564, 0.1821, -0.22835, 1.0]
idx 2851 [-8.17799, 3.0299, -4.20415]
idx 2851 [-0.04127, 0.99908, -0.01164]
idx 2851 [-0.08558, 0.00807, 0.9963, 1.0]
CatDroid commented 1 year ago

I modify run_vertices, and fbx is well in MeshLab

 def run_vertices(self):
          vertices = []
            size = len(self.vertex_data[POSITION])
            for i in range(size) :  # fix order 
                values = self.vertex_data[POSITION][i]
                for v in values:
                   vertices.append(str(v))

            self.ARGS["vertices"] = ",".join(vertices)
            self.ARGS["vertices_num"] = len(vertices)
T0biasCZe commented 11 months ago

unfortunatelly your fix doesnt work for me, I replaced the code in the init.py, and when the export code is ran, it through error that self doesnt contain vertex_data image