Skip to content

Commit 6e44a1e

Browse files
Updated Documentation for package V1.0.2
1 parent a4a27b7 commit 6e44a1e

File tree

4 files changed

+83
-16
lines changed

4 files changed

+83
-16
lines changed

docs/content/en/docs/tutorials/distribution/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ toc: true
1616
## Build and ship
1717

1818
If you intent to distribute your Application built with the Unity Geometry Sequence Streamer, you need to consider where you store your geometry sequence.
19-
In Unity, the best way is to create a [**Streamingassets**](https://docs.unity3d.com/Manual/StreamingAssets.html) folder inside of your root Asset path, and store all geometry sequences in there. This folder will be copied into your build, so that all files remain intact.
19+
In Unity, you need to store all assets loaded at runtime in a [**Streamingassets**](https://docs.unity3d.com/Manual/StreamingAssets.html) folder ([exept for Android Builds](/docs/tutorials/distribution/#android)), located inside of the Asset path root, and store all geometry sequences in there. This folder will be copied into your build as-is.
2020

2121
1. Inside of the Unity project view, go to the "Assets" folder and create a **Streamingsassets** folder there:
2222

@@ -32,9 +32,9 @@ In Unity, the best way is to create a [**Streamingassets**](https://docs.unity3d
3232

3333
## Android
3434

35-
On Android, the StreamingAssets path is a special case. Data stored into this path, will be compressed into the .apk and needs to be decompressed on load. For large files, like geometry sequences, this will make a noticable impact on playback performance, therefore the Streamingassets path is not supported. On Android, you have to use the applications [**Persistent Data Path**](https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html). The persistent data path is a special path, which stores data spefically for the appliaction. However Unity won't copy the files automatically on build, you have to **copy them manually**.
35+
On Android, the StreamingAssets path is a special case. Data stored into this path, will be compressed into the .apk and needs to be decompressed on load. For large files, like geometry sequences, this will make a noticable impact on playback performance, therefore we don't support the Streamingassets path. On Android, you have to use the applications [**Persistent Data Path**](https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html). The persistent data path is a special path, reserved for application data on the device. Unlike the StreamingAssets path, Unity won't copy your files automatically to the persistent data path, instead, you have to **copy them manually**, or on distribution in the Play Store, let your application download them from a server.
3636

37-
> ⚠️The persistent data path will only be generated on the applications first run on the device. So you need to run the application once, then copy the files and then run the application again, or download the files onto the device before the Geometry Sequence Player runs.
37+
> ⚠️The persistent data path will only be generated on the applications first run on the device. So you need to run the application once, then copy the files and then run the application again, or let the app download the files onto the device before the Geometry Sequence Player runs.
3838
3939
1. Inside of your Geometry Sequence Player, set the **Path Relation** to **Relative to Persisten Data Path** and enter the relative path in which you later want to store your sequence, in this example we choose *"Sequence/MySequence"*.
4040

18.8 KB
Loading

docs/content/en/docs/tutorials/editor-playback/index.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,22 @@ After you've prepared and converted your sequence, you can now stream them from
2222

2323
## Playback
2424

25-
1. Open your Unity scene in which you want to implement the playback. We recommend that you create a new gameobject, onto which you can attach the streaming and playback scripts/components, but you can use any gameobject of your choice. ![New gameobject](editor_playback_gameobject.png)
25+
1. Open your Unity scene in which you want to implement the playback. We recommend that you create a new gameobject, onto which you can attach the streaming and playback scripts/components, but you can use any gameobject of your choice.
26+
![New gameobject](editor_playback_gameobject.png)
2627

27-
2. In the inspector, click on **"Add Component"**, search for **"Geometry Sequence Player"** and add this component. ![Add component](editor_playback_add_component.png)
28+
2. In the inspector, click on **"Add Component"**, search for **"Geometry Sequence Player"** and add this component.
29+
![Add component](editor_playback_add_component.png)
2830

2931
3. You should now see a Geometry Sequence Player and Geometry Sequence Stream component attached to your gameobject. Click on **"Open Sequence"** in the Player script, and then open the folder, in which your converted sequence is stored.
3032
> ⚠️ When you're just trying out playback on your machine, or you don't intent to distribute your app to other PCs, it's fine to store the sequence anywhere on disk. However, if you plan to distribute your application, [please take a look here](/docs/tutorials/distribution)!
3133
3234
![Open Sequence](editor_playback_open_sequence.png)
3335

34-
4. Set the **playback framerate** of your sequence. This should be the same framerate in which your animated sequence was exported. ![Set FPS](editor_playback_fps.png)
36+
4. Set the **playback framerate** of your sequence. This should be the same framerate in which your animated sequence was exported.
37+
![Set FPS](editor_playback_fps.png)
3538

36-
5. Click Play. You should now see your sequence playing back inside of your scene. If you don't see anything, it might simply be because your camera is not looking at the sequence. Go to the scene window, select the "Streamed Mesh" Gameobject and press **"F"** to focus on it. ![Focus Gameobject](editor_playback_focus.png)
39+
5. Click Play. You should now see your sequence playing back inside of your scene. If you don't see anything, it might simply be because your camera is not looking at the sequence. Go to the scene window, select the "Streamed Mesh" Gameobject and press **"F"** to focus on it.
40+
![Focus Gameobject](editor_playback_focus.png)
3741

3842
## Controls & Settings explained
3943

@@ -74,19 +78,25 @@ Use the **|<** Button to go back to the start of the sequence, the **<<** and **
7478

7579
![All player settings](editor_playback_stream_component.png)
7680

77-
These settings, expect for the materials, should usually not need to be adjusted.
81+
**Parent Transform**
82+
You can attach the streamed mesh onto a parent gameobject, which you can use to place, scale, and rotate your streamed mesh.
7883

79-
**Buffer size**
84+
**Pointcloud Material**
85+
Set an alternative material that is used for displaying pointclouds. If left empty, the supplied default material will be used. Please note that pointclouds **cannot use standard Unity Materials/Shaders!** You need to use a special Pointcloud shader, like the one provided in the package.
86+
87+
**Mesh material**
88+
Set an alternative material that is used for displaying pointclouds. If left empty, the supplied default material will be used.
89+
90+
**Buffer options:**
91+
92+
- **Buffer size**
8093
This size sets how many frames the streaming service will load from disk and store in a buffer in advance of the playback. A larger buffer might provide a smoother playback, however it also uses more memory and skipping/restarting playback might take longer, as the buffer needs to be flushed.
8194

82-
**Use all threads**
95+
- **Use all threads**
8396
Should the Unity Job system which is responsible for streaming use all available threads? If you deactive this, you can set the thread count yourself, but note that it will also effect other scripts that might use the job system!
8497

85-
**Thread count**
98+
- **Thread count**
8699
Set how many threads the job system should use. Is only used the **Use all threads** is deactivated. Will also effect other scripts that might use the job system!
87100

88-
**Pointcloud Material**
89-
Set an alternative material that is used for displaying pointclouds. If left empty, the supplied default material will be used. Please note that pointclouds **cannot use standard Unity Materials/Shaders!** You need to use a special Pointcloud shader, like the one provided in the package.
90-
91-
**Mesh material**
92-
Set an alternative material that is used for displaying pointclouds. If left empty, the supplied default material will be used.
101+
**Frame Info**
102+
This foldout contains read-only frame information. Used only for debugging.

docs/content/en/docs/tutorials/scripting-api/index.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ For more functions and precise playback control, please take a look below 👇
6868

6969
## Scripting Reference
7070

71+
### LoadSequence
72+
7173
`LoadSequence(string path, PathType relativeTo, float playbackFPS , (optional) bool autoplay)`
7274
Load a .ply sequence (and optionally textures) from the path, and start playback if autoplay is enabled.
7375
Parameters:
@@ -81,30 +83,63 @@ Returns:
8183

8284
- **True** when sequence could successfully be loaded, **false** when an error has occured while loading. Take a look in the Unity console in this case
8385

86+
### SetPath
87+
88+
`SetPath(string path, PathType relativeTo)`
89+
Set a new path in the player, but don't load the sequence. Use `ReloadSequence()` to actually load it, or LoadSequence() to do both at once.
90+
Parameters:
91+
92+
- `path`: The relative or absolute path to the folder containing the directory. Should end with a slash
93+
- `relativeTo`: Is the path relative to the [data path](https://docs.unity3d.com/ScriptReference/Application-dataPath.htmls), [streaming assets path](https://docs.unity3d.com/Manual/StreamingAssets.html), or is it an absolute path?
94+
95+
### ReloadSequence
96+
97+
`ReloadSequence((optional) bool autoplay)`
98+
(Re)Loads the sequence which is currently set in the player, optionally starts playback.
99+
Parameters:
100+
101+
- `autoplay` : Optional parameter, if set to true, playback starts directly after it has been loaded
102+
103+
Returns:
104+
105+
- **True** when sequence could successfully be reloaded, **false** when an error has occured while loading. Take a look in the Unity console in this case
106+
107+
### Play
108+
84109
`void Play()`
85110
Start Playback from the current location.
86111

112+
### Pause
113+
87114
`void Pause()`
88115
Pause current playback
89116

117+
### SetLoopPlay
118+
90119
`void SetLoopPlay(bool enabled)`
91120
Activate or deactivate looped playback
92121
Parameters:
93122

94123
- `enabled` : Set to true/false to enable/disable looped playback
95124

125+
### SetAutoStart
126+
96127
`void SetAutoStart(bool enabled)`
97128
Activate or deactivate automatic playback (when the scene starts)
98129
Parameters:
99130

100131
- `enabled` : Set to true/false to enable/disable automatic playback when the scene has started
101132

133+
### PlayFromStart
134+
102135
`bool PlayFromStart()`
103136
Seeks to the start of the sequence and then starts playback
104137
Returns:
105138

106139
- `True`, when the sequence could be started from the beginning `False` when there has been an error.
107140

141+
### GoToFrame
142+
108143
`bool GoToFrame(int frame)`
109144
Goes to a specific frame. Use GetTotalFrames() to check how many frames the clip contains
110145
Parameters:
@@ -115,70 +150,92 @@ Returns:
115150

116151
- `True` when skipping was successfull `False` if there has been an error, or the desired frame index was out of range
117152

153+
### GoToTime
154+
118155
`void GoToTime(float timeInSeconds)`
119156
Goes to a specific time in a clip. The time is dependent on the framerate e.g. the same clip at 30 FPS is twice as long as at 60 FPS.
120157
Parameters:
121158

122159
- `timeInSeconds` : The desired timestamp of the sequence to which you want to jump.
123160

161+
### GetSequencePath
162+
124163
`string GetSequencePath()`
125164
Gets the absolute path to the folder containing the sequence
126165
Returns:
127166

128167
- The absolute path to the Sequence currently used
129168

169+
### IsPlaying
170+
130171
`bool IsPlaying()`
131172
Is the current clip playing?
132173
Returns:
133174

134175
- `True` if the clip is playing `False` if it is paused, stopped or not loaded
135176

177+
### GetLoopingEnabled
178+
136179
`bool GetLoopingEnabled()`
137180
Is looped playback enabled?
138181
Returns:
139182

140183
- `True` if the playback is enabled `False` if it is disabled
141184

185+
### GetCurrentFrameIndex
186+
142187
`int GetCurrentFrameIndex()`
143188
At which frame is the playback currently?
144189
Returns:
145190

146191
- The frame index which is currently being played/shown
147192

193+
### GetCurrentTime
194+
148195
`float GetCurrentTime()`
149196
At which time is the playback currently in seconds?
150197
Note that the time is dependent on the framerate e.g. the same clip at 30 FPS is twice as long as at 60 FPS.
151198
Returns:
152199

153200
- The current timestamp of the clip in seconds
154201

202+
### GetTotalFrames
203+
155204
`int GetTotalFrames()`
156205
How many frames are there in total in the whole sequence?
157206
Returns:
158207

159208
- The total number of frames in the sequence
160209

210+
### GetTotalTime
211+
161212
`float GetTotalTime()`
162213
How long is the sequence in total?
163214
Note that the time is dependent on the framerate e.g. the same clip at 30 FPS is twice as long as at 60 FPS.
164215
Returns:
165216

166217
- The length of the sequence in seconds
167218

219+
### GetTargetFPS
220+
168221
`float GetTargetFPS()`
169222
The target fps is the framerate we _want_ to achieve in playback. However, this is not guranteed, if system resources
170223
are too low. Use GetActualFPS() to see if you actually achieve this framerate
171224
Returns:
172225

173226
- The playback framerate used currently for this clip
174227

228+
### GetActualFPS
229+
175230
`float GetActualFPS()`
176231
What is the actual current playback framerate? If the framerate is much lower than the target framerate,
177232
consider reducing the complexity of your sequence, and don't forget to disable any V-Sync (VSync, FreeSync, GSync) methods!
178233
Returns:
179234

180235
- The actual FPS at which your sequence is playing.
181236

237+
### GetFrameDropped
238+
182239
`bool GetFrameDropped()`
183240
Check if there have been framedrops since you last checked this function. You should pull this data every frame.
184241
Too many framedrops mean the system can't keep up with the playback

0 commit comments

Comments
 (0)