Andriy Pogribniy Posted October 8, 2023 Report Share Posted October 8, 2023 import functools import logging import ftrack_api import ftrack_api.accessor.disk as _disk import ftrack_api.structure.standard as _standard logger = logging.getLogger('ftrack_user_location') def configure_location(session, event): USER_DISK_PREFIX = 'C:/Users/andri/Desktop/Temp/' location = session.ensure('Location',{'name': 'Test_Location2'}) location.accessor = _disk.DiskAccessor(prefix = USER_DISK_PREFIX) location.structure = _standard.StandardStructure() location.priority = 10 logger.warning('Registering test location') def register(api_object, **kw): if not isinstance(api_object, ftrack_api.Session): return api_object.event_hub.subscribe('topic=ftrack.api.session.configure-location',functools.partial(configure_location, api_object)) if __name__ == '__main__': logging.basicConfig(level = logging.INFO) session = ftrack_api.Session(server_url = 'https://inque.ftrackapp.com/', api_key = MY_API_KEY_HERE, api_user = MY_USER_NAME, auto_connect_event_hub = True) register(session) session.event_hub.wait() And nothing happens. What am I doing wrong? Link to comment Share on other sites More sharing options...
Andriy Pogribniy Posted October 9, 2023 Author Report Share Posted October 9, 2023 Ok, it works when put to the plugin folder. I thought this could work directly from IDE, like actions do. You guys really need some centralized and updated manual, right now your manuals are in "no good" condition. andrewb 1 Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted October 11, 2023 Report Share Posted October 11, 2023 Hi @Andriy Pogribniy glad to hear is working. If you have doubts on how location works I'd suggest having a look at our webinar on the subject. you can also find example locations on our recipes . Documentation wise, we are on it ! Hope it helps. L. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now