vuer 0.0.17__py3-none-any.whl → 0.0.18__py3-none-any.whl
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.
Potentially problematic release.
This version of vuer might be problematic. Click here for more details.
- vuer/__pycache__/server.cpython-38.pyc +0 -0
- vuer/__pycache__/types.cpython-38.pyc +0 -0
- vuer/schemas/__pycache__/drei_components.cpython-38.pyc +0 -0
- vuer/schemas/__pycache__/html_components.cpython-38.pyc +0 -0
- vuer/schemas/__pycache__/scene_components.cpython-38.pyc +0 -0
- vuer/schemas/drei_components.py +12 -12
- vuer/schemas/html_components.py +1 -0
- vuer/schemas/scene_components.py +55 -4
- vuer/server.py +26 -12
- vuer/types.py +1 -1
- {vuer-0.0.17.dist-info → vuer-0.0.18.dist-info}/METADATA +1 -1
- {vuer-0.0.17.dist-info → vuer-0.0.18.dist-info}/RECORD +16 -16
- {vuer-0.0.17.dist-info → vuer-0.0.18.dist-info}/LICENSE +0 -0
- {vuer-0.0.17.dist-info → vuer-0.0.18.dist-info}/WHEEL +0 -0
- {vuer-0.0.17.dist-info → vuer-0.0.18.dist-info}/entry_points.txt +0 -0
- {vuer-0.0.17.dist-info → vuer-0.0.18.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
vuer/schemas/drei_components.py
CHANGED
|
@@ -118,29 +118,29 @@ class Facemesh(SceneElement):
|
|
|
118
118
|
"""Renders an oriented MediaPipe face mesh:
|
|
119
119
|
|
|
120
120
|
:param points: An array of 468+ keypoints as returned by google/mediapipe tasks-vision. Defaults to a sample face.
|
|
121
|
-
:type
|
|
121
|
+
:type points: MediaPipePoints, optional
|
|
122
122
|
:param face: An face object as returned by tensorflow/tfjs-models face-landmarks-detection. This parameter is deprecated.
|
|
123
|
-
:type
|
|
123
|
+
:type face: MediaPipeFaceMesh, optional
|
|
124
124
|
:param width: Constant width of the mesh. Defaults to undefined.
|
|
125
|
-
:type
|
|
125
|
+
:type width: int, optional
|
|
126
126
|
:param height: Constant height of the mesh. Defaults to undefined.
|
|
127
|
-
:type
|
|
127
|
+
:type height: int, optional
|
|
128
128
|
:param depth: Constant depth of the mesh. Defaults to 1.
|
|
129
|
-
:type
|
|
129
|
+
:type depth: int, optional
|
|
130
130
|
:param verticalTri: A landmarks tri supposed to be vertical. Defaults to [159, 386, 200]. See: https://github.com/tensorflow/tfjs-models/tree/master/face-landmarks-detection#mediapipe-facemesh-keypoints
|
|
131
|
-
:type
|
|
131
|
+
:type verticalTri: Tuple[int, int, int], optional
|
|
132
132
|
:param origin: A landmark index (to get the position from) or a vec3 to be the origin of the mesh. Defaults to undefined (i.e., the bbox center).
|
|
133
|
-
:type
|
|
133
|
+
:type origin: Union[int, THREE.Vector3], optional
|
|
134
134
|
:param facialTransformationMatrix: A facial transformation matrix, as returned by FaceLandmarkerResult.facialTransformationMatrixes. See: https://developers.google.com/mediapipe/solutions/vision/face_landmarker/web_js#handle_and_display_results
|
|
135
|
-
:type
|
|
135
|
+
:type facialTransformationMatrix: FacemeshDatas.SAMPLE_FACELANDMARKER_RESULT.facialTransformationMatrixes[0], optional
|
|
136
136
|
:param offset: Apply position offset extracted from `facialTransformationMatrix`.
|
|
137
|
-
:type
|
|
137
|
+
:type offset: bool, optional
|
|
138
138
|
:param offsetScalar: Offset sensitivity factor, less is more sensible.
|
|
139
|
-
:type
|
|
139
|
+
:type offsetScalar: float, optional
|
|
140
140
|
:param faceBlendshapes: Face blendshapes, as returned by FaceLandmarkerResult.faceBlendshapes. See: https://developers.google.com/mediapipe/solutions/vision/face_landmarker/web_js#handle_and_display_results
|
|
141
|
-
:type
|
|
141
|
+
:type faceBlendshapes: FacemeshDatas.SAMPLE_FACELANDMARKER_RESULT.faceBlendshapes[0], optional
|
|
142
142
|
:param eyes: Whether to enable eyes (note: `faceBlendshapes` is required for this). Defaults to True.
|
|
143
|
-
:type
|
|
143
|
+
:type eyes: bool, optional
|
|
144
144
|
|
|
145
145
|
Usage::
|
|
146
146
|
|
vuer/schemas/html_components.py
CHANGED
vuer/schemas/scene_components.py
CHANGED
|
@@ -39,6 +39,56 @@ class SceneElement(BlockElement):
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class Frustum(SceneElement):
|
|
42
|
+
"""Camera Frustum
|
|
43
|
+
|
|
44
|
+
:param position: An optional tuple of three numbers representing the position.
|
|
45
|
+
:type position: tuple[float, float, float]
|
|
46
|
+
:param rotation: An optional tuple of three numbers representing the rotation.
|
|
47
|
+
:type rotation: tuple[float, float, float]
|
|
48
|
+
:param matrix: An optional tuple of sixteen numbers representing the matrix.
|
|
49
|
+
:type matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float]
|
|
50
|
+
:param aspect: An optional number representing the aspect.
|
|
51
|
+
:type aspect: float
|
|
52
|
+
:param focus: An optional number representing the focus.
|
|
53
|
+
:type focus: float
|
|
54
|
+
:param fov: An optional number representing the field of view.
|
|
55
|
+
:type fov: float
|
|
56
|
+
:param near: An optional number representing the near field.
|
|
57
|
+
:type near: float
|
|
58
|
+
:param far: An optional number representing the far field.
|
|
59
|
+
:type far: float
|
|
60
|
+
:param scale: An optional number representing the scale.
|
|
61
|
+
:type scale: float
|
|
62
|
+
:param upScale: An optional number representing the up scale.
|
|
63
|
+
:type upScale: float
|
|
64
|
+
:param focalLength: An optional number representing the focal length.
|
|
65
|
+
:type focalLength: float
|
|
66
|
+
:param showUp: An optional boolean indicating whether to show up.
|
|
67
|
+
:type showUp: bool
|
|
68
|
+
:param showFrustum: An optional boolean indicating whether to show the frustum.
|
|
69
|
+
:type showFrustum: bool
|
|
70
|
+
:param showFocalPlane: An optional boolean indicating whether to show the focal plane.
|
|
71
|
+
:type showFocalPlane: bool
|
|
72
|
+
:param showImagePlane: An optional boolean indicating whether to show the image plane.
|
|
73
|
+
:type showImagePlane: bool
|
|
74
|
+
:param src: An optional string representing the source.
|
|
75
|
+
:type src: str
|
|
76
|
+
:param colorOrigin: An optional ColorRepresentation for the origin color.
|
|
77
|
+
:type colorOrigin: ColorRepresentation
|
|
78
|
+
:param colorFrustum: An optional ColorRepresentation for the frustum color.
|
|
79
|
+
:type colorFrustum: ColorRepresentation
|
|
80
|
+
:param colorCone: An optional ColorRepresentation for the cone color.
|
|
81
|
+
:type colorCone: ColorRepresentation
|
|
82
|
+
:param colorFocalPlane: An optional ColorRepresentation for the focal plane color.
|
|
83
|
+
:type colorFocalPlane: ColorRepresentation
|
|
84
|
+
:param colorUp: An optional ColorRepresentation for the up color.
|
|
85
|
+
:type colorUp: ColorRepresentation
|
|
86
|
+
:param colorTarget: An optional ColorRepresentation for the target color.
|
|
87
|
+
:type colorTarget: ColorRepresentation
|
|
88
|
+
:param colorCross: An optional ColorRepresentation for the cross color.
|
|
89
|
+
:type colorCross: ColorRepresentation
|
|
90
|
+
"""
|
|
91
|
+
|
|
42
92
|
tag = "Frustum"
|
|
43
93
|
|
|
44
94
|
|
|
@@ -132,6 +182,9 @@ class PointCloud(SceneElement):
|
|
|
132
182
|
self.colors = self.colors.flatten().tobytes()
|
|
133
183
|
|
|
134
184
|
|
|
185
|
+
p = PointCloud
|
|
186
|
+
|
|
187
|
+
|
|
135
188
|
class Box(SceneElement):
|
|
136
189
|
tag = "Box"
|
|
137
190
|
|
|
@@ -442,9 +495,7 @@ class DefaultScene(Scene):
|
|
|
442
495
|
):
|
|
443
496
|
rawChildren = [
|
|
444
497
|
AmbientLight(intensity=1.0, key="default_ambient_light"),
|
|
445
|
-
DirectionalLight(
|
|
446
|
-
intensity=1, key="default_directional_light", helper=show_helper
|
|
447
|
-
),
|
|
498
|
+
DirectionalLight(intensity=1, key="default_directional_light", helper=show_helper),
|
|
448
499
|
*(rawChildren or []),
|
|
449
500
|
]
|
|
450
501
|
|
|
@@ -468,4 +519,4 @@ class DefaultScene(Scene):
|
|
|
468
519
|
],
|
|
469
520
|
up=up,
|
|
470
521
|
**kwargs,
|
|
471
|
-
)
|
|
522
|
+
)
|
vuer/server.py
CHANGED
|
@@ -27,7 +27,7 @@ from vuer.events import (
|
|
|
27
27
|
Upsert,
|
|
28
28
|
)
|
|
29
29
|
from vuer.schemas import Page
|
|
30
|
-
from vuer.types import EventHandler,
|
|
30
|
+
from vuer.types import EventHandler, SocketHandler
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class At:
|
|
@@ -242,6 +242,22 @@ class Vuer(PrefixProto, Server):
|
|
|
242
242
|
|
|
243
243
|
app.run()
|
|
244
244
|
|
|
245
|
+
|
|
246
|
+
.. automethod:: bind
|
|
247
|
+
.. automethod:: spawn
|
|
248
|
+
.. automethod:: relay
|
|
249
|
+
.. automethod:: bound_fn
|
|
250
|
+
.. automethod:: spawn_task
|
|
251
|
+
.. automethod:: get_url
|
|
252
|
+
.. automethod:: send
|
|
253
|
+
.. automethod:: rpc
|
|
254
|
+
.. automethod:: rpc_stream
|
|
255
|
+
.. automethod:: close_ws
|
|
256
|
+
.. automethod:: uplink
|
|
257
|
+
.. automethod:: downlink
|
|
258
|
+
.. automethod:: add_handler
|
|
259
|
+
.. automethod:: _ttl_handler
|
|
260
|
+
.. automethod:: run
|
|
245
261
|
"""
|
|
246
262
|
|
|
247
263
|
name = "vuer"
|
|
@@ -279,7 +295,7 @@ class Vuer(PrefixProto, Server):
|
|
|
279
295
|
self.page = Page()
|
|
280
296
|
|
|
281
297
|
self.ws = {}
|
|
282
|
-
self.
|
|
298
|
+
self.socket_handler: SocketHandler = None
|
|
283
299
|
self.spawned_coroutines = []
|
|
284
300
|
|
|
285
301
|
async def relay(self, request):
|
|
@@ -290,11 +306,11 @@ class Vuer(PrefixProto, Server):
|
|
|
290
306
|
|
|
291
307
|
Interface:
|
|
292
308
|
<uri>/relay?sid=<websocket_id>
|
|
309
|
+
|
|
293
310
|
:return:
|
|
294
311
|
- Status 200
|
|
295
312
|
- Status 400
|
|
296
313
|
|
|
297
|
-
|
|
298
314
|
"""
|
|
299
315
|
# todo: need to implement msgpack encoding, interface
|
|
300
316
|
bytes = request.bytes()
|
|
@@ -350,20 +366,18 @@ class Vuer(PrefixProto, Server):
|
|
|
350
366
|
loop = asyncio.get_running_loop()
|
|
351
367
|
return loop.create_task(task)
|
|
352
368
|
|
|
353
|
-
def spawn(self, fn:
|
|
369
|
+
def spawn(self, fn: SocketHandler = None, start=False):
|
|
354
370
|
"""
|
|
355
|
-
Spawn a function as a task. This is useful in the following scenario:
|
|
356
|
-
|
|
357
|
-
code::
|
|
358
371
|
|
|
372
|
+
Note: this is really a misnomer.
|
|
359
373
|
|
|
360
374
|
:param fn: The function to spawn.
|
|
361
375
|
:param start: Start server after binding
|
|
362
376
|
:return: None
|
|
363
377
|
"""
|
|
364
378
|
|
|
365
|
-
def wrap_fn(fn:
|
|
366
|
-
self.
|
|
379
|
+
def wrap_fn(fn: SocketHandler):
|
|
380
|
+
self.socket_handler = fn
|
|
367
381
|
if start:
|
|
368
382
|
self.run()
|
|
369
383
|
|
|
@@ -375,7 +389,7 @@ class Vuer(PrefixProto, Server):
|
|
|
375
389
|
|
|
376
390
|
def bind(self, fn=None, start=False):
|
|
377
391
|
"""
|
|
378
|
-
Bind
|
|
392
|
+
Bind an asynchronous generator function for use in socket connection handler. The function should be a generator that yields Page objects.
|
|
379
393
|
|
|
380
394
|
:param fn: The function to bind.
|
|
381
395
|
:return: None
|
|
@@ -515,8 +529,8 @@ class Vuer(PrefixProto, Server):
|
|
|
515
529
|
|
|
516
530
|
self._add_task(self.uplink(vuer_proxy))
|
|
517
531
|
|
|
518
|
-
if self.
|
|
519
|
-
task = self._add_task(self.
|
|
532
|
+
if self.socket_handler is not None:
|
|
533
|
+
task = self._add_task(self.socket_handler(vuer_proxy))
|
|
520
534
|
|
|
521
535
|
if hasattr(generator, "__anext__"):
|
|
522
536
|
serverEvent = await generator.__anext__()
|
vuer/types.py
CHANGED
|
@@ -16,7 +16,7 @@ EventHandler = Callable[[ClientEvent, "VuerProxy"], None]
|
|
|
16
16
|
"""Defines a function that handles a client event. Second argument is the VuerProxy instance bound
|
|
17
17
|
to a specific client connected through a websocket session."""
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
SocketHandler = Callable[["VuerProxy"], Coroutine]
|
|
20
20
|
"""Defines a function that spawns a new entity. Argument is the VuerProxy instance."""
|
|
21
21
|
|
|
22
22
|
|
|
@@ -3,15 +3,15 @@ vuer/base.py,sha256=R-PtD39ouihiEGmSfJL26chlU0XkFJP-JmBNYzDdEvM,3068
|
|
|
3
3
|
vuer/events.py,sha256=8AAzkfbm5jHkeMh17Z57n8YTxF4mheWC3Qbya4XkQSc,7291
|
|
4
4
|
vuer/schemas.py,sha256=aZOocE02gO43SLLfeYSxxac0x38TmyTcfs_iFh5hsJ4,18152
|
|
5
5
|
vuer/serdes.py,sha256=gD2iA9Yypu1QjocneOT3Nc0y6q_mdHn9zW1ko5j3I7c,2600
|
|
6
|
-
vuer/server.py,sha256=
|
|
7
|
-
vuer/types.py,sha256=
|
|
6
|
+
vuer/server.py,sha256=OsXSq6iScFTG-yvAXWAik-EwNwEKdd1F84nUqBwyrjE,19955
|
|
7
|
+
vuer/types.py,sha256=N2KLa0fl6z8Jm6cJwZoD8Vqrins_AayG5BCGk1p3Eek,1279
|
|
8
8
|
vuer/__pycache__/__init__.cpython-38.pyc,sha256=rS-9zzAjFEXnObk5q3E5Rex_uvoJ-Ccfz7Hs9DGNVgs,188
|
|
9
9
|
vuer/__pycache__/base.cpython-38.pyc,sha256=Z5EFlRX9RqZsQUszvqPtAhLv_5QG5wlUXW7JbFd_XDc,3824
|
|
10
10
|
vuer/__pycache__/events.cpython-38.pyc,sha256=zx3bXeJixqOyCFe2nA7qpq6jiCJ49kRaXO-xONGUyeQ,9616
|
|
11
11
|
vuer/__pycache__/schemas.cpython-38.pyc,sha256=hvY9Aak8zE-zKcWiwuNe6DghOw9qH_zSe_FtkBOAPPk,23234
|
|
12
12
|
vuer/__pycache__/serdes.cpython-38.pyc,sha256=KMxTjPEWuSGn2bqBAl5OLIDSCSoqfPDGfk3fvNnRDYA,2253
|
|
13
|
-
vuer/__pycache__/server.cpython-38.pyc,sha256=
|
|
14
|
-
vuer/__pycache__/types.cpython-38.pyc,sha256=
|
|
13
|
+
vuer/__pycache__/server.cpython-38.pyc,sha256=kAsC8t-JgTOOccZMaXZMEqgTSV3C3T5Oyj1sl-QABM4,18696
|
|
14
|
+
vuer/__pycache__/types.cpython-38.pyc,sha256=IhlXtkT-XWM0V1420FDuoqIYnpvRvekYVkGqEK7fAV8,1819
|
|
15
15
|
vuer/addons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
vuer/addons/nerf_vuer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
vuer/addons/nerf_vuer/control_components.py,sha256=K4PU0nD572L4J7lLFfShWficWZQnH4t-x6WWMrAVw8g,290
|
|
@@ -22,16 +22,16 @@ vuer/addons/nerf_vuer/render_nodes.py,sha256=5TKqIbMPiOtBxfF4FQI6uB0w_9FTfGiwS8x
|
|
|
22
22
|
vuer/addons/nerfuer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
23
|
vuer/addons/nerfuer/render_nodes.py,sha256=EJK5N3xne5n7abTaAoLPX7SRqQ_tEen9zNypvSnZTTw,4465
|
|
24
24
|
vuer/schemas/__init__.py,sha256=ZI6UyeLZXqJbHmp6LiE3Q3mHvt1zeV-SJmmcqq-wBZE,94
|
|
25
|
-
vuer/schemas/drei_components.py,sha256=
|
|
26
|
-
vuer/schemas/html_components.py,sha256=
|
|
27
|
-
vuer/schemas/scene_components.py,sha256=
|
|
25
|
+
vuer/schemas/drei_components.py,sha256=U9svEOnNprhZaobLagaFnqEtZxo5hiriSqjDnvQutoA,6989
|
|
26
|
+
vuer/schemas/html_components.py,sha256=NCqmSPic-ExPrXqNPXbKjtTXMB8sGBywIpE6cXpiy08,5926
|
|
27
|
+
vuer/schemas/scene_components.py,sha256=L9GbgFnrhxUYKi4EyexaAun7gmn6aHnCQIeSGSGwIRU,14913
|
|
28
28
|
vuer/schemas/__pycache__/__init__.cpython-38.pyc,sha256=NRnVrpIDBKne93xOUY1-WpavCG7vwYiqU3VDTEEwuUE,221
|
|
29
|
-
vuer/schemas/__pycache__/drei_components.cpython-38.pyc,sha256=
|
|
30
|
-
vuer/schemas/__pycache__/html_components.cpython-38.pyc,sha256=
|
|
31
|
-
vuer/schemas/__pycache__/scene_components.cpython-38.pyc,sha256=
|
|
32
|
-
vuer-0.0.
|
|
33
|
-
vuer-0.0.
|
|
34
|
-
vuer-0.0.
|
|
35
|
-
vuer-0.0.
|
|
36
|
-
vuer-0.0.
|
|
37
|
-
vuer-0.0.
|
|
29
|
+
vuer/schemas/__pycache__/drei_components.cpython-38.pyc,sha256=g_ufcKxf-XKfZLdUV-HqKnjIrgxGWFv51aHLWQgH-ws,7712
|
|
30
|
+
vuer/schemas/__pycache__/html_components.cpython-38.pyc,sha256=q0DMFwNkYbnaH1A8w3BowMiQAlmGpFWOOKsjLVE6CIk,8215
|
|
31
|
+
vuer/schemas/__pycache__/scene_components.cpython-38.pyc,sha256=eRxB-Tp24yqBR4zbLMGX_4o1P_D-tW1nrDeBPSJKoU4,18135
|
|
32
|
+
vuer-0.0.18.dist-info/LICENSE,sha256=MGF-inVBUaGe2mEjqT0g6XsHIXwoNXgNHqD7Z1MzR0k,1063
|
|
33
|
+
vuer-0.0.18.dist-info/METADATA,sha256=cbpGK1fH2Wx_FmSLe_X9M59Dk0E_V-7v5FCS-KRfvx0,4277
|
|
34
|
+
vuer-0.0.18.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
35
|
+
vuer-0.0.18.dist-info/entry_points.txt,sha256=J_NM6fbpipmD9oP7cdxd1UyBR8mVEQVx0xjlE_56yss,41
|
|
36
|
+
vuer-0.0.18.dist-info/top_level.txt,sha256=ermmVkwvGFAK4gfSgDIwOmKpxwpqNt-oo7gVQQUSHok,5
|
|
37
|
+
vuer-0.0.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|