Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created tool tips for Add Component Menus and all component types #318

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions addons/io_hubs_addon/components/definitions/component_tooltips.py
Original file line number Diff line number Diff line change
@@ -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',
}
14 changes: 14 additions & 0 deletions addons/io_hubs_addon/components/operators.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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


Expand Down Expand Up @@ -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
Expand Down
Loading