goodnavigate 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- goodnavigate-0.1.0/PKG-INFO +287 -0
- goodnavigate-0.1.0/README.md +272 -0
- goodnavigate-0.1.0/pyproject.toml +35 -0
- goodnavigate-0.1.0/setup.cfg +4 -0
- goodnavigate-0.1.0/src/GoodNavigate.py +7 -0
- goodnavigate-0.1.0/src/goodnavigate/__init__.py +727 -0
- goodnavigate-0.1.0/src/goodnavigate/goodnavigate_overlay_bg.png +0 -0
- goodnavigate-0.1.0/src/goodnavigate.egg-info/PKG-INFO +287 -0
- goodnavigate-0.1.0/src/goodnavigate.egg-info/SOURCES.txt +9 -0
- goodnavigate-0.1.0/src/goodnavigate.egg-info/dependency_links.txt +1 -0
- goodnavigate-0.1.0/src/goodnavigate.egg-info/top_level.txt +2 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: goodnavigate
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Comfortable camera navigation helper for WorldViz Vizard 8
|
|
5
|
+
Author: cuber244
|
|
6
|
+
Project-URL: Homepage, https://github.com/cuber244/goodnavigate
|
|
7
|
+
Project-URL: Repository, https://github.com/cuber244/goodnavigate
|
|
8
|
+
Keywords: vizard,worldviz,camera,navigation,vr
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Multimedia :: Graphics :: 3D Rendering
|
|
13
|
+
Requires-Python: >=3.7
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# GoodNavigate
|
|
17
|
+
|
|
18
|
+
GoodNavigate is a camera navigation helper package for **WorldViz Vizard 8**.
|
|
19
|
+
It adds comfortable editor-style camera controls to a Vizard scene with one call.
|
|
20
|
+
|
|
21
|
+
This package depends on Vizard's `viz` and `vizact` modules, so it is intended to run inside a Vizard 8 Python environment. It is not a standalone Python camera library.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- Mouse-look camera rotation
|
|
26
|
+
- `WASD` camera movement
|
|
27
|
+
- Height-locked horizontal movement mode
|
|
28
|
+
- `F` key toggle for height lock
|
|
29
|
+
- Customizable movement keys
|
|
30
|
+
- Runtime speed and mouse sensitivity setters
|
|
31
|
+
- Current status dictionary
|
|
32
|
+
- Stops movement when the Vizard window loses focus
|
|
33
|
+
- `Space` to move up
|
|
34
|
+
- `C` to move down
|
|
35
|
+
- `Shift` for temporary fast movement
|
|
36
|
+
- Mouse wheel speed adjustment
|
|
37
|
+
- Center-screen speed multiplier overlay
|
|
38
|
+
- Rounded gray overlay background
|
|
39
|
+
- No automatic `viz.go()` when imported
|
|
40
|
+
- `pause()`, `resume()`, and `disable()` control helpers
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Install it into the Python environment used by Vizard 8.
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
python -m pip install git+https://github.com/cuber244/goodnavigate.git
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If `python` is not Vizard's Python, run pip through the Vizard Python executable instead. The exact path depends on your PC, but the command will look like this:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
"C:\Path\To\Vizard8\python.exe" -m pip install git+https://github.com/cuber244/goodnavigate.git
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
After the package is published to PyPI, installation becomes shorter:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
python -m pip install goodnavigate
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Basic Usage
|
|
63
|
+
|
|
64
|
+
Use the lowercase package name for new Vizard scripts.
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import viz
|
|
68
|
+
import goodnavigate
|
|
69
|
+
|
|
70
|
+
viz.go()
|
|
71
|
+
|
|
72
|
+
goodnavigate.enable()
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Importing `goodnavigate` does not start Vizard and does not add scene objects. Call `goodnavigate.enable()` after `viz.go()` in the script that owns the scene.
|
|
76
|
+
|
|
77
|
+
For compatibility, `import GoodNavigate` is also included after pip installation:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import viz
|
|
81
|
+
import GoodNavigate
|
|
82
|
+
|
|
83
|
+
viz.go()
|
|
84
|
+
GoodNavigate.enable()
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Controls
|
|
88
|
+
|
|
89
|
+
| Input | Action |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| Left mouse drag | Horizontal yaw rotation, pitch is leveled when drag starts |
|
|
92
|
+
| Right mouse drag | Free-look yaw and pitch rotation |
|
|
93
|
+
| `W` / `S` | Move forward / backward |
|
|
94
|
+
| `A` / `D` | Move left / right |
|
|
95
|
+
| `Space` | Move up |
|
|
96
|
+
| `C` | Move down |
|
|
97
|
+
| `Shift` | Temporary fast movement |
|
|
98
|
+
| Mouse wheel | Change movement speed multiplier |
|
|
99
|
+
| `F` | Toggle height lock |
|
|
100
|
+
|
|
101
|
+
`F` is handled through Vizard's key-down callback when available. If that callback is unavailable, GoodNavigate falls back to polling the key state each frame.
|
|
102
|
+
|
|
103
|
+
## Height Lock
|
|
104
|
+
|
|
105
|
+
Height lock is enabled by default.
|
|
106
|
+
|
|
107
|
+
When height lock is enabled, `WASD` movement stays horizontal even if the camera is looking up or down. This is useful for walking-style navigation.
|
|
108
|
+
|
|
109
|
+
When height lock is disabled, `W` and `S` move forward and backward along the camera's pitch direction. Looking up and pressing `W` moves upward and forward; looking down and pressing `W` moves downward and forward. `A` and `D` strafe relative to the current yaw.
|
|
110
|
+
|
|
111
|
+
Toggle height lock while running:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# Press F in the Vizard window
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Configure the initial mode:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
goodnavigate.enable(height_lock=True) # default
|
|
121
|
+
goodnavigate.enable(height_lock=False) # free fly movement
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Programmatic control:
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
navigator = goodnavigate.enable()
|
|
128
|
+
|
|
129
|
+
navigator.set_height_lock(False)
|
|
130
|
+
navigator.toggle_height_lock()
|
|
131
|
+
locked = navigator.is_height_locked()
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Custom Keys
|
|
135
|
+
|
|
136
|
+
You can customize movement keys when enabling GoodNavigate.
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
goodnavigate.enable(
|
|
140
|
+
forward_key='i',
|
|
141
|
+
backward_key='k',
|
|
142
|
+
left_key='j',
|
|
143
|
+
right_key='l',
|
|
144
|
+
up_key='u',
|
|
145
|
+
down_key='o',
|
|
146
|
+
toggle_height_lock_key='h',
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Temporary fast movement keys can also be changed. Pass a tuple or list of Vizard key constants or key strings.
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
goodnavigate.enable(fast_keys=(viz.KEY_SHIFT_L, viz.KEY_SHIFT_R))
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
You can change keys after enabling:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
navigator = goodnavigate.enable()
|
|
160
|
+
navigator.set_keys(forward='i', backward='k', toggle_height_lock='h')
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Speed Adjustment
|
|
164
|
+
|
|
165
|
+
The mouse wheel changes the movement speed multiplier.
|
|
166
|
+
|
|
167
|
+
- Default multiplier: `x1.00`
|
|
168
|
+
- Minimum multiplier: `x0.25`
|
|
169
|
+
- Maximum multiplier: `x5.00`
|
|
170
|
+
- Step per wheel operation: `0.25`
|
|
171
|
+
|
|
172
|
+
When the speed changes, or when the user scrolls at the minimum/maximum limit, the current multiplier is shown in the center of the screen for 1 second.
|
|
173
|
+
|
|
174
|
+
## Configuration
|
|
175
|
+
|
|
176
|
+
You can customize the base movement speed, fast movement multiplier, mouse sensitivity, initial speed multiplier, and initial height lock mode.
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
goodnavigate.enable(
|
|
180
|
+
speed=2.0,
|
|
181
|
+
fast_mult=3.0,
|
|
182
|
+
sense=0.2,
|
|
183
|
+
speed_mult=1.0,
|
|
184
|
+
height_lock=True,
|
|
185
|
+
check_window_focus=True,
|
|
186
|
+
)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Disable the speed overlay if needed:
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
goodnavigate.enable(show_speed_overlay=False)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Runtime setters:
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
navigator = goodnavigate.enable()
|
|
199
|
+
|
|
200
|
+
navigator.set_speed(3.0)
|
|
201
|
+
navigator.set_fast_mult(4.0)
|
|
202
|
+
navigator.set_sense(0.15)
|
|
203
|
+
navigator.set_speed_mult(2.0)
|
|
204
|
+
navigator.reset_speed_mult()
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Status
|
|
208
|
+
|
|
209
|
+
Get the current controller state as a dictionary:
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
navigator = goodnavigate.enable()
|
|
213
|
+
status = navigator.get_status()
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The dictionary includes values such as `enabled`, `height_lock`, `speed`, `fast_mult`, `sense`, `speed_mult`, and current key bindings.
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
## Window Focus Safety
|
|
220
|
+
|
|
221
|
+
GoodNavigate stops movement when the Vizard window loses focus. This prevents held movement keys from remaining active after clicking another window.
|
|
222
|
+
|
|
223
|
+
This behavior is enabled by default:
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
goodnavigate.enable(check_window_focus=True)
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
If you need to disable the focus check for a special setup, pass:
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
goodnavigate.enable(check_window_focus=False)
|
|
233
|
+
```
|
|
234
|
+
## Pause, Resume, Disable
|
|
235
|
+
|
|
236
|
+
Pause GoodNavigate controls without returning Vizard mouse handling to its default behavior:
|
|
237
|
+
|
|
238
|
+
```python
|
|
239
|
+
goodnavigate.pause()
|
|
240
|
+
goodnavigate.resume()
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Disable GoodNavigate controls and return mouse handling to Vizard defaults:
|
|
244
|
+
|
|
245
|
+
```python
|
|
246
|
+
goodnavigate.disable()
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
You can also call these on the navigator object:
|
|
250
|
+
|
|
251
|
+
```python
|
|
252
|
+
navigator = goodnavigate.enable()
|
|
253
|
+
navigator.pause()
|
|
254
|
+
navigator.resume()
|
|
255
|
+
navigator.disable()
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Using A Different View
|
|
259
|
+
|
|
260
|
+
By default, GoodNavigate controls `viz.MainView`. You can pass another Vizard view object.
|
|
261
|
+
|
|
262
|
+
```python
|
|
263
|
+
my_view = viz.MainView
|
|
264
|
+
goodnavigate.enable(view=my_view)
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Repository Layout
|
|
268
|
+
|
|
269
|
+
```text
|
|
270
|
+
pyproject.toml
|
|
271
|
+
README.md
|
|
272
|
+
src/
|
|
273
|
+
goodnavigate/
|
|
274
|
+
__init__.py
|
|
275
|
+
goodnavigate_overlay_bg.png
|
|
276
|
+
GoodNavigate.py
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
`src/goodnavigate/goodnavigate_overlay_bg.png` is packaged with the module and is used for the rounded gray speed overlay background.
|
|
280
|
+
|
|
281
|
+
The root-level `GoodNavigate.py` file can still be copied directly into a Vizard project if you want a no-pip workflow, but pip users should use the `src/` package.
|
|
282
|
+
|
|
283
|
+
## Requirements
|
|
284
|
+
|
|
285
|
+
- WorldViz Vizard 8
|
|
286
|
+
- Vizard Python environment with `viz` and `vizact`
|
|
287
|
+
- pip available in the Vizard Python environment
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# GoodNavigate
|
|
2
|
+
|
|
3
|
+
GoodNavigate is a camera navigation helper package for **WorldViz Vizard 8**.
|
|
4
|
+
It adds comfortable editor-style camera controls to a Vizard scene with one call.
|
|
5
|
+
|
|
6
|
+
This package depends on Vizard's `viz` and `vizact` modules, so it is intended to run inside a Vizard 8 Python environment. It is not a standalone Python camera library.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- Mouse-look camera rotation
|
|
11
|
+
- `WASD` camera movement
|
|
12
|
+
- Height-locked horizontal movement mode
|
|
13
|
+
- `F` key toggle for height lock
|
|
14
|
+
- Customizable movement keys
|
|
15
|
+
- Runtime speed and mouse sensitivity setters
|
|
16
|
+
- Current status dictionary
|
|
17
|
+
- Stops movement when the Vizard window loses focus
|
|
18
|
+
- `Space` to move up
|
|
19
|
+
- `C` to move down
|
|
20
|
+
- `Shift` for temporary fast movement
|
|
21
|
+
- Mouse wheel speed adjustment
|
|
22
|
+
- Center-screen speed multiplier overlay
|
|
23
|
+
- Rounded gray overlay background
|
|
24
|
+
- No automatic `viz.go()` when imported
|
|
25
|
+
- `pause()`, `resume()`, and `disable()` control helpers
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
Install it into the Python environment used by Vizard 8.
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
python -m pip install git+https://github.com/cuber244/goodnavigate.git
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If `python` is not Vizard's Python, run pip through the Vizard Python executable instead. The exact path depends on your PC, but the command will look like this:
|
|
36
|
+
|
|
37
|
+
```powershell
|
|
38
|
+
"C:\Path\To\Vizard8\python.exe" -m pip install git+https://github.com/cuber244/goodnavigate.git
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
After the package is published to PyPI, installation becomes shorter:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
python -m pip install goodnavigate
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Basic Usage
|
|
48
|
+
|
|
49
|
+
Use the lowercase package name for new Vizard scripts.
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
import viz
|
|
53
|
+
import goodnavigate
|
|
54
|
+
|
|
55
|
+
viz.go()
|
|
56
|
+
|
|
57
|
+
goodnavigate.enable()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Importing `goodnavigate` does not start Vizard and does not add scene objects. Call `goodnavigate.enable()` after `viz.go()` in the script that owns the scene.
|
|
61
|
+
|
|
62
|
+
For compatibility, `import GoodNavigate` is also included after pip installation:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
import viz
|
|
66
|
+
import GoodNavigate
|
|
67
|
+
|
|
68
|
+
viz.go()
|
|
69
|
+
GoodNavigate.enable()
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Controls
|
|
73
|
+
|
|
74
|
+
| Input | Action |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| Left mouse drag | Horizontal yaw rotation, pitch is leveled when drag starts |
|
|
77
|
+
| Right mouse drag | Free-look yaw and pitch rotation |
|
|
78
|
+
| `W` / `S` | Move forward / backward |
|
|
79
|
+
| `A` / `D` | Move left / right |
|
|
80
|
+
| `Space` | Move up |
|
|
81
|
+
| `C` | Move down |
|
|
82
|
+
| `Shift` | Temporary fast movement |
|
|
83
|
+
| Mouse wheel | Change movement speed multiplier |
|
|
84
|
+
| `F` | Toggle height lock |
|
|
85
|
+
|
|
86
|
+
`F` is handled through Vizard's key-down callback when available. If that callback is unavailable, GoodNavigate falls back to polling the key state each frame.
|
|
87
|
+
|
|
88
|
+
## Height Lock
|
|
89
|
+
|
|
90
|
+
Height lock is enabled by default.
|
|
91
|
+
|
|
92
|
+
When height lock is enabled, `WASD` movement stays horizontal even if the camera is looking up or down. This is useful for walking-style navigation.
|
|
93
|
+
|
|
94
|
+
When height lock is disabled, `W` and `S` move forward and backward along the camera's pitch direction. Looking up and pressing `W` moves upward and forward; looking down and pressing `W` moves downward and forward. `A` and `D` strafe relative to the current yaw.
|
|
95
|
+
|
|
96
|
+
Toggle height lock while running:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
# Press F in the Vizard window
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Configure the initial mode:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
goodnavigate.enable(height_lock=True) # default
|
|
106
|
+
goodnavigate.enable(height_lock=False) # free fly movement
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Programmatic control:
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
navigator = goodnavigate.enable()
|
|
113
|
+
|
|
114
|
+
navigator.set_height_lock(False)
|
|
115
|
+
navigator.toggle_height_lock()
|
|
116
|
+
locked = navigator.is_height_locked()
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Custom Keys
|
|
120
|
+
|
|
121
|
+
You can customize movement keys when enabling GoodNavigate.
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
goodnavigate.enable(
|
|
125
|
+
forward_key='i',
|
|
126
|
+
backward_key='k',
|
|
127
|
+
left_key='j',
|
|
128
|
+
right_key='l',
|
|
129
|
+
up_key='u',
|
|
130
|
+
down_key='o',
|
|
131
|
+
toggle_height_lock_key='h',
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Temporary fast movement keys can also be changed. Pass a tuple or list of Vizard key constants or key strings.
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
goodnavigate.enable(fast_keys=(viz.KEY_SHIFT_L, viz.KEY_SHIFT_R))
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You can change keys after enabling:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
navigator = goodnavigate.enable()
|
|
145
|
+
navigator.set_keys(forward='i', backward='k', toggle_height_lock='h')
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Speed Adjustment
|
|
149
|
+
|
|
150
|
+
The mouse wheel changes the movement speed multiplier.
|
|
151
|
+
|
|
152
|
+
- Default multiplier: `x1.00`
|
|
153
|
+
- Minimum multiplier: `x0.25`
|
|
154
|
+
- Maximum multiplier: `x5.00`
|
|
155
|
+
- Step per wheel operation: `0.25`
|
|
156
|
+
|
|
157
|
+
When the speed changes, or when the user scrolls at the minimum/maximum limit, the current multiplier is shown in the center of the screen for 1 second.
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
You can customize the base movement speed, fast movement multiplier, mouse sensitivity, initial speed multiplier, and initial height lock mode.
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
goodnavigate.enable(
|
|
165
|
+
speed=2.0,
|
|
166
|
+
fast_mult=3.0,
|
|
167
|
+
sense=0.2,
|
|
168
|
+
speed_mult=1.0,
|
|
169
|
+
height_lock=True,
|
|
170
|
+
check_window_focus=True,
|
|
171
|
+
)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Disable the speed overlay if needed:
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
goodnavigate.enable(show_speed_overlay=False)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Runtime setters:
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
navigator = goodnavigate.enable()
|
|
184
|
+
|
|
185
|
+
navigator.set_speed(3.0)
|
|
186
|
+
navigator.set_fast_mult(4.0)
|
|
187
|
+
navigator.set_sense(0.15)
|
|
188
|
+
navigator.set_speed_mult(2.0)
|
|
189
|
+
navigator.reset_speed_mult()
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Status
|
|
193
|
+
|
|
194
|
+
Get the current controller state as a dictionary:
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
navigator = goodnavigate.enable()
|
|
198
|
+
status = navigator.get_status()
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The dictionary includes values such as `enabled`, `height_lock`, `speed`, `fast_mult`, `sense`, `speed_mult`, and current key bindings.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
## Window Focus Safety
|
|
205
|
+
|
|
206
|
+
GoodNavigate stops movement when the Vizard window loses focus. This prevents held movement keys from remaining active after clicking another window.
|
|
207
|
+
|
|
208
|
+
This behavior is enabled by default:
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
goodnavigate.enable(check_window_focus=True)
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
If you need to disable the focus check for a special setup, pass:
|
|
215
|
+
|
|
216
|
+
```python
|
|
217
|
+
goodnavigate.enable(check_window_focus=False)
|
|
218
|
+
```
|
|
219
|
+
## Pause, Resume, Disable
|
|
220
|
+
|
|
221
|
+
Pause GoodNavigate controls without returning Vizard mouse handling to its default behavior:
|
|
222
|
+
|
|
223
|
+
```python
|
|
224
|
+
goodnavigate.pause()
|
|
225
|
+
goodnavigate.resume()
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Disable GoodNavigate controls and return mouse handling to Vizard defaults:
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
goodnavigate.disable()
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
You can also call these on the navigator object:
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
navigator = goodnavigate.enable()
|
|
238
|
+
navigator.pause()
|
|
239
|
+
navigator.resume()
|
|
240
|
+
navigator.disable()
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Using A Different View
|
|
244
|
+
|
|
245
|
+
By default, GoodNavigate controls `viz.MainView`. You can pass another Vizard view object.
|
|
246
|
+
|
|
247
|
+
```python
|
|
248
|
+
my_view = viz.MainView
|
|
249
|
+
goodnavigate.enable(view=my_view)
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Repository Layout
|
|
253
|
+
|
|
254
|
+
```text
|
|
255
|
+
pyproject.toml
|
|
256
|
+
README.md
|
|
257
|
+
src/
|
|
258
|
+
goodnavigate/
|
|
259
|
+
__init__.py
|
|
260
|
+
goodnavigate_overlay_bg.png
|
|
261
|
+
GoodNavigate.py
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
`src/goodnavigate/goodnavigate_overlay_bg.png` is packaged with the module and is used for the rounded gray speed overlay background.
|
|
265
|
+
|
|
266
|
+
The root-level `GoodNavigate.py` file can still be copied directly into a Vizard project if you want a no-pip workflow, but pip users should use the `src/` package.
|
|
267
|
+
|
|
268
|
+
## Requirements
|
|
269
|
+
|
|
270
|
+
- WorldViz Vizard 8
|
|
271
|
+
- Vizard Python environment with `viz` and `vizact`
|
|
272
|
+
- pip available in the Vizard Python environment
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "goodnavigate"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Comfortable camera navigation helper for WorldViz Vizard 8"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.7"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "cuber244" }
|
|
13
|
+
]
|
|
14
|
+
keywords = ["vizard", "worldviz", "camera", "navigation", "vr"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Topic :: Multimedia :: Graphics :: 3D Rendering",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.urls]
|
|
23
|
+
Homepage = "https://github.com/cuber244/goodnavigate"
|
|
24
|
+
Repository = "https://github.com/cuber244/goodnavigate"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools]
|
|
27
|
+
package-dir = { "" = "src" }
|
|
28
|
+
py-modules = ["GoodNavigate"]
|
|
29
|
+
include-package-data = true
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.packages.find]
|
|
32
|
+
where = ["src"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
goodnavigate = ["goodnavigate_overlay_bg.png"]
|