New Addon: Import Autodesk .max #105013
@ -176,6 +176,11 @@ class Export3DS(bpy.types.Operator, ExportHelper):
|
||||
soft_min=0.0, soft_max=100000.0,
|
||||
default=1.0,
|
||||
)
|
||||
unit_convert: BoolProperty(
|
||||
name="Convert Units",
|
||||
description="Converts to scene unit length settings",
|
||||
default=False,
|
||||
)
|
||||
use_selection: BoolProperty(
|
||||
name="Selection Only",
|
||||
description="Export selected objects only",
|
||||
@ -259,6 +264,7 @@ class MAX3DS_PT_export_transform(bpy.types.Panel):
|
||||
operator = sfile.active_operator
|
||||
|
||||
layout.prop(operator, "scale_factor")
|
||||
layout.prop(operator, "unit_convert")
|
||||
layout.prop(operator, "axis_forward")
|
||||
layout.prop(operator, "axis_up")
|
||||
|
||||
|
@ -1489,10 +1489,9 @@ def make_ambient_node(world):
|
||||
# EXPORT #
|
||||
##########
|
||||
|
||||
def save(operator, context, filepath="", scale_factor=1.0, use_selection=False, use_hierarchy=False, write_keyframe=False, global_matrix=None):
|
||||
|
||||
def save(operator, context, filepath="", scale_factor=1.0, convert_unit=False,
|
||||
use_selection=False, use_hierarchy=False, write_keyframe=False, global_matrix=None):
|
||||
"""Save the Blender scene to a 3ds file."""
|
||||
mtx_scale = mathutils.Matrix.Scale(scale_factor, 4)
|
||||
|
||||
# Time the export
|
||||
duration = time.time()
|
||||
@ -1503,6 +1502,20 @@ def save(operator, context, filepath="", scale_factor=1.0, use_selection=False,
|
||||
depsgraph = context.evaluated_depsgraph_get()
|
||||
world = scene.world
|
||||
|
||||
unit_measure = 1.0
|
||||
if unit_convert:
|
||||
unit_length = sce.unit_settings.length_unit
|
||||
if unit_length == 'KILOMETERS':
|
||||
unit_measure = 0.001
|
||||
elif unit_length == 'CENTIMETERS':
|
||||
unit_measure = 100
|
||||
elif unit_length == 'MILLIMETERS':
|
||||
unit_measure = 1000
|
||||
elif unit_length == 'MICROMETERS':
|
||||
unit_measure = 1000000
|
||||
|
||||
mtx_scale = mathutils.Matrix.Scale((scale_factor * unit_measure),4)
|
||||
|
||||
if global_matrix is None:
|
||||
global_matrix = mathutils.Matrix()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user