All Activity

This stream auto-updates     

  1. Yesterday
  2. Rory

    Action on Shot

    Thanks so much Lorenzo - Will take a look asap.
  3. Hi Dan, here is the connect-log file. regards, Marc ftrack_connect.log.zip
  4. Lorenzo Angeli

    Action on Shot

    Hi @Rory, if you want to write new actions I'd suggest having a look at our action handler. Regarding your question is because many of the Context entities comes from a common Task base entity (server side), if you want to properly identify have a look at the _get_entity_type method of the action handler. Hope it helps. L.
  5. Last week
  6. Rory

    Action on Shot

    Hi All, I am writing an action to create folder structures on disk based on some Ftrack details. I am trying to attach the action to a Shot. Below is a snippet of the 'discover' method. Why would the entity have to return true for 'task' to get Shot ? This works for Sequence and Shot but I am confused as to why the entityType to test is task and not shot ? def discover(self, event): '''Return action config if triggered on a single asset version.''' data = event['data'] '''If selection contains more than one item return early since this action can only handle a single version.''' # self.logger.info(event[]) selection = data.get('selection', []) self.logger.info('Got selection: {0}'.format(selection)) for item in selection: if item.get('entityType') == 'task': return { 'items': [{ 'label': self.label, 'description': self.description, 'actionIdentifier': self.identifier }] }
  7. import logging import ftrack_api import sys import pprint import ftrack_connect.application class ApplicationStore(ftrack_connect.application.ApplicationStore): '''Store used to find and keep track of available applications.''' def _discoverApplications(self): '''Return a list of applications that can be launched from this host.''' applications = [] if sys.platform == 'darwin': prefix = ['/', 'Applications'] applications.extend(self._searchFilesystem( expression=prefix + [ 'Blender*', 'Blender.app' ], label='Blender {version}', applicationIdentifier='blender_{version}' )) elif sys.platform == 'win32': prefix = ['C:\\', 'Program Files.*'] applications.extend(self._searchFilesystem( expression=( prefix + ['Blender Foundation', 'Blender*', 'blender.exe'] ), label='Blender {version}', applicationIdentifier='blender_{version}' )) self.logger.debug( 'Discovered applications:\n{0}'.format( pprint.pformat(applications) ) ) return applications class BlenderAction(object): '''Launch Blender action.''' # Unique action identifier. identifier = 'blender-launch-action' def __debug(self, message): f = open("C:\\Users\\aaron\\Desktop\\output.txt", "a") f.write(pprint.pformat(message)) f.close() def __init__(self, applicationStore, launcher): '''Initialise action with *applicationStore*.''' super(BlenderAction, self).__init__() self.logger = logging.getLogger( __name__ + '.' + self.__class__.__name__ ) self.applicationStore = applicationStore self.launcher = launcher if self.identifier is None: raise ValueError('The action must be given an identifier.') def register(self, session): '''Register action.''' session.event_hub.subscribe( 'topic=ftrack.action.discover', self.discover ) session.event_hub.subscribe( 'topic=ftrack.action.launch and data.actionIdentifier={0}'.format( self.identifier ), self.launch ) self.session = session def is_component(self, selection): if ( len(selection) != 1 or selection[0]['entityType'] != 'Component' ): return False return True def discover(self, event): '''Return action based on *event*.''' launchArguments = [] selection = event['data'].get('selection', []) if self.is_component(selection): component = self.session.get('Component', selection[0]['entityId']) if component is not None: location = self.session.pick_location() url = location.get_filesystem_path(component) launchArguments.append(url) items = [] applications = self.applicationStore.applications applications = sorted( applications, key=lambda application: application['label'] ) for application in applications: applicationIdentifier = application['identifier'] label = application['label'] items.append({ 'actionIdentifier': self.identifier, 'label': label, 'icon': 'http://icons.iconarchive.com/icons/dakirby309/simply-styled/256/Blender-icon.png', 'applicationIdentifier': applicationIdentifier, 'launchArguments': ['c:\\Users\\aaron\\Desktop\\lookdev_addon.blend'] #launchArguments }) return { 'items': items } def launch(self, event): '''Callback method for Blender action.''' applicationIdentifier = ( event['data']['applicationIdentifier'] ) context = event['data'].copy() return self.launcher.launch( applicationIdentifier, context ) class ApplicationLauncher(ftrack_connect.application.ApplicationLauncher): '''Custom launcher to modify environment before launch.''' def __debug(self, message): f = open("C:\\Users\\aaron\\Desktop\\output.txt", "a") f.write(pprint.pformat(message)) f.close() def _getApplicationLaunchCommand(self, application, context=None): command = ftrack_connect.application.ApplicationLauncher._getApplicationLaunchCommand(self, application, context) self.__debug(command) return command 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 applicationStore = ApplicationStore() launcher = ApplicationLauncher( applicationStore ) action = BlenderAction(applicationStore, launcher) action.register(session) Here's the full hook. To be honest, it's not too much different from the Houdini example in the docs at the moment, which is why I'm not sure what's going on. Let me know if something sticks out.
  8. Hi @Dave Goodbourn the list of available ones can be found here , if you need more complex ui you can think of using custom html widget . Hope it helps. L.
  9. @Aaron Powell would you mind either paste here the full launcher or send it over support so I can have a closer look ? Thanks. L.
  10. @Lorenzo Angeli _getApplicationLaunchCommand seems to only be returning the base command - ['C:\\Program Files\\Blender Foundation\\Blender 2.82\\blender.exe']. No attached launchArguments.
  11. Is it possible to have checkboxes/radioboxes in the interface? I've read something somewhere that you can but I might be getting confused with something else. Cheers, Dave.
  12. Hallo Marc, We are sorry you are having issues. Please could you send us the log files to our Support team via your existing Support ticket? The log files can be found in a separate directory from the ftrack Connect installation. You can open the directory from the About dialog by selecting About in the context menu that will be displayed when you click the ftrack icon in the menu bar/taskbar, and then clicking Open log directory. Cheers, Dan
  13. Earlier
  14. Cool! Take a look at this if you don't want to hand out that highly-provisioned API key to everyone https://bitbucket.org/ftrack/ftrack-connect/src/57ece813d21bff72621c1a6a58feb958cd0557cd/source/ftrack_connect/ui/login_tools.py?at=master#login_tools.py-12:13,75:76,84,87,92,95,100,103
  15. The user is just running the tool with a custom launcher written in python (so it's like running a command line) . I have a program called explorer which query ftrack to get all the projects/shot/task information for the user. Once he have choose a task the explorer launch the correct software with the correct context. I don't use ftrack connect. I have my own database for our projects, the goal is to work with the local DB and replicate the data in the ftrack one to use the Web UI to manage projects easily
  16. How's the user running this tool? Is there one persistent process running in a central location or is it more like a short-lived command invoked on the command line? Are you using ftrack Connect? Just the web UI? Depending on your use-case, either running your tool as a plugin in Connect, pulling the API key from the config file written by Connect, or using the method demonstrated by Connect to use an authenticated browser session to generate a new API key all sound like good options. If you're exposing this tool as a web page or widget itself, you could embed that in a dashboard and pull API credentials there too. Also, and I don't necessarily suggest this, a global API key can have the permissions to manage User's API keys, so you could generate a new one for each of your users, store them, then create sessions as needed. Be careful not to revoke their existing keys as that will log them out of Connect.
  17. I want the user to query the ftrack database using my python tool (listing projects, pick a shot, task, etc...) but i need this user to be bounded to his permissions. The global API keys aren't limited to the user's role so i need to use the user's key but i don't know how to get it to set the environment variable. The best way in my opinion is to ask the user for his ftrack login/pass to request his API key. But maybe i'm wrong...
  18. Hi Tony, What's your use case exactly? As you've found, the global API keys are not limited by the role(s) assigned to the user's whose username you use to instantiate your session.
  19. Hello, i've tried again but still stuck. If someone can help me with this problem My previous message explains everything. I can't find in the help file the way to use the user api key, so in the session creation i use a global one that I've created. But when i use it the queries aren't bounded to the user's permission
  20. @marc mantei _getApplicationLaunchCommand is a method of the ftrack connect ApplicationLauncher class. Using this as baseclass for your launcher will provide you access to the underlying method. You can see an example in the maya hook hope it helps. L.
  21. Dear Support, after having problems with the adobe creative webapp installalation, i followed adobes instructions to manually install the extension; frist i tried uninstalling the extension via the webapp; waiting, again request a client sync in the webapp, uninstalling adobe's extension manager as well, rebooting, downloaded the Anastasiy's Extension Manager and tried to install manually your "ftrack_connect_adobe_1.0.1.zxp" but it did not work unfortunalety; the extension seems not to be uninstalled yet. the zxp-installer mentioned by you did not solve the problem either, i can't select the zxp file or drop into the window. hope to read from you soon, how you are integrating adobe photoshop. regards, M.
  22. Hi, we are using adobe creative cloud and ftrack connect for our projects, and i want to open and publish files with photoshop in my project, however i cannot get adobe connect to work, especially i cannot get the extension to install properly. after adding the extension from the adobe creative cloud website, nothing changed. and after installing the adobe extension manager and adding the plugin manually i receive an error that the versions are not matching with my product. so currently i can see adobe actions in my ftrack connect window, can start my adobe app, but cannot publish or open files with photoshop. please have a look on the screenshot i add and give me a solution on how to properly connect my adobe suite to ftrack. PS. please feel free to move this topic to the right forum as needed. thanks.
  23. Hi Lorenzo, i am currently looking for the same solution and my launchArgument gets not populated when running my application too. can you please give more details on how to overwrite the "_getApplicationLaunchCommand" ? this function is not included in my hook, and adding this function from your mentioned site will miss some inputs i cannot work out to handle. this is my first time using ftrack. thanks in advance. M.
  24. That's the problem, i've tested my code with 2 differents users : me : I can see every project user2 : who can see only one project in his web browser And the result of the query Project where status is active is the same for both user. That's why i'm asking for help to know where is the problem. Is it because i use the same global api_key i've created ? Do i need to use user's api key ? if its the only way how can i get this key by code ?
  25. Hi @tdugard, users query will respect the roles assigned, so they will have different result depending on what they have been set to, especially in regard of the private projects. If you want to ensure these are maintained I'd suggest setting up different global API keys for different behaviours. hope it helps. L.
  26. Thanks for the quick reply, but the problem i see here is that a user with some coding skill can easily create a function using environment variables that can show the entire project list and can query everything ? Even if in webview he can't see all the projects.. The better solution is to use the user auth_key to connect to the session but i have no clue how to request it via user/password because actually i'm using a global API_key that i have created in Security > Api Keys Like you said i need the result bounded to the user permissions. How can i acheive that ?
  27. Hi @tdugard api are not supposed to return filtered results, unless these limits are bound to your user permissions level. What you should do is to filter out the result for the user you are interested in during the query, something along these lines should work. import ftrack_api import os project_name = 'myproject' # login data is passed to the session through environments session = ftrack_api.Session() ftrack_user = session.query('User where username is {}'.format(session._api_user)).first() tasks = session.query('Task where project.name is "{0}" and assignments.resource_id is "{1}" order by name asc'.format(project_name, ftrack_user['id'])) for task in tasks: print t
  1. Load more activity