Skip to content

Commit f163205

Browse files
neverhood311ThomasBoulestintom258ChristopherRemdeFailxxx
authored
Version 2.2 for Blender 2.92.x - 3.6.x (#189)
* add mesh sequence info (#111) Sequence size, number of cached meshes, and the path to the mesh sequence directory * Enable keyframe-based sequence playback (#112) * update the frame for every dependency graph change (#115) This allow the sequence to update while the user is adjusting the keyframe curve. * switch to depsgraph_update_pre instead of post (#116) * Create new empty sequence (#132) * initial commit * seed mesh sequence, duplicate current mesh * Finish new sequence creation and mesh duplication Also added the Ctrl+Shift+D hotkey for duplicating the current mesh * multiple imports using ';' (#136) Co-authored-by: BOULEST <[email protected]> * fix bug in multiple sequence import (#137) * Fix stack overflow from streaming sequence import (#138) * disable sequence frame changes while importing meshes * version bump * Fix importing multiple streaming sequences (#139) Take care to build the full absolute path, then split it into the full directory name and the file prefix name * Add Merge Duplicate Materials button (#140) * Sequence shading: remove dependence on bpy.ops (#141) * add support for X3D import (#144) * Import only the first mesh in each file (#145) Delete all other objects * keep only first mesh per file for streaming sequences (#147) * Give sequence objects a unique name (#148) * Don't create a sequence object if it can't find any files (#149) Also, report the offending file name prefixes to the user. * Rename "Mesh Sequence" to "Stop Motion OBJ" (#150) * Added better support for alembic export (#154) * Added better support for alembic export * Added a workaround for a crash when Depsgraph_Update_Pre is calling UpdateFrame * Fixed code format * Renamed UI naming for this feature * Add Convert To Mesh Sequence button to Stop Motion OBJ object properties panel (#155) * Add Convert to Sequence button to Stop Motion OBJ panel Still doesn't work * Code cleanup I guess it works * Auto export altered meshes (#157) * Initial commit of pseuodocode * mesh hash to detect mesh changes * recalculate the mesh hash on load, start of export logic * Basic functionality working Choose between overwriting and saving to different directory. Check for invalid directory * Add other file types, some cleanup * Manually revert #154 (#158) * Fixed wrong/no export issue (#159) Note: this only works when a SINGLE mesh sequence is present * Fix ConvertToMeshSequence operator (#160) * Fix ConvertToMeshSequence operator * Bump version * Fix issue checkMeshChangesFrameChangePre (#162) * Bump version * Fixed no object selected in checkMeshChangesFrameChangePre * Bump version * Smooth shaded streaming sequences (#165) * Streaming sequence smooth shading * Version bump * Fixed a few export UI bugs (#166) * Version bump (#167) * split versions for Blender 3.6 and 4.0 * Revert "split versions for Blender 3.6 and 4.0" This reverts commit 218814a. * initial commit for Blender 4.0 compatibility * Update new import settings * Enable fast OBJ for 3.3+ Disable for <3.3.0 and for streaming sequences Disable everything for <2.92.0 and >=4.0.0 * Add support for VRML2 (.wrl) import/export * final version bump for v2.2.0 * Update readme for 2.2.0 --------- Co-authored-by: Roibabouin <[email protected]> Co-authored-by: BOULEST <[email protected]> Co-authored-by: Christopher Remde <[email protected]> Co-authored-by: Félix <[email protected]>
1 parent 4fd8bff commit f163205

File tree

5 files changed

+983
-173
lines changed

5 files changed

+983
-173
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stop Motion OBJ
22
[Tutorial](https://github.com/neverhood311/Stop-motion-OBJ/wiki#quick-start) | [Forum](https://blenderartists.org/t/stop-motion-obj-obj-stl-ply-sequence-importer/670105) | [Documentation](https://github.com/neverhood311/Stop-motion-OBJ/wiki) | [How to Support](#how-to-support)
33

4-
Stop Motion OBJ is a tool that lets you import a sequence of mesh files (.obj, .stl, or .ply), play them back in real time, then render them out to an animation. Each mesh may have a different vertex count, poly count, and even different UVs. This is especially useful for importing fluid simulations, for visualization of scientific data, and for rendering of 4D scan data.
4+
Stop Motion OBJ is a tool that lets you import a sequence of mesh files (.obj, .stl, .ply, .x3d, or .wrl), play them back in real time, then render them out to an animation. Each mesh may have a different vertex count, poly count, and even different UVs. This is especially useful for importing fluid simulations, for visualization of scientific data, and for rendering of 4D scan data.
55

66
Once a sequence is imported, you may perform many of the same operations on the sequence that you would on a single mesh. Many of the Object Modifiers work on the entire mesh sequence. Mesh sequences may be rendered in both Cycles and Eevee.
77

@@ -20,10 +20,12 @@ Stop Motion OBJ is able to import very complex mesh sequences that cannot fit in
2020

2121

2222
# Download & Install
23-
For Blender 2.80+, download the latest release [here](https://github.com/neverhood311/Stop-motion-OBJ/releases/latest). Make sure to download the file named Stop-motion-OBJ-v2.x.x.zip (don't download either of the “Source code” files).
23+
For Blender 2.92+, download the latest release [here](https://github.com/neverhood311/Stop-motion-OBJ/releases/latest). Make sure to download the file named Stop-motion-OBJ-v2.x.x.zip (don't download either of the “Source code” files).
2424

2525
To install, just follow the normal procedure for installing Blender addons. Open Blender and click Edit > Preferences... > Add-ons. Then click Install… and find the .zip file you previously downloaded. Once you’ve enabled the add-on, it should be ready to use immediately.
2626

27+
For Blender 2.91 and earlier, download [r2.1.1](https://github.com/neverhood311/Stop-motion-OBJ/releases/tag/v2.1.1)
28+
2729
For Blender 2.79 and earlier, download [r1.1.1](https://github.com/neverhood311/Stop-motion-OBJ/releases/tag/0.2.79.2). Note that this version is deprecated and will not be supported.
2830

2931
# Quick Start Tutorial

src/__init__.py

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ##### BEGIN GPL LICENSE BLOCK #####
22
#
33
# Stop motion OBJ: A Mesh sequence importer for Blender
4-
# Copyright (C) 2016-2020 Justin Jensen
4+
# Copyright (C) 2016-2024 Justin Jensen
55
#
66
# This program is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -23,41 +23,55 @@
2323

2424
bl_info = {
2525
"name": "Stop motion OBJ",
26-
"description": "Import a sequence of OBJ (or STL or PLY) files and display them each as a single frame of animation. This add-on also supports the .STL and .PLY file formats.",
26+
"description": "Import a sequence of OBJ (or STL or PLY or X3D or VRML2) files and display them each as a single frame of animation. This add-on also supports the .STL, .PLY, .X3D, and .WRL file formats.",
2727
"author": "Justin Jensen",
28-
"version": (2, 1, 1),
29-
"blender": (2, 80, 0),
28+
"version": (2, 2, 0, "beta.1"),
29+
"blender": (2, 92, 0),
3030
"location": "File > Import > Mesh Sequence",
3131
"warning": "",
3232
"category": "Import",
3333
"wiki_url": "https://github.com/neverhood311/Stop-motion-OBJ/wiki",
3434
"tracker_url": "https://github.com/neverhood311/Stop-motion-OBJ/issues"
3535
}
3636

37+
SMOKeymaps = []
3738

3839
def register():
40+
bpy.app.handlers.frame_change_pre.append(checkMeshChangesFrameChangePre)
41+
bpy.app.handlers.frame_change_post.append(checkMeshChangesFrameChangePost)
42+
3943
bpy.types.Mesh.inMeshSequence = bpy.props.BoolProperty()
44+
bpy.types.Mesh.meshHash = bpy.props.StringProperty()
4045
bpy.utils.register_class(SequenceVersion)
4146
bpy.utils.register_class(MeshImporter)
4247
bpy.utils.register_class(MeshNameProp)
4348
bpy.utils.register_class(MeshSequenceSettings)
4449
bpy.types.Object.mesh_sequence_settings = bpy.props.PointerProperty(type=MeshSequenceSettings)
4550
bpy.app.handlers.load_post.append(initializeSequences)
4651
bpy.app.handlers.frame_change_pre.append(updateFrame)
52+
53+
# note: Blender tends to crash in Rendered viewport mode if we set the depsgraph_update_post instead of depsgraph_update_pre
54+
bpy.app.handlers.depsgraph_update_pre.append(updateFrame)
4755
bpy.utils.register_class(ReloadMeshSequence)
4856
bpy.utils.register_class(BatchShadeSmooth)
4957
bpy.utils.register_class(BatchShadeFlat)
5058
bpy.utils.register_class(BakeMeshSequence)
5159
bpy.utils.register_class(DeepDeleteSequence)
60+
bpy.utils.register_class(MergeDuplicateMaterials)
61+
bpy.utils.register_class(ConvertToMeshSequence)
62+
bpy.utils.register_class(DuplicateMeshFrame)
5263
bpy.utils.register_class(SMO_PT_MeshSequencePanel)
64+
# note: the order of the next few panels is the order they appear in the UI
5365
bpy.utils.register_class(SMO_PT_MeshSequencePlaybackPanel)
5466
bpy.utils.register_class(SMO_PT_MeshSequenceStreamingPanel)
67+
bpy.utils.register_class(SMO_PT_MeshSequenceExportPanel)
5568
bpy.utils.register_class(SMO_PT_MeshSequenceAdvancedPanel)
5669
bpy.app.handlers.render_init.append(renderInitHandler)
5770
bpy.app.handlers.render_complete.append(renderCompleteHandler)
5871
bpy.app.handlers.render_cancel.append(renderCancelHandler)
5972

6073
bpy.types.TOPBAR_MT_file_import.append(menu_func_import_sequence)
74+
bpy.types.VIEW3D_MT_object.append(menu_func_convert_to_sequence)
6175

6276
# the order here is important since it is the order in which these sections will be drawn
6377
bpy.utils.register_class(SMO_PT_FileImportSettingsPanel)
@@ -69,10 +83,21 @@ def register():
6983
bpy.app.handlers.load_post.append(makeDirPathsRelative)
7084
bpy.app.handlers.save_pre.append(makeDirPathsRelative)
7185

86+
keyConfig = bpy.context.window_manager.keyconfigs.addon
87+
if keyConfig:
88+
spaceTypes = [('3D View', 'VIEW_3D'), ('Dopesheet', 'DOPESHEET_EDITOR'), ('Graph Editor', 'GRAPH_EDITOR')]
89+
for spaceType in spaceTypes:
90+
keyMap = keyConfig.keymaps.new(name=spaceType[0], space_type=spaceType[1])
91+
keyMapItem = keyMap.keymap_items.new('ms.duplicate_mesh_frame', type='D', value='PRESS', shift=True, ctrl=True)
92+
SMOKeymaps.append((keyMap, keyMapItem))
7293

7394
def unregister():
95+
bpy.app.handlers.frame_change_pre.remove(checkMeshChangesFrameChangePre)
96+
bpy.app.handlers.frame_change_post.remove(checkMeshChangesFrameChangePost)
97+
7498
bpy.app.handlers.load_post.remove(initializeSequences)
7599
bpy.app.handlers.frame_change_pre.remove(updateFrame)
100+
bpy.app.handlers.depsgraph_update_pre.remove(updateFrame)
76101
bpy.app.handlers.render_init.remove(renderInitHandler)
77102
bpy.app.handlers.render_complete.remove(renderCompleteHandler)
78103
bpy.app.handlers.render_cancel.remove(renderCancelHandler)
@@ -81,14 +106,19 @@ def unregister():
81106
bpy.utils.unregister_class(BatchShadeFlat)
82107
bpy.utils.unregister_class(BakeMeshSequence)
83108
bpy.utils.unregister_class(DeepDeleteSequence)
109+
bpy.utils.unregister_class(MergeDuplicateMaterials)
110+
bpy.utils.unregister_class(ConvertToMeshSequence)
111+
bpy.utils.unregister_class(DuplicateMeshFrame)
84112
bpy.utils.unregister_class(SMO_PT_MeshSequencePanel)
85113
bpy.utils.unregister_class(SMO_PT_MeshSequencePlaybackPanel)
86114
bpy.utils.unregister_class(SMO_PT_MeshSequenceStreamingPanel)
115+
bpy.utils.unregister_class(SMO_PT_MeshSequenceExportPanel)
87116
bpy.utils.unregister_class(SMO_PT_MeshSequenceAdvancedPanel)
88117
bpy.utils.unregister_class(MeshSequenceSettings)
89118
bpy.utils.unregister_class(MeshNameProp)
90119

91120
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import_sequence)
121+
bpy.types.VIEW3D_MT_object.remove(menu_func_convert_to_sequence)
92122
bpy.utils.unregister_class(SMO_PT_FileImportSettingsPanel)
93123
bpy.utils.unregister_class(SMO_PT_TransformSettingsPanel)
94124
bpy.utils.unregister_class(SMO_PT_SequenceImportSettingsPanel)
@@ -102,5 +132,9 @@ def unregister():
102132
bpy.app.handlers.load_post.remove(makeDirPathsRelative)
103133
bpy.app.handlers.save_pre.remove(makeDirPathsRelative)
104134

135+
for km, kmi in SMOKeymaps:
136+
km.keymap_items.remove(kmi)
137+
SMOKeymaps.clear()
138+
105139
if __name__ == "__main__":
106140
register()

0 commit comments

Comments
 (0)