Просмотр исходного кода

Modified export for meshes with parent

I've found that using

    world = object.matrix_local

instead of

    world *= object.parent.matrix_world.inverted()

works best for mesh importing: relative transforms between parent/child are now consistent from Blender to BJS.

Without this change, relative transforms are wrong 95% of time after being exporter in BJS, probably because of the calculation with the parent inverse matrix.

I'm not very confident with Python and Blender scripting so I'll leave you guys to decide whether this modification makes sense, or if I just missed something on my side.
jahow 10 лет назад
Родитель
Сommit
9767a7bda1
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Exporters/Blender/io_export_babylon.py

+ 1 - 1
Exporters/Blender/io_export_babylon.py

@@ -564,7 +564,7 @@ class Mesh(FCurveAnimatable):
         
         world = object.matrix_world
         if object.parent and not hasSkeleton:
-            world *= object.parent.matrix_world.inverted()
+            world = object.matrix_local
             
         # use defaults when not None
         if forcedParent is None: