Skip to content

Commit ab3b837

Browse files
committed
make enable default true, false when invalid sequence given
1 parent 3149050 commit ab3b837

4 files changed

Lines changed: 11 additions & 14 deletions

File tree

simloader/importer.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,22 @@ def update_mesh(meshio_mesh, object):
123123
attribute.data.foreach_set(name_string, v.ravel())
124124

125125

126-
def create_obj(fileseq, use_relaitve, enabled, transform_matrix=Matrix([[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0,
126+
def create_obj(fileseq, use_relaitve, transform_matrix=Matrix([[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0,
127127
1]])):
128128

129129
current_frame = bpy.context.scene.frame_current
130130
filepath = fileseq[current_frame % len(fileseq)]
131131

132132
meshio_mesh = None
133-
if enabled:
134-
try:
135-
meshio_mesh = meshio.read(filepath)
136-
except Exception as e:
137-
show_message_box("Error when reading: " + filepath + ",\n" + traceback.format_exc(),
138-
"Meshio Loading Error" + str(e),
139-
icon="ERROR")
140-
return None
133+
enabled = True
134+
135+
try:
136+
meshio_mesh = meshio.read(filepath)
137+
except Exception as e:
138+
show_message_box("Error when reading: " + filepath + ",\n" + traceback.format_exc(),
139+
"Meshio Loading Error" + str(e),
140+
icon="ERROR")
141+
enabled = False
141142

142143
# create the object
143144
name = fileseq.basename() + "@" + fileseq.extension()

simloader/operators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def execute(self, context):
4242
show_message_box(traceback.format_exc(), "Can't find sequence: " + str(fs), "ERROR")
4343
return {"CANCELLED"}
4444

45-
create_obj(fs, importer_prop.relative,importer_prop.enabled)
45+
create_obj(fs, importer_prop.relative)
4646
return {"FINISHED"}
4747

4848

simloader/panels.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ def draw(self, context):
170170
col1.label(text="Use Relative Path")
171171
col2.prop(importer_prop, "relative", text="")
172172

173-
col1.label(text="Enable")
174-
col2.prop(importer_prop, "enabled", text="")
175-
176173
layout.label(text="Pattern")
177174
box = layout.box()
178175
split = box.split()

simloader/properties.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class SIMLOADER_scene_property(bpy.types.PropertyGroup):
1313
description="Please choose the file sequences you want",
1414
items=callback_fileseq,
1515
)
16-
enabled: bpy.props.BoolProperty(default=True)
1716
use_pattern: bpy.props.BoolProperty(name='Use pattern',
1817
description="whether or not to use manually typed pattern",
1918
default=False)

0 commit comments

Comments
 (0)