Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from arenaxr/docstring
feat(objects, attributes): added automated support for full schema with docstrings
- Loading branch information
Showing
73 changed files
with
1,268 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,68 @@ | ||
from .animation_mixer import AnimationMixer | ||
from .animation import Animation | ||
from .attribute import Attribute | ||
from .color import Color | ||
from .data import Data | ||
from .goto_url import GotoUrl | ||
from .impulse import Impulse | ||
from .jitsi_video import JitsiVideo | ||
from .material import Material | ||
from .morph import Morph | ||
from .physics import Physics | ||
from .position import Position | ||
from .rotation import Rotation | ||
from .scale import Scale | ||
from .sound import Sound | ||
from .spe_particles import SpeParticles | ||
from .text_input import TextInput | ||
from .video_control import VideoControl | ||
# This file is auto-generated from github.com/arenaxr/arena-schema, changes here may be overwritten. | ||
|
||
from .translate import * | ||
from .attribute import * | ||
from .color import * | ||
from .data import * | ||
from .animation import * | ||
from .animation_mixer import * | ||
from .armarker import * | ||
from .attribution import * | ||
from .blip import * | ||
from .box_collision_listener import * | ||
from .click_listener import * | ||
from .dynamic_body import * | ||
from .gltf_model_lod import * | ||
from .gltf_morph import * | ||
from .goto_landmark import * | ||
from .goto_url import * | ||
from .impulse import * | ||
from .jitsi_video import * | ||
from .landmark import * | ||
from .material import * | ||
from .material_extras import * | ||
from .multisrc import * | ||
from .position import * | ||
from .remote_render import * | ||
from .rotation import * | ||
from .scale import * | ||
from .shadow import * | ||
from .sound import * | ||
from .spe_particles import * | ||
from .static_body import * | ||
from .textinput import * | ||
from .video_control import * | ||
|
||
# [TODO]: do something with this | ||
ATTRIBUTE_TYPE_MAP = { | ||
"animation-mixer": AnimationMixer, | ||
"animation": Animation, | ||
"attribute": Attribute, | ||
"color": Color, | ||
"data": Data, | ||
"animation": Animation, | ||
"animation_mixer": AnimationMixer, | ||
"armarker": Armarker, | ||
"attribution": Attribution, | ||
"blip": Blip, | ||
"box_collision_listener": BoxCollisionListener, | ||
"click_listener": ClickListener, | ||
"dynamic_body": DynamicBody, | ||
"gltf_model_lod": GltfModelLod, | ||
"gltf_morph": GltfMorph, | ||
"goto_landmark": GotoLandmark, | ||
"goto_url": GotoUrl, | ||
"impulse": Impulse, | ||
"jitsi_video": JitsiVideo, | ||
"landmark": Landmark, | ||
"material": Material, | ||
"morph": Morph, | ||
"physics": Physics, | ||
"material_extras": MaterialExtras, | ||
"multisrc": Multisrc, | ||
"position": Position, | ||
"remote_render": RemoteRender, | ||
"rotation": Rotation, | ||
"scale": Scale, | ||
"shadow": Shadow, | ||
"sound": Sound, | ||
"spe_particles": SpeParticles, | ||
"text_input": TextInput, | ||
"static_body": StaticBody, | ||
"textinput": Textinput, | ||
"video_control": VideoControl, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from .attribute import Attribute | ||
|
||
|
||
class Armarker(Attribute): | ||
""" | ||
Armarker attribute class to manage its properties in the ARENA: A location marker (such as an AprilTag, a lightAnchor, or an UWB tag), used to anchor scenes, or scene objects, in the real world. | ||
Usage: armarker=Armarker(...) | ||
:param bool buildable: Whether tag has 'dynamic' toggled on click. Used to position a tag, then lock into position. (optional) | ||
:param bool dynamic: Dynamic tag, not used for localization. E.g., to move object to which this ARMarker component is attached to. Requires permissions to update the scene (if dynamic=true). (optional) | ||
:param float ele: Tag elevation in meters. (optional) | ||
:param float lat: Tag latitude. (optional) | ||
:param float long: Tag longitude. (optional) | ||
:param str markerid: The marker id (e.g. for AprilTag 36h11 family, an integer in the range [0, 586]). Defaults to '0' (optional) | ||
:param str markertype: The marker type, technology-based. Allows [apriltag_36h11, lightanchor, uwb, vive, optitrack] Defaults to 'apriltag_36h11' (optional) | ||
:param bool publish: Publish detections. Send detections to external agents (e.g. external builder script that places new markers in the scene). If dynamic=true and publish=true, object position is not updated (left up to external agent). (optional) | ||
:param float size: Tag size in millimeters. Defaults to '150' (optional) | ||
:param str url: URL associated with the tag. (optional) | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from .attribute import Attribute | ||
|
||
|
||
class Attribution(Attribute): | ||
""" | ||
Attribution attribute class to manage its properties in the ARENA: Attribution Component. Saves attribution data in any entity. | ||
Usage: attribution=Attribution(...) | ||
:param str author: Author name; e.g. 'Vaptor-Studio'. Defaults to 'Unknown' (optional) | ||
:param str authorURL: Author homepage/profile; e.g. https://sketchfab.com/VapTor. (optional) | ||
:param bool extractAssetExtras: Extract attribution info from asset extras; will override attribution info given (default: true). Defaults to 'True' (optional) | ||
:param str license: License summary/short name; e.g. 'CC-BY-4.0'. Defaults to 'Unknown' (optional) | ||
:param str licenseURL: License URL; e.g. http://creativecommons.org/licenses/by/4.0/. (optional) | ||
:param str source: Model source e.g. 'Sketchfab'. Defaults to 'Unknown' (optional) | ||
:param str sourceURL: Model source URL; e.g. https://sketchfab.com/models/2135501583704537907645bf723685e7. (optional) | ||
:param str title: Model title; e.g. 'Spinosaurus'. Defaults to 'No Title' (optional) | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from .attribute import Attribute | ||
|
||
|
||
class Blip(Attribute): | ||
""" | ||
Blip attribute class to manage its properties in the ARENA: When the object is created or deleted, it will animate in/out of the scene instead of appearing/disappearing instantly. Must have a geometric mesh. | ||
Usage: blip=Blip(...) | ||
:param bool applyDescendants: Apply blipout effect to include all descendents. Does not work for blipin. (optional) | ||
:param bool blipin: Animate in on create, set false to disable. Defaults to 'True' (optional) | ||
:param bool blipout: Animate out on delete, set false to disable. Defaults to 'True' (optional) | ||
:param float duration: Animation duration in milliseconds. Defaults to '750' (optional) | ||
:param str geometry: Geometry of the blipout plane. Allows [rect, disk, ring] Defaults to 'rect' (optional) | ||
:param str planes: Which which clipping planes to use for effect. A top plane clips above it, bottom clips below it. Allows [both, top, bottom] Defaults to 'both' (optional) | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from .attribute import Attribute | ||
|
||
|
||
class BoxCollisionListener(Attribute): | ||
""" | ||
BoxCollisionListener attribute class to manage its properties in the ARENA: Listen for bounding-box collisions with user camera and hands. Must be applied to an object or model with geometric mesh. Collisions are determined by course bounding-box overlaps. | ||
Usage: box_collision_listener=BoxCollisionListener(...) | ||
:param bool dynamic: Set true for a moving object, which should have its bounding box recalculated regularly to determine proper collision. (optional) | ||
:param bool enabled: Publish detections, set `false` to disable. Defaults to 'True' (optional) | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from .attribute import Attribute | ||
|
||
|
||
class ClickListener(Attribute): | ||
""" | ||
ClickListener attribute class to manage its properties in the ARENA: Object will listen for clicks. | ||
Usage: click_listener=ClickListener(...) | ||
:param bool bubble: Set false to prevent click events from bubbling up to parent objects. See <a href='https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_bubbling'>Event Bubbling</a>. Defaults to 'True' (optional) | ||
:param bool enabled: Publish events, set false to disable. Defaults to 'True' (optional) | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) |
Oops, something went wrong.