Skip to content

Commit

Permalink
removed redundant version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshQuake committed Aug 20, 2024
1 parent 355eeac commit c5b3c5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
11 changes: 1 addition & 10 deletions src/addons/send2ue/core/io/fbx_b3.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ def export(**keywords):
elem_props_template_finalize,
fbx_name_class
)

# Added version check to import new elem data type added in 4.0. Shading element was updated to use char instead of bool
if bpy.app.version[0] >= 4:
from io_scene_fbx.fbx_utils import (
elem_data_single_char
)

convert_rad_to_deg_iter = units_convertor_iter("radian", "degree")

Expand Down Expand Up @@ -455,10 +449,7 @@ def fbx_data_object_elements(root, ob_obj, scene_data):
# object type, etc.
elem_data_single_int32(model, b"MultiLayer", 0)
elem_data_single_int32(model, b"MultiTake", 0)
if (bpy.app.version[0] >= 4):
elem_data_single_char(model, b"Shading", b"\x01") # Shading was changed to a char from bool in blender 4
else:
elem_data_single_bool(model, b"Shading", True)
elem_data_single_bool(model, b"Shading", True)
elem_data_single_string(model, b"Culling", b"CullingOff")

if obj_type == b"Camera":
Expand Down
13 changes: 3 additions & 10 deletions src/addons/send2ue/core/io/fbx_b4.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,13 @@ def export(**keywords):
elem_data_single_string,
elem_data_single_int32_array,
elem_data_single_float64_array,
elem_data_single_char,
elem_properties,
elem_props_template_init,
elem_props_template_set,
elem_props_template_finalize,
fbx_name_class
)

# Added version check to import new elem data type added in 4.0. Shading element was updated to use char instead of bool
if bpy.app.version[0] >= 4:
from io_scene_fbx.fbx_utils import (
elem_data_single_char
)

convert_rad_to_deg_iter = units_convertor_iter("radian", "degree")

Expand Down Expand Up @@ -540,10 +535,8 @@ def fbx_data_object_elements(root, ob_obj, scene_data):
# object type, etc.
elem_data_single_int32(model, b"MultiLayer", 0)
elem_data_single_int32(model, b"MultiTake", 0)
if (bpy.app.version[0] >= 4):
elem_data_single_char(model, b"Shading", b"\x01") # Shading was changed to a char from bool in blender 4
else:
elem_data_single_bool(model, b"Shading", True)
elem_data_single_char(model, b"Shading", b"\x01") # Shading was changed to a char from bool in blender 4

elem_data_single_string(model, b"Culling", b"CullingOff")

if obj_type == b"Camera":
Expand Down

0 comments on commit c5b3c5d

Please sign in to comment.