-
Notifications
You must be signed in to change notification settings - Fork 9
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
Unreal context menus #48
Unreal context menus #48
Conversation
Adding option to unreal app to use asset context menu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really cool, I do have some concerns regarding this feature only wokring in Unreal.
Ideally the unimenu interface for all apps only adds new args if these are supported in all, or most apps. (see the features overview)
Let's see if we can make this feature a bit more generic.
exposed some flags to customise where the menu can be placed
Can now add seperatore Can now add icons
Can now add seperatore Can now add icons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when testing out the sample code on your branch, i get an error
import unreal_context_menu
LogPython: Error: Traceback (most recent call last):
LogPython: Error: File "<string>", line 1, in <module>
LogPython: Error: File "C:\Users\hanne\OneDrive\Documents\Unreal Projects\MyProject\Content\Python\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
LogPython: Error: return original_import(name, *args, **kwargs)
LogPython: Error: File "C:\Users\hanne\OneDrive\Documents\Unreal Projects\MyProject\Content\Python\Lib\site-packages\unreal_context_menu.py", line 72, in <module>
LogPython: Error: app_node = node.setup(backlink=False)
LogPython: Error: File "C:\Users\hanne\OneDrive\Documents\Unreal Projects\MyProject\Content\Python\Lib\site-packages\unimenu\apps\unreal.py", line 26, in setup
LogPython: Error: super().setup(parent_app_node=parent_app_node, backlink=backlink)
LogPython: Error: File "C:\Users\hanne\OneDrive\Documents\Unreal Projects\MyProject\Content\Python\Lib\site-packages\unimenu\apps\_abstract.py", line 214, in setup
LogPython: Error: self.app_node = self._setup_sub_menu(parent_app_node=parent_app_node)
LogPython: Error: File "C:\Users\hanne\OneDrive\Documents\Unreal Projects\MyProject\Content\Python\Lib\site-packages\unimenu\apps\unreal.py", line 40, in _setup_sub_menu
LogPython: Error: return parent_app_node.add_sub_menu(
LogPython: Error: AttributeError: 'NoneType' object has no attribute 'add_sub_menu'
I've just tested on a couple projects, and also tested with the branch pulled from git and haven't got the error. |
i'm on 5.0.2. i tested another sample demo |
|
FYI, i suggest to split this up in separate PRs, i noticed you also integrated icon and separator.
|
Sure ill make another pr with just the icons. Its strange that it does not work without opening the context menu first. I'm running the code on init_unreal.py so its happening at the earliest it can. I'll look into the extend method. and also exclude the separator and icon changes from this pull |
The 'menu_section' kwarg will be needed so the user can specify in the which area of the context menu to put the menu/action |
Ah yes, that goes together with the separator I believe |
set the target_section_name on the node .data so were not doing check on each add method excluded icon and seperator logic. Updated sample to reflect these changes
…_menus # Conflicts: # dev/unimenu_samples/menu_screen_unreal_context.png # dev/unimenu_samples/unreal_context_menu.py # unimenu/apps/unreal.py
Pulled your latest changes and now set the menu_section in data from the kwarg. so this can be re-used later in the icons and separator fix |
…rs functions directly, if explicitly stated.
…_menus # Conflicts: # unimenu/apps/unreal.py
An update that adds an option to setup menus in the context menu of an asset