diff --git a/addons/io_hubs_addon/components/definitions/component_tooltips.py b/addons/io_hubs_addon/components/definitions/component_tooltips.py new file mode 100644 index 00000000..718506f2 --- /dev/null +++ b/addons/io_hubs_addon/components/definitions/component_tooltips.py @@ -0,0 +1,43 @@ +component_descriptions = { + 'directional-light': 'A light that emits parallel light in a specific direction, like the sun', + 'loop-animation': 'Play an animation for this object on a loop', + 'media-frame': 'Displays a media like images, PDFs, and videos', + 'particle-emitter': 'A component that emits particles', + 'simple-water': 'A component that creates water effect, including waves', + 'spawner': 'A component that spawns entities', + 'text': 'A component that displays text', + 'waypoint': 'A component that defines a way/spawn point', + 'loop-animation': 'Plays an animation for this object on a loop', + 'uv-scroll': 'Scroll the UVs of a material (animate the texture)', + 'morph-audio-feedback': 'Control a shapekey for an avatar based on mic volume', + 'personal-space-invader': 'Fade out other avatars if they get too close', + 'scale-audio-feedback': 'Scale this object based on mic volume', + 'audio': 'A component that plays audio', + 'zone-audio-source': 'Play audio when an avatar enters a zone', + 'audio-target': 'A component that plays audio based on the distance between two entities', + 'audio-zone': 'Play audio when an avatar enters a zone', + 'image': 'Displays an image from a URL', + 'model': 'Loads a 3D model from a URL', + 'pdf': 'Loads a PDF from a URL', + 'video': 'Loads a video from a URL', + 'custom-tags': 'A component that adds custom tags to an entity', + 'visible': 'Hide this object in hubs', + 'shadow': 'Make this object cast dynamic shadows', + 'rigidbody': 'A component that adds physics to an entity', + 'physics-shape': 'Define the shape of a physics object', + 'grabbable': 'Players can move this object around', + 'frustrum': 'A component that defines a frustrum', + 'billboard': 'Make the object face the player', + 'ammo-shape': '[OBSOLETE] define the physics shape of an entity', + 'mirror': 'Create a mirror effect for your room', + 'nav-mesh': 'Define navigation mesh that limits where avatars can walk', + 'scene-preview-camera': 'A component that creates a scene preview camera', + 'skybox': 'Creates a procedural sky', + 'spot-light': 'A component that creates a spot light', + 'point-light': 'A component that creates a point light', + 'hemisphere-light': 'A component that creates a hemisphere light', + 'link': 'Create an interactable hyperlink', + 'fog': 'Add fog to the scene', + 'audio-settings': 'Define audio drop off settings', + 'environment-settings': 'Define Background image and Evnironment settings', +} diff --git a/addons/io_hubs_addon/components/operators.py b/addons/io_hubs_addon/components/operators.py index 2907e0cb..5580aff9 100644 --- a/addons/io_hubs_addon/components/operators.py +++ b/addons/io_hubs_addon/components/operators.py @@ -1,6 +1,7 @@ import bpy from bpy.props import StringProperty, IntProperty, BoolProperty, CollectionProperty from bpy.types import Operator, PropertyGroup + from functools import reduce from .types import PanelType, MigrationType @@ -11,6 +12,7 @@ from .gizmos import update_gizmos from .utils import is_linked, redraw_component_ui from ..icons import get_hubs_icons +from .definitions import component_tooltips import os @@ -55,6 +57,18 @@ def poll(cls, context): return True + @classmethod + def description(cls, context, properties): + component = properties.component_name + if component == '': + panel_type = None + for item in properties.items(): + _, panel_type = item + tooltip = "Add a hubs component to this object" if panel_type == "object" \ + else "Add a hubs component to the scene" + return tooltip + return component_tooltips.component_descriptions[component] + def execute(self, context): if self.component_name == '': return