io_scene_3ds: Update for Blender 3.x #104507
@ -168,7 +168,6 @@ scn = None
|
||||
object_dictionary = {}
|
||||
object_matrix = {}
|
||||
|
||||
|
||||
class Chunk:
|
||||
__slots__ = (
|
||||
"ID",
|
||||
@ -189,7 +188,6 @@ class Chunk:
|
||||
print('length: ', self.length)
|
||||
print('bytes_read: ', self.bytes_read)
|
||||
|
||||
|
||||
def read_chunk(file, chunk):
|
||||
temp_data = file.read(struct.calcsize(chunk.binary_format))
|
||||
data = struct.unpack(chunk.binary_format, temp_data)
|
||||
@ -201,7 +199,6 @@ def read_chunk(file, chunk):
|
||||
# if debugging
|
||||
# chunk.dump()
|
||||
|
||||
|
||||
def read_string(file):
|
||||
# read in the characters till we get a null character
|
||||
s = []
|
||||
@ -220,7 +217,6 @@ def read_string(file):
|
||||
# IMPORT
|
||||
######################################################
|
||||
|
||||
|
||||
def process_next_object_chunk(file, previous_chunk):
|
||||
new_chunk = Chunk()
|
||||
|
||||
@ -228,14 +224,12 @@ def process_next_object_chunk(file, previous_chunk):
|
||||
# read the next chunk
|
||||
read_chunk(file, new_chunk)
|
||||
|
||||
|
||||
def skip_to_end(file, skip_chunk):
|
||||
buffer_size = skip_chunk.length - skip_chunk.bytes_read
|
||||
binary_format = "%ic" % buffer_size
|
||||
file.read(struct.calcsize(binary_format))
|
||||
skip_chunk.bytes_read += buffer_size
|
||||
|
||||
|
||||
def add_texture_to_material(image, contextWrapper, pct, extend, alpha, scale, offset, angle, tintcolor, mapto):
|
||||
shader = contextWrapper.node_principled_bsdf
|
||||
nodetree = contextWrapper.material.node_tree
|
||||
@ -322,7 +316,6 @@ def add_texture_to_material(image, contextWrapper, pct, extend, alpha, scale, of
|
||||
shader.location = (300, 300)
|
||||
contextWrapper._grid_to_location(1, 0, dst_node=contextWrapper.node_out, ref_node=shader)
|
||||
|
||||
|
||||
def process_next_chunk(context, file, previous_chunk, imported_objects, IMAGE_SEARCH, KEYFRAME):
|
||||
from bpy_extras.image_utils import load_image
|
||||
|
||||
@ -1114,7 +1107,6 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, IMAGE_SE
|
||||
#pivot_matrix = mathutils.Matrix.Translation(pivot_matrix.to_3x3() @ -pivot)
|
||||
ob.data.transform(pivot_matrix)
|
||||
|
||||
|
||||
def load_3ds(filepath,
|
||||
context,
|
||||
IMPORT_CONSTRAIN_BOUNDS=10.0,
|
||||
@ -1123,7 +1115,6 @@ def load_3ds(filepath,
|
||||
APPLY_MATRIX=True,
|
||||
global_matrix=None):
|
||||
# global SCN
|
||||
|
||||
# XXX
|
||||
# if BPyMessages.Error_NoFile(filepath):
|
||||
# return
|
||||
@ -1248,7 +1239,6 @@ def load_3ds(filepath,
|
||||
print(" done in %.4f sec." % (time.time() - time1))
|
||||
file.close()
|
||||
|
||||
|
||||
def load(operator,
|
||||
context,
|
||||
filepath="",
|
||||
|
Loading…
Reference in New Issue
Block a user