Jean-Marc
(Jean-Marc Couffin)
September 22, 2022, 3:15pm
1
opened 09:34PM - 06 Jun 21 UTC
closed 04:38PM - 27 Feb 23 UTC
Prioritize
Benign Bug
Bundles
**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
```
if someone is good at it and kind enough to look at it and if not fixing it point in the right direction, that woul be greatly appreciated
Related How Can I Add video to Tooltip
This seems to be working for me.
In Coreutils>ribbon.py
from Autodesk.Windows import RibbonToolTip
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
adwindows_obj.ToolTip = RibbonToolTip()
if adwindows_obj and adwindows_obj.ToolTip:
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))
3 Likes
AliJALIL
(Ali)
February 21, 2023, 10:50am
3
martin.servold:
In Coreutils>ribbon.py
Should I Add this def to a py file ? or should i create it ? I can’t find the “Coreutils>ribbon.py” , in which folder may i find it ? Thank you Martin.
This would be a change to the pyrevit master branch. If you wanted to try to change it on your end you can find this file here:
{Pyrevit core install location}\pyrevitlib\pyrevit\coreutils\ribbon.py
The function above should already exist in that file, I’ve just made a few changes to it.
1 Like
AliJALIL
(Ali)
February 21, 2023, 3:59pm
5
Worked perfectly ! Thank you Martin
Jean-Marc
(Jean-Marc Couffin)
February 27, 2023, 4:43pm
6
3 Likes