IO: Importing multiple 3DS files at once #105227
@ -13,6 +13,7 @@ from bpy.props import (
|
||||
EnumProperty,
|
||||
FloatProperty,
|
||||
StringProperty,
|
||||
CollectionProperty,
|
||||
)
|
||||
import bpy
|
||||
bl_info = {
|
||||
@ -47,6 +48,8 @@ class Import3DS(bpy.types.Operator, ImportHelper):
|
||||
filename_ext = ".3ds"
|
||||
filter_glob: StringProperty(default="*.3ds", options={'HIDDEN'})
|
||||
filepath: StringProperty(subtype='FILE_PATH', options={'SKIP_SAVE'})
|
||||
files: CollectionProperty(type=bpy.types.OperatorFileListElement, options={'HIDDEN', 'SKIP_SAVE'})
|
||||
directory: StringProperty(subtype='DIR_PATH')
|
||||
|
||||
constrain_size: FloatProperty(
|
||||
name="Constrain Size",
|
||||
|
@ -1768,11 +1768,12 @@ def load_3ds(filepath, context, CONSTRAIN=10.0, UNITS=False, IMAGE_SEARCH=True,
|
||||
file.close()
|
||||
|
||||
|
||||
def load(operator, context, filepath="", constrain_size=0.0, use_scene_unit=False,
|
||||
def load(operator, context, files=None, directory="", filepath="", constrain_size=0.0, use_scene_unit=False,
|
||||
use_image_search=True, object_filter=None, use_world_matrix=False, use_keyframes=True,
|
||||
use_apply_transform=True, global_matrix=None, use_cursor=False, use_center_pivot=False):
|
||||
|
||||
load_3ds(filepath, context, CONSTRAIN=constrain_size, UNITS=use_scene_unit,
|
||||
for f in files:
|
||||
load_3ds(os.path.join(directory, f.name), context, CONSTRAIN=constrain_size, UNITS=use_scene_unit,
|
||||
IMAGE_SEARCH=use_image_search, FILTER=object_filter, WORLD_MATRIX=use_world_matrix, KEYFRAME=use_keyframes,
|
||||
APPLY_MATRIX=use_apply_transform, CONVERSE=global_matrix, CURSOR=use_cursor, PIVOT=use_center_pivot,)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user