Skip to content

Commit

Permalink
created tooltips for components in component_tooltips.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiderguy-F committed Nov 8, 2024
1 parent 8d1fb00 commit f1e4fbc
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
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',
}
19 changes: 19 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,23 @@ 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
try:
return component_tooltips.component_descriptions[component]
except:
print(properties.component_name + ': Please add me to component_tooltips.py')
return "No description available for " + component


def execute(self, context):
if self.component_name == '':
return
Expand Down

0 comments on commit f1e4fbc

Please sign in to comment.