io_scene_3ds: Changed unit convert to apply units #104777

Merged
Sebastian Sille merged 13 commits from :main into main 2023-07-25 18:44:03 +02:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit 00636818a9 - Show all commits

View File

@ -176,9 +176,9 @@ class Export3DS(bpy.types.Operator, ExportHelper):
soft_min=0.0, soft_max=100000.0, soft_min=0.0, soft_max=100000.0,
default=1.0, default=1.0,
) )
unit_convert: BoolProperty( apply_unit: BoolProperty(
name="Convert Units", name="Apply Units",
description="Converts to scene unit length settings", description="Take the scene unit length settings into account",
default=False, default=False,
) )
use_selection: BoolProperty( use_selection: BoolProperty(
@ -264,7 +264,7 @@ class MAX3DS_PT_export_transform(bpy.types.Panel):
operator = sfile.active_operator operator = sfile.active_operator
layout.prop(operator, "scale_factor") layout.prop(operator, "scale_factor")
layout.prop(operator, "unit_convert") layout.prop(operator, "apply_unit")
layout.prop(operator, "axis_forward") layout.prop(operator, "axis_forward")
layout.prop(operator, "axis_up") layout.prop(operator, "axis_up")

View File

@ -1489,7 +1489,7 @@ def make_ambient_node(world):
# EXPORT # # EXPORT #
########## ##########
def save(operator, context, filepath="", scale_factor=1.0, unit_convert=False, def save(operator, context, filepath="", scale_factor=1.0, apply_unit=False,
use_selection=False, use_hierarchy=False, write_keyframe=False, global_matrix=None): use_selection=False, use_hierarchy=False, write_keyframe=False, global_matrix=None):
"""Save the Blender scene to a 3ds file.""" """Save the Blender scene to a 3ds file."""
@ -1503,7 +1503,7 @@ def save(operator, context, filepath="", scale_factor=1.0, unit_convert=False,
world = scene.world world = scene.world
unit_measure = 1.0 unit_measure = 1.0
if unit_convert: if apply_unit:
unit_length = sce.unit_settings.length_unit unit_length = sce.unit_settings.length_unit
if unit_length == 'KILOMETERS': if unit_length == 'KILOMETERS':
unit_measure = 0.001 unit_measure = 0.001
@ -1538,7 +1538,7 @@ def save(operator, context, filepath="", scale_factor=1.0, unit_convert=False,
# Add MASTERSCALE element # Add MASTERSCALE element
mscale = _3ds_chunk(MASTERSCALE) mscale = _3ds_chunk(MASTERSCALE)
mscale.add_variable("scale", _3ds_float((1.0 / unit_measure))) mscale.add_variable("scale", _3ds_float(1.0))
object_info.add_subchunk(mscale) object_info.add_subchunk(mscale)
# Init main keyframe data chunk # Init main keyframe data chunk