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

Tooltip videos not playing #1265

Closed
deddolo opened this issue Jun 6, 2021 · 10 comments
Closed

Tooltip videos not playing #1265

deddolo opened this issue Jun 6, 2021 · 10 comments
Labels
Benign Bug Bug that doesn't stop user from using the tool but it makes it inconvenient [class] Bundles Issues related to the pyRevit bundles [subsystem] Prioritize The issue is planned to be resolved in the next version

Comments

@deddolo
Copy link
Contributor

deddolo commented Jun 6, 2021

Describe the bug
Strange behavior of tooltip videos not loading in pyRevit or other extensions buttons on the Ribbon.

After launching Revit (tested in 2019 and 2020) none of the buttons with a tooltip.mp4 file show a video in the tooltip.

After using the Reload command in pyRevit, the tooltip starts showing a Video is loading... text at the bottom of the tooltip, but the text then disappears and no video is shown.

To make sure it wasn't a codec issue, I tried using one of the OOTB Revit mp4 videos as a tooltip.mp4 video, but the behavior remained the same.

To Reproduce
Steps to reproduce the behavior:

  1. Hover on a button
  2. Wait for tooltip to show
  3. See no video

Desktop (please complete the following information):

  • OS: Win10
  • pyRevit Version 4.8.7
  • pyRevit Environment:
==> Registered Clones (full git repos)
develop | Branch: "develop" | Version: "4.8.7:7f39f56" | Path: "C:\Users\david\OneDrive - Odeh Engineers\Repos\pyRevit"
==> Registered Clones (deployed from archive/image)
==> Attachments
develop | Product: "2021.1.1" | Engine: DEFAULT (2711) | Path: "C:\Users\david\OneDrive - Odeh Engineers\Repos\pyRevit" 
develop | Product: "2020.2.3" | Engine: DEFAULT (2711) | Path: "C:\Users\david\OneDrive - Odeh Engineers\Repos\pyRevit" 
develop | Product: "2019.2.2 Hotfix" | Engine: DEFAULT (2711) | Path: "C:\Users\david\OneDrive - Odeh Engineers\Repos\pyRevit"
develop | Product: "2018.3.2" | Engine: DEFAULT (2711) | Path: "C:\Users\david\OneDrive - Odeh Engineers\Repos\pyRevit" 
==> Installed Extensions
pyOdehTool | Type: UIExtension | Repo: "" | Installed: "C:\Users\david\OneDrive - Odeh Engineers\pyRevit\Custom Extensions\pyOdehTool.extension"
pyOdehToolWIP | Type: Unknown | Repo: "" | Installed: "C:\Users\david\OneDrive - Odeh Engineers\pyRevit\pyOdehToolWIP.extension"
templateBuddy | Type: Unknown | Repo: "" | Installed: "C:\Users\david\OneDrive - Odeh Engineers\pyRevit\templateBuddy.extension"
==> Default Extension Search Path
C:\Users\david\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
C:\Users\david\OneDrive - Odeh Engineers\pyRevit
C:\Users\david\OneDrive - Odeh Engineers\pyRevit\Custom Extensions
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
2021.1.1 | Version: 21.1.10.26 | Build: 20200909_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021\"
2020.2.3 | Version: 20.2.30.42 | Build: 20200826_1250(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2020\"
2019.2.2 Hotfix | Version: 19.2.20.24 | Build: 20190808_0900(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2019\"
2018.3.2 | Version: 18.3.2.7 | Build: 20181011_1500(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2018\"
==> Running Revit Instances
PID: 19236 | 2020.2.3 | Version: 20.2.30.42 | Build: 20200826_1250(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2020"
PID: 27484 | 2019.2.2 Hotfix | Version: 19.2.20.24 | Build: 20190808_0900(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2019"
==> User Environment
Microsoft Windows 10 [Version 10.0.19042]
Executing User: LEMONYSNICKET\david
Active User:
Admin Access: No
%APPDATA%: "C:\Users\david\AppData\Roaming"
Latest Installed .Net Framework: 4.8
Installed .Net Target Packs: v3.5 v4.0 v4.5 v4.5.1 v4.5.2 v4.6 v4.6.1 v4.7 v4.7.1 v4.7.2 v4.8
Installed .Net-Core Target Packs: v2.1.600 v2.1.602 v3.1.409 v5.0.104 v5.0.201 v5.0.203
pyRevit CLI 4.8.7.0
@eirannejad eirannejad added Benign Bug Bug that doesn't stop user from using the tool but it makes it inconvenient [class] Prioritize The issue is planned to be resolved in the next version labels Jun 20, 2021
@dnenov
Copy link
Contributor

dnenov commented Oct 18, 2021

@eirannejad eirannejad added the Bundles Issues related to the pyRevit bundles [subsystem] label Dec 30, 2021
@jmcouffin
Copy link
Contributor

+1

@jmcouffin
Copy link
Contributor

@eirannejad Could you point at where this is suppose to happen so that someone can have a look please?

@Kashima419
Copy link

please help!

@acco-jpitts
Copy link
Contributor

Has there been any progress on this? Not working in Revit 2020-2022 and most google results related to this seem to point back to this issue. None of the PyRevit samples work either.

@carlpach
Copy link

carlpach commented Dec 9, 2022

+1

@martinservold
Copy link

RE: Topic
https://discourse.pyrevitlabs.io/t/i-dare-you-p-github-repo-fix-the-non-working-tooltip-preview-video/1136/5

@carlpach
Copy link

Thank you @martinservold! Are you sending a PR with this?

@dvdgnz
Copy link
Contributor

dvdgnz commented Feb 27, 2023

RE: Topic https://discourse.pyrevitlabs.io/t/i-dare-you-p-github-repo-fix-the-non-working-tooltip-preview-video/1136/5

thank you for this! it looks like it's the right direction. However I tried implementing the changed and I ran into some errors.

The first was that RibbonToolTip was not imported, so I changed
adwindows_obj.ToolTip = RibbonToolTip() to adwindows_obj.ToolTip = AdWindows.RibbonToolTip()
easy enough.

Then I got errors for some of the pyRevitTools:

ERROR [pyrevit.loader.uimaker] UI error: Can not create button | Error setting tooltip video C:\Users\davideg\OneDrive - Odeh Engineers, Inc\Repos\pyRevit\extensions\pyRevitTools.extension\pyRevit.tab\Modify.panel\edit1.stack\Match.splitpushbutton\Match.pushbutton\tooltip.mp4 | 'NoneType' object has no attribute 'ToolTip' 

Traceback:
 File "C:\Users\davideg\OneDrive - Odeh Engineers, Inc\Repos\pyRevit\pyrevitlib\pyrevit\coreutils\ribbon.py", line 1089, in create_push_button
 new_button.set_tooltip_media(tooltip_media)

ERROR [pyrevit.loader.uimaker] UI error: Can not create button | Error setting tooltip video C:\Users\davideg\OneDrive - Odeh Engineers, Inc\Repos\pyRevit\extensions\pyRevitTools.extension\pyRevit.tab\Modify.panel\edit1.stack\Match.splitpushbutton\Match Paint.pushbutton\tooltip.mp4 | 'NoneType' object has no attribute 'ToolTip' 

Traceback:
 File "C:\Users\davideg\OneDrive - Odeh Engineers, Inc\Repos\pyRevit\pyrevitlib\pyrevit\coreutils\ribbon.py", line 1089, in create_push_button
 new_button.set_tooltip_media(tooltip_media)

ERROR [pyrevit.loader.uimaker] UI error: Can not create button | Error setting tooltip video C:\Users\davideg\OneDrive - Odeh Engineers, Inc\Repos\pyRevit\extensions\pyRevitTools.extension\pyRevit.tab\Modify.panel\edit1.stack\Match.splitpushbutton\Match Properties.pushbutton\tooltip.mp4 | 'NoneType' object has no attribute 'ToolTip' 

Traceback:
 File "C:\Users\davideg\OneDrive - Odeh Engineers, Inc\Repos\pyRevit\pyrevitlib\pyrevit\coreutils\ribbon.py", line 1089, in create_push_button
 new_button.set_tooltip_media(tooltip_media)

It looks like self.get_adwindows_object() returns None for those commands, and this line:
adwindows_obj.ToolTip = AdWindows.RibbonToolTip()
generates the error since it is called outside the None check on the next line:
if adwindows_obj and adwindows_obj.ToolTip:

This code seems to be working for me:

    def set_tooltip_video(self, tooltip_video):
        try:
            adwindows_obj = self.get_adwindows_object()
            if isinstance(self.get_rvtapi_object().ToolTip, str):
                exToolTip = self.get_rvtapi_object().ToolTip
            else:
                exToolTip = None
            if adwindows_obj:
                adwindows_obj.ToolTip = AdWindows.RibbonToolTip()
                adwindows_obj.ToolTip.Title = self.ui_title
                adwindows_obj.ToolTip.Content = exToolTip
                _StackPanel = System.Windows.Controls.StackPanel()
                _video = System.Windows.Controls.MediaElement()
                _video.Source = Uri(tooltip_video)
                _StackPanel.Children.Add(_video)
                adwindows_obj.ToolTip.ExpandedContent = _StackPanel
                adwindows_obj.ResolveToolTip()
            else:
                self.tooltip_video = tooltip_video
        except Exception as ttvideo_err:
            raise PyRevitUIError('Error setting tooltip video {} | {} '
                                 .format(tooltip_video, ttvideo_err))

I will do a PR to add this

@jmcouffin
Copy link
Contributor

Fixed by #1742 thanks to @dvdgnz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benign Bug Bug that doesn't stop user from using the tool but it makes it inconvenient [class] Bundles Issues related to the pyRevit bundles [subsystem] Prioritize The issue is planned to be resolved in the next version
Projects
None yet
Development

No branches or pull requests

9 participants