Skip to content

Commit 34d179c

Browse files
committed
Revert "A lot of UI changes"
This reverts commit 65023fd.
1 parent 65023fd commit 34d179c

File tree

9 files changed

+211
-398
lines changed

9 files changed

+211
-398
lines changed

__init__.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Sequence Loader",
33
"description": "Loader for meshio supported mesh files/ simulation sequences",
44
"author": "Interactive Computer Graphics",
5-
"version": (0, 1, 6),
5+
"version": (0, 1, 5),
66
"blender": (3, 4, 0),
77
"warning": "",
88
"support": "COMMUNITY",
@@ -21,7 +21,7 @@
2121
bpy.context.preferences.filepaths.use_relative_paths = False
2222

2323
from bseq import *
24-
from bseq.operators import menu_func_import, add_keymap, delete_keymap
24+
from bseq.operators import menu_func_import
2525

2626
classes = [
2727
BSEQ_obj_property,
@@ -33,13 +33,9 @@
3333
BSEQ_OT_resetins,
3434
BSEQ_OT_resetmesh,
3535
BSEQ_Import,
36-
BSEQ_Import_Child1,
37-
BSEQ_Import_Child2,
38-
BSEQ_Globals_Panel,
3936
BSEQ_List_Panel,
4037
BSEQ_UL_Obj_List,
4138
BSEQ_Settings,
42-
BSEQ_Advanced_Panel,
4339
BSEQ_Templates,
4440
BSEQ_UL_Att_List,
4541
BSEQ_OT_set_as_split_norm,
@@ -52,10 +48,10 @@
5248
BSEQ_OT_refresh_sequences,
5349
BSEQ_OT_set_start_end_frames,
5450
WM_OT_batchSequences,
55-
WM_OT_batchSequences_Settings,
5651
WM_OT_MeshioObject
5752
]
5853

54+
5955
def register():
6056
bpy.app.handlers.load_post.append(BSEQ_initialize)
6157
for cls in classes:
@@ -64,8 +60,8 @@ def register():
6460
bpy.types.Scene.BSEQ = bpy.props.PointerProperty(type=BSEQ_scene_property)
6561
bpy.types.Object.BSEQ = bpy.props.PointerProperty(type=BSEQ_obj_property)
6662
bpy.types.Mesh.BSEQ = bpy.props.PointerProperty(type=BSEQ_mesh_property)
63+
6764
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
68-
add_keymap()
6965

7066
# manually call this function once
7167
# so when addon being installed, it can run correctly
@@ -80,9 +76,10 @@ def unregister():
8076
del bpy.types.Object.BSEQ
8177
bpy.app.handlers.load_post.remove(BSEQ_initialize)
8278
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
83-
delete_keymap()
8479
unsubscribe_to_selected()
8580

81+
8682
if __name__ == "__main__":
83+
8784
# unregister()
8885
register()

bseq/__init__.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from bseq.utils import refresh_obj
2-
from .operators import BSEQ_OT_load, BSEQ_OT_edit, BSEQ_OT_resetpt, BSEQ_OT_resetmesh, BSEQ_OT_resetins, BSEQ_OT_set_as_split_norm, BSEQ_OT_remove_split_norm, BSEQ_OT_disable_selected, BSEQ_OT_enable_selected, BSEQ_OT_refresh_seq, BSEQ_OT_disable_all, BSEQ_OT_enable_all, BSEQ_OT_refresh_sequences, BSEQ_OT_set_start_end_frames, WM_OT_batchSequences, WM_OT_batchSequences_Settings, WM_OT_MeshioObject
2+
from .operators import BSEQ_OT_load, BSEQ_OT_edit, BSEQ_OT_resetpt, BSEQ_OT_resetmesh, BSEQ_OT_resetins, BSEQ_OT_set_as_split_norm, BSEQ_OT_remove_split_norm, BSEQ_OT_disable_selected, BSEQ_OT_enable_selected, BSEQ_OT_refresh_seq, BSEQ_OT_disable_all, BSEQ_OT_enable_all, BSEQ_OT_refresh_sequences, BSEQ_OT_set_start_end_frames, WM_OT_batchSequences, WM_OT_MeshioObject
33
from .properties import BSEQ_scene_property, BSEQ_obj_property, BSEQ_mesh_property
4-
from .panels import BSEQ_UL_Obj_List, BSEQ_List_Panel, BSEQ_Settings, BSEQ_Import, BSEQ_Import_Child1, BSEQ_Import_Child2, BSEQ_Globals_Panel, BSEQ_Advanced_Panel, BSEQ_Templates, BSEQ_UL_Att_List, draw_template
4+
from .panels import BSEQ_UL_Obj_List, BSEQ_List_Panel, BSEQ_Settings, BSEQ_Import, BSEQ_Templates, BSEQ_UL_Att_List, draw_template
55
from .messenger import subscribe_to_selected, unsubscribe_to_selected
66
import bpy
77
from bpy.app.handlers import persistent
@@ -12,8 +12,7 @@
1212
@persistent
1313
def BSEQ_initialize(scene):
1414
if update_obj not in bpy.app.handlers.frame_change_post:
15-
bpy.app.handlers.frame_change_post.append(auto_refresh_active)
16-
bpy.app.handlers.frame_change_post.append(auto_refresh_all)
15+
bpy.app.handlers.frame_change_post.append(auto_refresh)
1716
bpy.app.handlers.frame_change_post.append(update_obj)
1817
subscribe_to_selected()
1918
if print_information not in bpy.app.handlers.render_init:
@@ -26,15 +25,11 @@ def BSEQ_initialize(scene):
2625
"BSEQ_obj_property",
2726
"BSEQ_initialize",
2827
"BSEQ_Import",
29-
"BSEQ_Import_Child1",
30-
"BSEQ_Import_Child2",
31-
"BSEQ_Globals_Panel",
3228
"BSEQ_List_Panel",
3329
"BSEQ_UL_Obj_List",
3430
"BSEQ_scene_property",
3531
"BSEQ_Templates",
3632
"BSEQ_Settings",
37-
"BSEQ_Advanced_Panel",
3833
"BSEQ_UL_Att_List",
3934
"subscribe_to_selected",
4035
"BSEQ_OT_resetpt",
@@ -53,6 +48,5 @@ def BSEQ_initialize(scene):
5348
"BSEQ_OT_refresh_sequences",
5449
"BSEQ_OT_set_start_end_frames",
5550
"WM_OT_batchSequences",
56-
"WM_OT_batchSequences_Settings",
5751
"WM_OT_MeshioObject"
5852
]

bseq/callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def update_path(self, context):
2525
return [("None", "No sequence detected", "", 1)]
2626

2727
file_sequences.clear()
28-
if len(f) >= 100:
28+
if len(f) >= 20:
2929
file_sequences.append(("None", "Too much sequence detected, could be false detection, please use pattern below", "", 1))
3030
else:
3131
count = 1

bseq/globals.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,12 @@ def print_information(scene):
2424
file.write("Object name: {}\n".format(obj.name))
2525
file.write("Is it being animated: {}\n".format(bseq_prop.enabled))
2626
file.write("Filepath: {}\n".format(bseq_prop.pattern))
27-
file.write("Is it relative path: {}\n".format(bpy.path.is_subdir(obj.BSEQ.pattern, bpy.path.abspath("//"))))
27+
file.write("Is it relative path: {}\n".format(bseq_prop.use_relative))
2828
file.write("\n\n")
2929

3030

31-
def auto_refresh_all(scene, depsgraph=None):
32-
if not bpy.context.scene.BSEQ.auto_refresh_all:
33-
return
34-
for obj in bpy.data.objects:
35-
if obj.BSEQ.init == False:
36-
continue
37-
if obj.BSEQ.enabled == False:
38-
continue
39-
if obj.mode != "OBJECT":
40-
continue
41-
refresh_obj(obj, scene)
42-
43-
def auto_refresh_active(scene, depsgraph=None):
44-
if not bpy.context.scene.BSEQ.auto_refresh_active:
31+
def auto_refresh(scene, depsgraph=None):
32+
if not bpy.context.scene.BSEQ.auto_refresh:
4533
return
4634
for obj in bpy.data.objects:
4735
if obj.BSEQ.init == False:

bseq/importer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def create_meshio_obj(filepath):
205205
bpy.context.view_layer.objects.active = object
206206

207207

208-
def create_obj(fileseq, root_path, transform_matrix=Matrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]])):
208+
def create_obj(fileseq, use_relative, root_path, transform_matrix=Matrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]])):
209209

210210
current_frame = bpy.context.scene.frame_current
211211
filepath = fileseq[current_frame % len(fileseq)]
@@ -240,8 +240,8 @@ def create_obj(fileseq, root_path, transform_matrix=Matrix([[1, 0, 0, 0], [0, 1,
240240
object = bpy.data.objects.new(name, mesh)
241241

242242
# create the object
243-
print("File path: " + filepath)
244-
if bpy.path.is_subdir(filepath, bpy.path.abspath("//")):
243+
object.BSEQ.use_relative = use_relative
244+
if use_relative:
245245
if root_path != "":
246246
object.BSEQ.pattern = bpy.path.relpath(str(fileseq), start=root_path)
247247
else:
@@ -280,8 +280,7 @@ def update_obj(scene, depsgraph=None):
280280
current_frame = obj.BSEQ.frame
281281
meshio_mesh = None
282282
pattern = obj.BSEQ.pattern
283-
# check if the path is relative
284-
if bpy.path.is_subdir(pattern, bpy.path.abspath("//")):
283+
if obj.BSEQ.use_relative:
285284
if scene.BSEQ.root_path != "":
286285
pattern = bpy.path.abspath(pattern, start=scene.BSEQ.root_path)
287286
else:

0 commit comments

Comments
 (0)