Skip to content

Commit 5076e23

Browse files
committed
add doc
1 parent cbba327 commit 5076e23

36 files changed

+576
-8
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ __pycache__/
88
rich
99
meshio
1010
future
11-
fileseq
11+
fileseq
12+
13+
docs/_build/*

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,21 @@ DISCLAIMER: Some of the screenshots may not be up to date with the most recent v
8787

8888
After installing addon, you can find it in the toolbar, which is accessible here or toggled by pressing the `n` key.
8989

90-
![start](images/0.png)
90+
![drag](images/drag.png)
9191

9292
Then you can find it here.
9393

94-
![homepage](images/1.png)
94+
![homepage](images/location.png)
9595

9696
### 2. Load the animation sequence you want
9797

9898
You can select the directory in which your data is located through the GUI by clicking the rightmost icon. It will open the default blender file explorer. Then you can go to the directory you want, for example, like image showed below. **You only need navigate to the directory and click "Accept". Files are shown but not selectable in this dialogue.**
9999

100-
![selecticon](images/2.png)
100+
![directory](images/directory.png)
101101

102102
Then the addon will automatically try to detect the sequences in this directory, so that you simply select the sequence you want. If the desired sequence is not shown, you can switch to enter a manual pattern, where a single `@` character is used to denote a running frame index.
103103

104-
![after_selecting](images/3.png)
104+
![sequence](images/sequence.png)
105105

106106
#### 2.1 Absolute vs. Relative Paths
107107

@@ -111,19 +111,19 @@ When toggled on, the blender file must be saved before loading the sequence. The
111111

112112
If toggled off (default), it will use absolute path to load the sequence. For this, the `.blend` file does not have to be saved in advance.
113113

114-
![relative_path](images/4.png)
114+
![relative_path](images/path.png)
115115

116116
#### 2.2 Sequence List View
117117

118118
After the sequence being imported, it will be available in the `Imported Sequences` panel, with more settings being available in `Sequence Settings` panel once a sequence has been selected.
119119

120-
![settings](images/5.png)
120+
![settings](images/list.png)
121121

122122
By default, all supported file formats are simply imported as geometry (a collection of vertices, lines, triangles and quads). As such, you should be able to directly play/render the animation if it contains geometry.
123123

124124
Note: When rendering the animation, please turn on the `Lock Interface`. This will prevent artifacts from occurring, especially if the user continues to operate the Blender interface during the render process.
125125

126-
![lock interface](images/6.png)
126+
![lock interface](images/lock.png)
127127

128128
##### 2.2.1 Enable/ Disable
129129

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/about.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Description
2+
3+
This is an addon for Blender 3.1+ (might work with 2.8+ but has not been tested) that enables loading of file sequences. The addon comes bundled together with [meshio](https://github.com/nschloe/meshio) which enables the loading of geometric data from a multitude of [file formats](./format.md).
4+
5+
All data is loaded *just-in-time* when the Blender frame changes, in order to avoid excessive memory consumption. By default, the addon is able to load vertices, lines, triangles and quads. It is also able to automatically extract triangle and quad surface meshes from tetrahedral and hexahedral volume meshes. Scalar and vector attributes on vertices are also imported for visualization purposes.
6+
7+
## Basic usage
8+
9+
Here is a gif to show the basic usage of this addon. In this gif, it shows how to load and render a sequence of particles data
10+
11+
![usage](../images/usage.gif)
12+
13+
## Affected Blender Settings
14+
15+
This addon will change the value of `Preferences`->`Save & Load` ->`Default To` ->`Relative Paths` to `false`. Default value is `true`. For information can be found [here](https://docs.blender.org/manual/en/latest/editors/preferences/save_load.html#blend-files).
16+
17+
18+
## Dependencies
19+
20+
|name | link | license| description|
21+
|---|---|---|---|
22+
|meshio | [link](https://github.com/nschloe/meshio) | MIT| import the mesh|
23+
|fileseq | [link](https://github.com/justinfx/fileseq) | MIT | detect and load file sequences|
24+
| rich | [link](https://github.com/Textualize/rich) | MIT| dependency of meshio |
25+
| python-future | [link](https://github.com/PythonCharmers/python-future) | MIT| dependency of fileseq|
26+
27+
## License
28+
29+
MIT License
30+
31+
Copyright (c) 2022 Interactive Computer Graphics
32+
33+
Permission is hereby granted, free of charge, to any person obtaining a copy
34+
of this software and associated documentation files (the "Software"), to deal
35+
in the Software without restriction, including without limitation the rights
36+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37+
copies of the Software, and to permit persons to whom the Software is
38+
furnished to do so, subject to the following conditions:
39+
40+
The above copyright notice and this permission notice shall be included in all
41+
copies or substantial portions of the Software.
42+
43+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49+
SOFTWARE.

docs/build.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Build and install the addon
2+
3+
4+
## Build from source
5+
6+
7+
1. Clone the project to download both project and dependencies
8+
9+
```shell
10+
git clone https://github.com/InteractiveComputerGraphics/blender-sequence-loader.git --recurse-submodules
11+
```
12+
13+
2. Build the installable .zip file by simply running the following command. This should produce a file called `blender_sequence_loader_{date}.zip`, where `{date}` is replaced with todays date. No other dependency other than standard python3 libraries are needed to build the addon.
14+
15+
```python
16+
python3 build_addon.py
17+
```
18+
19+
20+
## Download from release page
21+
22+
Or you can simply download the latest `.zip` file from the [release](https://github.com/InteractiveComputerGraphics/blender-sequence-loader/releases) page
23+
24+
## Install the zip file
25+
26+
You can check [here](https://docs.blender.org/manual/en/latest/editors/preferences/addons.html#installing-add-ons) for installing and enabling the addon.
27+
28+
## For developers
29+
30+
If you want to develop this addon, using soft link (on Linux/macOS) / [Symlinks](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/) (on Windows) can be very helpful.
31+
32+
### *-nix Users
33+
34+
Once you have cloned the project, go to the root directory of this addon, you can create symlink as follows
35+
```bash
36+
ln -s extern/meshio/src/meshio meshio
37+
ln -s extern/rich/rich/ rich
38+
ln -s extern/fileseq/src/fileseq fileseq
39+
ln -s extern/python-future/src/future/ future
40+
```
41+
42+
Then create a soft link to link from the [blender addon directory](https://docs.blender.org/manual/en/latest/advanced/blender_directory_layout.html)[^1] to the directory where you download and unzip the files. For example,
43+
```bash
44+
ln -s ~/Downloads/blender-sequence-loader ~/Library/Application Support/Blender/3.1/scripts/addons/blender-sequence-loader-dev
45+
```
46+
47+
[^1]: By default, `{USER}/scripts/addons`, `{USER}`: Location of configuration files (typically in the user’s home directory).
48+
49+
50+
### Windows Users
51+
52+
You can use [mklink](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mklink) to do the same things as *-nix users. [^2]
53+
54+
[^2]: You will need either administrator permission, or [developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development).
55+

docs/conf.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = 'blender-sequence-loader'
10+
copyright = '2022, InteractiveComputerGraphics'
11+
author = 'InteractiveComputerGraphics'
12+
release = '0.1.2'
13+
14+
# -- General configuration ---------------------------------------------------
15+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
16+
17+
extensions = ['myst_parser','sphinx_rtd_theme']
18+
19+
templates_path = ['_templates']
20+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
21+
22+
23+
24+
# -- Options for HTML output -------------------------------------------------
25+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
26+
27+
html_theme = "sphinx_rtd_theme"
28+
html_static_path = ['_static']
29+
30+
31+
myst_heading_anchors = 2

docs/format.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# File Formats
2+
3+
The current file formats supported by [meshio](https://github.com/nschloe/meshio) [^1] are
4+
5+
> [Abaqus](http://abaqus.software.polimi.it/v6.14/index.html) (`.inp`),
6+
> ANSYS msh (`.msh`),
7+
> [AVS-UCD](https://lanl.github.io/LaGriT/pages/docs/read_avs.html) (`.avs`),
8+
> [CGNS](https://cgns.github.io/) (`.cgns`),
9+
> [DOLFIN XML](https://manpages.ubuntu.com/manpages/jammy/en/man1/dolfin-convert.1.html) (`.xml`),
10+
> [Exodus](https://nschloe.github.io/meshio/exodus.pdf) (`.e`, `.exo`),
11+
> [FLAC3D](https://www.itascacg.com/software/flac3d) (`.f3grid`),
12+
> [H5M](https://www.mcs.anl.gov/~fathom/moab-docs/h5mmain.html) (`.h5m`),
13+
> [Kratos/MDPA](https://github.com/KratosMultiphysics/Kratos/wiki/Input-data) (`.mdpa`),
14+
> [Medit](https://people.sc.fsu.edu/~jburkardt/data/medit/medit.html) (`.mesh`, `.meshb`),
15+
> [MED/Salome](https://docs.salome-platform.org/latest/dev/MEDCoupling/developer/med-file.html) (`.med`),
16+
> [Nastran](https://help.autodesk.com/view/NSTRN/2019/ENU/?guid=GUID-42B54ACB-FBE3-47CA-B8FE-475E7AD91A00) (bulk data, `.bdf`, `.fem`, `.nas`),
17+
> [Netgen](https://github.com/ngsolve/netgen) (`.vol`, `.vol.gz`),
18+
> [Neuroglancer precomputed format](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed#mesh-representation-of-segmented-object-surfaces),
19+
> [Gmsh](https://gmsh.info/doc/texinfo/gmsh.html#File-formats) (format versions 2.2, 4.0, and 4.1, `.msh`),
20+
> [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) (`.obj`),
21+
> [OFF](https://segeval.cs.princeton.edu/public/off_format.html) (`.off`),
22+
> [PERMAS](https://www.intes.de) (`.post`, `.post.gz`, `.dato`, `.dato.gz`),
23+
> [PLY](<https://en.wikipedia.org/wiki/PLY_(file_format)>) (`.ply`),
24+
> [STL](<https://en.wikipedia.org/wiki/STL_(file_format)>) (`.stl`),
25+
> [Tecplot .dat](http://paulbourke.net/dataformats/tp/),
26+
> [TetGen .node/.ele](https://wias-berlin.de/software/tetgen/fformats.html),
27+
> [SVG](https://www.w3.org/TR/SVG/) (2D output only) (`.svg`),
28+
> [SU2](https://su2code.github.io/docs_v7/Mesh-File/) (`.su2`),
29+
> [UGRID](https://www.simcenter.msstate.edu/software/documentation/ug_io/3d_grid_file_type_ugrid.html) (`.ugrid`),
30+
> [VTK](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf) (`.vtk`),
31+
> [VTU](https://vtk.org/Wiki/VTK_XML_Formats) (`.vtu`),
32+
> [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) ([TIN](https://en.wikipedia.org/wiki/Triangulated_irregular_network)) (`.wkt`),
33+
> [XDMF](https://xdmf.org/index.php/XDMF_Model_and_Format) (`.xdmf`, `.xmf`).
34+
35+
The additionally supported file formats are
36+
37+
> [bgeo](https://github.com/wdas/partio)(`.bgeo`) [^2]
38+
> [mzd](https://github.com/InteractiveComputerGraphics/MayaMeshTools/tree/main/extern/mzd)(`.mzd`)
39+
40+
[^1]: Not all of the formats have been tested for this addon and some issues may still occur.
41+
42+
[^2]: The addon only supports particle-only `.bgeo` files
43+
44+
## Add support for customized file formats
45+
46+
You can add support for your customized file formats. For example, if you want to support `.example` file formats.
47+
48+
To do that,
49+
1. Create a `example.py` file in the folder additional_file_formats
50+
2. Implement a function `def readexample_to_meshio(filepath):`, which reads the file from `filepath`, then construct a [meshio.Mesh](https://github.com/nschloe/meshio/wiki/meshio-Mesh()-data-structure) object.
51+
3. Add `meshio.register_format("example", [".example"], readexample_to_meshio, {".example": None})` in the global space
52+
4. Add `from . import example` in `additional_file_formats/__init__.py`
53+
54+
You can check [additional_file_formats/bgeo.py](https://github.com/InteractiveComputerGraphics/blender-sequence-loader/blob/main/additional_file_formats/bgeo.py) as an example.

docs/frame.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Frame control
2+
3+
4+
You can use blender [driver system](https://docs.blender.org/manual/en/latest/animation/drivers/index.html) to control the frame of the sequence.
5+
6+
## Default settings
7+
8+
Each sequence has its own property `Current Frame` to control its frame. By default, the value equals to the [blender current frame](https://docs.blender.org/manual/en/latest/editors/timeline.html#frame-controls).
9+
10+
![current frame](../images/current_frame.png)
11+
12+
13+
## Change the value
14+
15+
Right click on the `Current Frame` property, then click `Edit Driver`. You can check [here](https://docs.blender.org/manual/en/latest/animation/drivers/drivers_panel.html) for more details about how to edit the driver.
16+
17+
![edit frame](../images/edit_driver.png)
18+

docs/global.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Global Settings
2+
3+
There are two global settings
4+
1. Print information: default on
5+
1. Auto Refresh: default off
6+
7+
## Print information
8+
9+
When this button toggled, it will print information about the sequence imported by this addon, such as name of the object into a file.
10+
11+
The file has the name `bseq_{time}`, `{time}` is the time when rendering starts.
12+
13+
The file will be in the same direction as [blender render output directory](https://docs.blender.org/manual/en/latest/editors/preferences/file_paths.html#render). [^1]
14+
15+
![print](../images/print.png)
16+
17+
[^1]: By default the value is `/tmp`, and this directory does not exit on windows system. So when the directory does not exist, it won't print information into file.
18+
19+
20+
## Auto Refresh
21+
22+
When this button toggled, it will [refresh](./list.md#refresh) **all the sequence whenever frame changes**.
23+
24+
This option can be useful when some of the sequences are imported while the data is still being generated and not yet complete. Refreshing all the sequences can detect the frames added after being imported.
25+
26+
![auto refresh](../images/auto_refresh.png)

docs/index.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. blender-sequence-loader documentation master file, created by
2+
sphinx-quickstart on Sun Oct 2 13:42:11 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to blender-sequence-loader's documentation!
7+
===================================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
about
14+
build
15+
usage
16+
global
17+
18+
list
19+
settings
20+
21+
.. toctree::
22+
:maxdepth: 2
23+
:caption: Advanced:
24+
25+
format
26+
frame
27+
script
28+
29+
30+
31+
Indices and tables
32+
==================
33+
34+
* :ref:`genindex`
35+
* :ref:`search`

docs/list.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# List View
2+
3+
By default, all supported file formats are simply imported as geometry (a collection of vertices, lines, triangles and quads). As such, you should be able to directly play/render the animation if it contains geometry.
4+
5+
Note: When rendering the animation, please turn on the [Lock Interface](https://docs.blender.org/manual/en/latest/interface/window_system/topbar.html?#render-menu)[^1]. This will prevent artifacts from occurring, especially if the user continues to operate the Blender interface during the render process.
6+
7+
![lock](../images/lock.png)
8+
9+
[^1]: Or maybe not, I am not 100% percent sure about this.
10+
11+
## Imported Sequence
12+
13+
Here you can have an overview of all the sequence imported by this addon. And you can select either one of them, it will change [active object](https://docs.blender.org/manual/en/latest/scene_layout/object/selecting.html#selections-and-the-active-object) to it as well. When [active object](https://docs.blender.org/manual/en/latest/scene_layout/object/selecting.html#selections-and-the-active-object) changes, it will change the selection in this list view as well.
14+
15+
![list](../images/list.png)
16+
17+
## Enable & Disable
18+
19+
It is possible to individually enable and disable sequences from updating when the animation frame changes. This is very useful when working with very large files or many sequences as it reduces the computational overhead of loading these sequences. Enabled means, that the sequence will be updated on frame change, and Disabled means that the sequence won't be updated on frame change.
20+
21+
To change individual sequence, you can click on the `ENABLED` or `DISABLED` button in the list view.
22+
23+
![enable](../images/enable.png)
24+
25+
### Enable Selected & Disable Selected
26+
27+
When you want to enable or disable multiple sequences. You can [select](https://docs.blender.org/manual/en/latest/scene_layout/object/selecting.html) multiple objects, then click `Enable Selected` or `Disable Selected` to enable/disable all selected objects.
28+
29+
30+
## Current Frame
31+
32+
`Current Frame` shows the current frame of sequence being loaded. By default, the value is [blender current frame](https://docs.blender.org/manual/en/latest/editors/timeline.html#frame-controls). For advanced usage, you can find it [here](./frame.md).
33+
34+
## Refresh
35+
36+
Refresh Sequence can be useful when the sequence is imported while the data is still being generated and not yet complete. Refreshing the sequence can detect the frames added after being imported.

0 commit comments

Comments
 (0)