diff options
author | Peter Kim <pk15950@gmail.com> | 2022-06-17 11:28:06 +0300 |
---|---|---|
committer | Peter Kim <pk15950@gmail.com> | 2022-06-17 11:28:06 +0300 |
commit | ec84e3294593e2e26475f18c81e847bf00dc201e (patch) | |
tree | a9c52b070d2ec514e4d5fe434a91709a4b79dfbd /io_scene_fbx | |
parent | 633e707c40ad94d75a5f0c23ad5f5df0514fc92d (diff) | |
parent | aa353e127c2be0a31e10f8b3621fc418bcf6d6ef (diff) |
Merge branch 'master' into xr-dev
Diffstat (limited to 'io_scene_fbx')
-rw-r--r-- | io_scene_fbx/__init__.py | 2 | ||||
-rw-r--r-- | io_scene_fbx/fbx_utils.py | 11 | ||||
-rw-r--r-- | io_scene_fbx/import_fbx.py | 12 |
3 files changed, 19 insertions, 6 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 02d135b1..1b7e646d 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -3,7 +3,7 @@ bl_info = { "name": "FBX format", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier", - "version": (4, 36, 0), + "version": (4, 36, 2), "blender": (3, 2, 0), "location": "File > Import-Export", "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions", diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py index 35fdede7..41c63ef8 100644 --- a/io_scene_fbx/fbx_utils.py +++ b/io_scene_fbx/fbx_utils.py @@ -112,21 +112,28 @@ RIGHT_HAND_AXES = { } +# NOTE: Not fully in enum value order, since when exporting the first entry matching the framerate value is used +# (e.g. better have NTSC fullframe than NTSC drop frame for 29.97 framerate). FBX_FRAMERATES = ( + #(-1.0, 0), # Default framerate. (-1.0, 14), # Custom framerate. (120.0, 1), (100.0, 2), (60.0, 3), (50.0, 4), (48.0, 5), - (30.0, 6), # BW NTSC. - (30.0 / 1.001, 9), # Color NTSC. + (30.0, 6), # BW NTSC, full frame. + (30.0, 7), # Drop frame. + (30.0 / 1.001, 9), # Color NTSC, full frame. + (30.0 / 1.001, 8), # Color NTSC, drop frame. (25.0, 10), (24.0, 11), + #(1.0, 12), # 1000 milli/s (use for date time?). (24.0 / 1.001, 13), (96.0, 15), (72.0, 16), (60.0 / 1.001, 17), + (120.0 / 1.001, 18), ) diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index 5fabec24..90f0c016 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -778,16 +778,22 @@ def blen_read_geom_layerinfo(fbx_layer): def blen_read_geom_array_setattr(generator, blen_data, blen_attr, fbx_data, stride, item_size, descr, xform): """Generic fbx_layer to blen_data setter, generator is expected to yield tuples (ble_idx, fbx_idx).""" - max_idx = len(blen_data) - 1 + max_blen_idx = len(blen_data) - 1 + max_fbx_idx = len(fbx_data) - 1 print_error = True def check_skip(blen_idx, fbx_idx): nonlocal print_error if fbx_idx < 0: # Negative values mean 'skip'. return True - if blen_idx > max_idx: + if blen_idx > max_blen_idx: if print_error: - print("ERROR: too much data in this layer, compared to elements in mesh, skipping!") + print("ERROR: too much data in this Blender layer, compared to elements in mesh, skipping!") + print_error = False + return True + if fbx_idx + item_size - 1 > max_fbx_idx: + if print_error: + print("ERROR: not enough data in this FBX layer, skipping!") print_error = False return True return False |