0

How can I add custom command for shotgun file manager for Maya?

I mean when we click on new file on shotgun file manager, I want to create some custom groups depends on the context. I can add my command straight away to tk-multi-workfiles>>workfiles.py, but I need some way that I can create custom python file and add this functionality without changing the base workfile.py.

댓글 2개

  • 0
    Avatar
    Alan Dann

    Hi Vips,

    The best way to do this would be to override the scene operation hook for Maya.  The default implementation can be found here:

    https://github.com/shotgunsoftware/tk-multi-workfiles/blob/master/hooks/scene_operation_tk-maya.py

    This hook gets called when performing an action from the File Manager (it can be called several times for a single action - for example when opening an existing scene, the hook is called once to clear the current scene and once to load the new scene.)

    If you override the default hook (see here for more documentation on this) you can then customise the reset behaviour (https://github.com/shotgunsoftware/tk-multi-workfiles/blob/master/hooks/scene_operation_tk-maya.py#L90) when the parent_action=="new_file" to run your specific code immediately after the scene has been reset when performing a File-New operation.

    Does that help?  Let me know if you need more help with this

    Thanks

    Alan

  • 1
    Avatar
    Vips Rathod

    Thank you for reply Alan but I was in a rush so for now I just copied the tk-multi-workfiles and created my own new applications :). But I will surely implement this process. One more thing, I am wokring on some project that has almost 150 assets and shots around 600. Now when we open up shotgun filemanager it takes quite long time. Will there be any updates for this slow process ?

     

    Regards,

    Vipul Jain (Rathod)

댓글을 남기려면 로그인하세요.