HYP_STGR Posted July 21, 2017 Report Share Posted July 21, 2017 Hi! I trying to learn how to make my own hooks/actions and i'm following this tutorial: http://ftrack-connect.rtd.ftrack.com/en/stable/developing/tutorial/custom_applications.html After creating a houdini hook the tutorial says i have to override some ftrack modules that,in my case, are zipped in C:\Program Files (x86)\ftrack-connect-package-0.6.2/common.zip. Thing is, i don't want to risk ovewritting the base code(especially because i'm just learning how it works) so my question is: is there a way to make a modified version of the default python scripts (like ftrack_connect.application.ApplicationStore for example) and how do i make the connect know that it should use my version instead of the default one? thanks! Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted July 24, 2017 Report Share Posted July 24, 2017 Hi and welcome to the forums. The idea is not to override the functionality in common.zip, but to build your own class by inheriting the ApplicationStore. At the bottom of the linked article there is a downloadable example of the houdini hook. Best regards, Mattias L Link to comment Share on other sites More sharing options...
HYP_STGR Posted July 26, 2017 Author Report Share Posted July 26, 2017 Hi Thanks i was able to solve this problem. But i still don't understand how can i have my own version of your plugins. Let say i want to modify your nuke studio plugin without changing your code. How do i register to connect that it should use my scripts(in some folder in my system) instead of yours(in ftrack_connect)? Thanks. Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted July 27, 2017 Report Share Posted July 27, 2017 This sort of depends on how you want to modify them. If you're only after adding extra features like a processor to publish something custom that can be done by writing a plugin: http://ftrack-connect-nuke-studio.rtd.ftrack.com/en/stable/developing/index.html In other situations it may be a bit more involved and may require checking out our repositories or forking them. Is it anything in particular that you have in mind or just a general question? Link to comment Share on other sites More sharing options...
HYP_STGR Posted August 1, 2017 Author Report Share Posted August 1, 2017 Thanks that gave me some insight about actions. What i really need though is to understand how to integrate my plugins with ftrack connect. For instance, i have a hiero plugin that i want to be load when users launch hiero/nuke studio from both connect and the site. I'm following this page's example: http://ftrack-connect.rtd.ftrack.com/en/latest/developing/tutorial/adding_a_location.html i came up with this: def my_callback(event): environment = event['data']['options']['env'] ftrack_connect.application.appendPath("<my-plugin-path>",'HIERO_PLUGIN_PATH',environment) def register(session, **kw): '''Register action in Connect.''' # Validate that session is an instance of ftrack_api.Session. If not, assume # that register is being called from an old or incompatible API and return # without doing anything. if not isinstance(session, ftrack_api.Session): return session.event_hub.subscribe('topic=ftrack.connect.application.launch',my_callback) problem is, i need my plugin to know what entity launched hiero(My plugin needs to know what project it is working with for example) and i don't know how to send the context to my plugin. I know how to create a new session and recently learned that you can call get_shared_session() from ftrack_connect.application which i believe give me the session that launched the program from connect but not the context. Can you help me with that? Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.