@@ -36,8 +36,12 @@ if "win" in sys.platform:
3636
3737import c4d # noqa: E402
3838
39- from ayon_core .resources import get_resource # noqa: E402
40- from ayon_core .pipeline import install_host # noqa: E402
39+ from ayon_core .resources import get_resource , get_ayon_icon_filepath # noqa: E402
40+ from ayon_core .pipeline import (
41+ install_host ,
42+ get_current_folder_path ,
43+ get_current_task_name
44+ )
4145from ayon_cinema4d .api import Cinema4DHost # noqa: E402
4246from ayon_cinema4d .api .lib import get_main_window # noqa: E402
4347from ayon_cinema4d .api .commands import (
@@ -60,6 +64,8 @@ AYON_RESET_RESOLUTION_ID = 1064318
6064AYON_RESET_COLORSPACE_ID = 1064320
6165AYON_EXPERIMENTAL_TOOLS_ID = 1064319
6266
67+ AYON_CONTEXT_LABEL_ID = 1064692
68+
6369
6470def get_icon_by_name (name ):
6571 """Get icon full path"""
@@ -72,6 +78,12 @@ def get_icon_bitmap_by_name(name):
7278 return bitmap
7379
7480
81+ def get_ayon_icon_bitmap ():
82+ bitmap = c4d .bitmaps .BaseBitmap ()
83+ bitmap .InitWith (get_ayon_icon_filepath ())
84+ return bitmap
85+
86+
7587class Creator (c4d .plugins .CommandData ):
7688 id = AYON_CREATE_ID
7789 label = "Create..."
@@ -198,8 +210,14 @@ class ExperimentalTools(c4d.plugins.CommandData):
198210 return True
199211
200212
213+ class ContextLabel (c4d .plugins .CommandData ):
214+ id = AYON_CONTEXT_LABEL_ID
215+ label = "{}, {}" .format (get_current_folder_path (), get_current_task_name ())
216+ icon = get_ayon_icon_bitmap ()
217+
218+
201219def install_menu ():
202- """Register the OpenPype menu with Cinema4D"""
220+ """Register the AYON menu with Cinema4D"""
203221 main_menu = c4d .gui .GetMenuResource ("M_EDITOR" )
204222 plugins_menu = c4d .gui .SearchPluginMenuResource ()
205223
@@ -216,6 +234,9 @@ def install_menu():
216234 menuresource_separator = 2
217235
218236 # Define menu commands
237+
238+ add_command (menu , ContextLabel )
239+ menu .InsData (menuresource_separator , True )
219240 add_command (menu , Creator )
220241 add_command (menu , Loader )
221242 add_command (menu , Publish )
@@ -272,6 +293,7 @@ if __name__ == '__main__':
272293 ResetColorspace ,
273294 # BuildWorkFileCommand,
274295 ExperimentalTools ,
296+ ContextLabel ,
275297 ]:
276298 c4d .plugins .RegisterCommandPlugin (
277299 id = command_plugin .id ,
0 commit comments