|
6 | 6 | bl_info = {
|
7 | 7 | "name": "glTF Curve Exporter Extension",
|
8 | 8 | "category": "Import-Export",
|
9 |
| - "version": (1, 0, 1), |
| 9 | + "version": (1, 0, 2), |
10 | 10 | "blender": (4, 2, 0),
|
11 | 11 | "location": "File > Export > glTF 2.0",
|
12 | 12 | "description": "Extension to export curve data in glTF files.",
|
@@ -88,25 +88,27 @@ def gather_curve_data(self, blender_object):
|
88 | 88 | curve_data = blender_object.data
|
89 | 89 | splines_data = []
|
90 | 90 |
|
| 91 | + world_matrix = blender_object.matrix_world |
| 92 | + |
91 | 93 | for spline in curve_data.splines:
|
92 | 94 | points = []
|
93 | 95 | if spline.type == 'BEZIER':
|
94 | 96 | points = [
|
95 | 97 | {
|
96 |
| - "co": self.convert_vector_to_list(p.co), |
97 |
| - "handle_left": self.convert_vector_to_list(p.handle_left), |
98 |
| - "handle_right": self.convert_vector_to_list(p.handle_right) |
| 98 | + "co": self.convert_vector_to_list(world_matrix @ p.co), |
| 99 | + "handle_left": self.convert_vector_to_list(world_matrix @ p.handle_left), |
| 100 | + "handle_right": self.convert_vector_to_list(world_matrix @ p.handle_right) |
99 | 101 | } for p in spline.bezier_points
|
100 | 102 | ]
|
101 | 103 | elif spline.type == 'NURBS':
|
102 | 104 | points = [
|
103 | 105 | {
|
104 |
| - "co": self.convert_vector_to_list(p.co), |
| 106 | + "co": self.convert_vector_to_list(world_matrix @ p.co), |
105 | 107 | } for p in spline.points
|
106 | 108 | ]
|
107 | 109 | else: # 'POLY'
|
108 | 110 | points = [
|
109 |
| - {"co": self.convert_vector_to_list(p.co)} for p in spline.points |
| 111 | + {"co": self.convert_vector_to_list(world_matrix @ p.co)} for p in spline.points |
110 | 112 | ]
|
111 | 113 |
|
112 | 114 | splines_data.append({
|
|
0 commit comments