Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAras Pranckevicius <aras@nesnausk.org>2022-10-10 10:10:33 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-10-10 10:10:46 +0300
commit42b1a7d4c660a4304ae8e6e45abc60824211917a (patch)
tree0d7225468748d47f9f98849b337fd717b7ec658a /source/blender/io/wavefront_obj/importer
parenta24f11e0ec96ef9f4298f5ffe754146aa8319b72 (diff)
OBJ: add global scale factor import setting
Requested in D16095 proposal - also USD & Alembic have import scale option; OBJ has an export scale object but the import scale was not there for some reason.
Diffstat (limited to 'source/blender/io/wavefront_obj/importer')
-rw-r--r--source/blender/io/wavefront_obj/importer/importer_mesh_utils.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/io/wavefront_obj/importer/importer_mesh_utils.cc b/source/blender/io/wavefront_obj/importer/importer_mesh_utils.cc
index f33753d720d..204237088ab 100644
--- a/source/blender/io/wavefront_obj/importer/importer_mesh_utils.cc
+++ b/source/blender/io/wavefront_obj/importer/importer_mesh_utils.cc
@@ -103,6 +103,9 @@ void transform_object(Object *object, const OBJImportParams &import_params)
IO_AXIS_Y, IO_AXIS_Z, import_params.forward_axis, import_params.up_axis, axes_transform);
copy_m4_m3(obmat, axes_transform);
+ float scale_vec[3] = {
+ import_params.global_scale, import_params.global_scale, import_params.global_scale};
+ rescale_m4(obmat, scale_vec);
BKE_object_apply_mat4(object, obmat, true, false);
if (import_params.clamp_size != 0.0f) {