-
Posts
331 -
Joined
-
Last visited
-
Days Won
32
Reputation Activity
-
Lorenzo Angeli got a reaction from Bruce in custom location is created, but ftrack does not publish to this location
@Bruce please open a ticket with support@ftrack.com and we'll pick it up from there,
Cheers.
-
Lorenzo Angeli reacted to Bruce in custom location is created, but ftrack does not publish to this location
Hi Lorenzo, Thanks so much for the info and insight that you have been giving Dima. We really appreciate it.
-
Lorenzo Angeli got a reaction from Bruce in custom location is created, but ftrack does not publish to this location
Hi @dima,
both ftrack-sftp-accessor and ftrack-s3-accessor are api plugins and not server ones, therefore there's no point in trying to have them installed on the self hosted server.
In each repository you can find a snippet on how to initialise and use them just through the api:
s3-example , sftp-example
You can find an example use of the s3-accessor in this user-location plugin
for your third point, there's no need of using lambdas , you can just rely on the internal ftrack events to do so, please check the user-location above as reference.
hope it helps/
L.
-
Lorenzo Angeli reacted to Konstantin Maslyuk in pytest workflow?
@Jason Porath I found quite fine running running unit and functional tests on test projects right on production server. It is quite easy to construct any context with ftrack_api and release it after tests finished. In worst case you will got a bunch of test entities on test project that no one cares.
so feel free to:
@pytest.fixture def session(): return ftrack_api.Session() @pytest.fixture def context(request, session😞 context = session.create('Folder', {'parent_id': ..., 'project_id': ..., 'name': ...}) def finalizer(): session.rollback() session.delete(context) session.commit() request.addfinalizer(finalizer) return context The better approach is to running tests on staging ftrack server that should have relative fresh database snapshot from production, that is much more complex.
-
Lorenzo Angeli reacted to Benn in Connect 2.1.0
Connect 2.1.0 is now out and ready to download
Help docs
-
Lorenzo Angeli got a reaction from alexisp in Add user to project team using python API
Hi @alexisp could you please create an api user with explicit access to the private project and use that api key to create the session ?
you can find more information in our help page: https://help.ftrack.com/en/articles/3004264-private-projects
hope it helps.
L.
-
Lorenzo Angeli got a reaction from John Kalaigian in Invalid font prefix "ftrack" after installing Connect 2.0.0rc6
Hi @John Kalaigian I'm now looking into this issue.
it seems to be triggered due to a miss initialization of the icons during the fist storage scenario startup.
it'll be fixed in an upcoming patch version.
thanks for reporting it.
-
Lorenzo Angeli got a reaction from Evan Hale in Confusion about component.get_availability() return
HI @Evan Hale
could you please post or send to support the code you are running ?
The follwing snippet seems to return the availablity correctly:
hope it helps.
P.s
Looking back at the code , the call thatreturns a dictionary is on the component and not on the location:
This is because is returning the availablity for all the locations
you can find the location avilability passing the location itself into the method:
we'll have a look at updating the docs where needed.
Thanks for reporting.
L.
-
-
-
Lorenzo Angeli got a reaction from Pipeline Development in Change Version Number when creating Assets/Asset Versions
If you want to do it the ftrack way, I'd suggest let ftrack do the versioning .
to get more information on how to properly publish version please have a look in our api docs:
http://ftrack-python-api.rtd.ftrack.com/en/stable/example/publishing.html
Hope it helps.
L.
-
Lorenzo Angeli got a reaction from Vladimir Pylev in Has anyone written an AWS S3, or MS Azure Location Accessor
@Vladimir Pylev if you want to use a cloud/object storage for backup or data share purposes, you can try to use the ftrack-s3-accessor written by nifty digit.
At the moment I'm not aware of any accessor for google drive.
if you need further info about locations I'd suggest having a look at this webinar and our api docs on Locations
Hope it helps!
L.
-
Lorenzo Angeli reacted to Eric Levy in Download all
Update: I found a dev to write the script to select Versions and download the latest .mov that we uploaded. I'll put it up on Github once we're done and share it with everyone. It's working well, I just want to change one bit of UI feedback before releasing it.
-
Lorenzo Angeli got a reaction from Andrew Lawrence in Has anyone written an AWS S3, or MS Azure Location Accessor
Answered in support case, but here for reference:
For what concerns location accessors, is pretty doable to write S3 and Azure ones (it has already been done before), you can find further information looking into the api: https://bitbucket.org/ftrack/ftrack-python-api/src/master/source/ftrack_api/accessor/
If the cloud storages provide a python api access (eg: boto for Amazon S3) and using the base accessor ( https://bitbucket.org/ftrack/ftrack-python-api/src/master/source/ftrack_api/accessor/base.py)
as baseclass , is just matter of fully re implement the various method exposed.
Although I would suggest to use these as a mid ground storage and keep the production files locally to the office and use these other locations just for transfer, this would allow you to get the best of both worlds.
Hope it helps.
L.
-
Lorenzo Angeli reacted to Konstantin Maslyuk in Building from sources on Windows
In order someone to build ftrack-connect-spark and ftrack-connect-spark-adobe, there is a PR to update ftrack-connect-spark that resolves most of issues: https://bitbucket.org/ftrack/ftrack-connect-spark/pull-requests/65
-
Lorenzo Angeli got a reaction from oizac in session cache update
@chengshun we have been further looking into the reported issue.
One thing you can try is to replace the
session.cache.clear() call with
session.populate(project, 'notes') Please let us know if does solve your problem.
Cheers.
L.
-
Lorenzo Angeli got a reaction from Andrew Lawrence in Hiero not showing up in Ftrack Connect
Hi @db5007
the version of connect you are using does not run py3k applications such as Nuke 13 *.
If you want though, we have started a beta program here in the forum where we are providing support for those.
Hiero ,in the specific, is still missing but it'll come before final release.
If you are interested on joining please head here and get registered !
Hope it helps!
L.
-
Lorenzo Angeli reacted to PeterH in API Explorer GUI
I made a tool for exploring the API a while back (just remembered to post here after catching a few errors earlier this week), as I was a bit fed up of my old process which was like this:
>>> user = session.query('User').first() >>> print(user.keys()) # Look for a key related to groups >>> print(user['memberships']) # Perhaps this, check if entity or list >>> print(user['memberships'][0].keys()) # It's a list, check what each item has available >>> print(user['memberships'][0]['group'].keys()) # I see group, what keys does that have >>> print(user['memberships'][0]['group']['name']) # Found what I needed (random example though, I've never actually needed this) >>> user_groups = [membership['group']['name'] for membership in user['memberships']]
I find myself loading it now whenever I'm coding something that I'm unfamiliar with, so just sharing here in case anyone else would find it useful.
https://github.com/huntfx/ftrack-api-explorer
-
Lorenzo Angeli got a reaction from Andrew Lawrence in Review Session URL from python ?
Hi @alexisp,
at the moment there's no direct call from the api to get the review session url, but can be "easily" generated with the following snippet:
import ftrack_api session = ftrack_api.Session() # Retrieve the Review Session you are interested in rs = session.query('ReviewSession').first() # Ensure the shareable link is enable rs['shareable_url_enabled'] = true session.commit() # Get the signed url from the server signed_data = session.call([{'action':'generate_signed_url', 'entity_key':[rs['id']], 'entity_type':'ReviewSession'}]) # Compose the review url shareable_url = '{}/review/{}?signature={}'.format(session.server_url, rs['id'], signed_data[0]['signed_url']) print(shareable_url)
hope it helps.
L.
-
Lorenzo Angeli reacted to alexisp in Review Session URL from python ?
This is exactly what I needed !
I could not have come up with this by myself 🤓 !
Thx @Lorenzo Angeli !
-
Lorenzo Angeli got a reaction from alexisp in Review Session URL from python ?
Hi @alexisp,
at the moment there's no direct call from the api to get the review session url, but can be "easily" generated with the following snippet:
import ftrack_api session = ftrack_api.Session() # Retrieve the Review Session you are interested in rs = session.query('ReviewSession').first() # Ensure the shareable link is enable rs['shareable_url_enabled'] = true session.commit() # Get the signed url from the server signed_data = session.call([{'action':'generate_signed_url', 'entity_key':[rs['id']], 'entity_type':'ReviewSession'}]) # Compose the review url shareable_url = '{}/review/{}?signature={}'.format(session.server_url, rs['id'], signed_data[0]['signed_url']) print(shareable_url)
hope it helps.
L.
-
Lorenzo Angeli got a reaction from Andrew Lawrence in How do studios handle archiving old projects?
Hi @MattM,
One way of handling this could be to provide a secondary location (with a lower priority than you main one ) to be used to move copy the data you want to archive.
Such a solution can also provide various optional features, like archiving only approved data and backup dependent components.
Although at the moment we do not provide such a feature off the shelf, our api can provide you all the basic building blocks to build it.
Below some resources which can help you getting a grip with those:
Location :
https://help.ftrack.com/en/articles/1040442-locations
Location API:
http://ftrack-python-api.rtd.ftrack.com/en/stable/locations/index.html
Location Webinar:
https://www.ftrack.com/en/intro-to-locations-webinar
Actions (to trigger the data archiving)
https://help.ftrack.com/en/articles/1040465-actions
Actions API:
http://ftrack-python-api.rtd.ftrack.com/en/stable/handling_events.html
Depending on where you want to archive the data (if not on your local storage) you could also use third party
accessors such as the Amazon S3 one to have cloud backups:
https://pypi.org/project/ftrack-s3-accessor/
If you want to get your feet wet with Location I also suggest having a look into our Recipes repository for inspiration:
https://bitbucket.org/ftrack/ftrack-recipes/src/master/python/actions/multi_site_location/
Hope it helps.
If you have any further question please let us know!
L.
-
Lorenzo Angeli reacted to Konstantin Maslyuk in ftrack_api threadsafe
Hi, you could try now pip install ftrack-python-api==2.2.0rc1 or https://bitbucket.org/ftrack/ftrack-python-api/branch/backlog/threading/story#diff that is indented to solve threading issue.
-
Lorenzo Angeli got a reaction from John Kesig in Add to List when Publishing
Hi @John Kesig thanks for the suggestion !
We usually prefer to leave these customisation to end users to better match their local workflow.
Soon though, there'll be more agile ways to provide what you are after.
Cheers.
L.
-
Lorenzo Angeli reacted to Aaron Powell in Opening a file with a custom application action?
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.