Eric Hermelin

Members
  • Content Count

    46
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Eric Hermelin

  1. Not that I can think of, I suppose you could use projections and filter out a few entries like below to make it a bit quicker. search_key = '2_Client_Meeting' for custom_attribute_config in session.query( 'select config from CustomAttributeConfiguration where config like "%\\"data\\"%"' ): try: data = json.loads( json.loads(custom_attribute_config.get('config'))['data'] ) for entry in [entry for entry in data if entry['value'] == search_key]: logging.info( u'found: {0} for key in {1}'.format( entry['menu'], custom_attribute_config['key'] ) ) except ValueError: raise cheers Eric
  2. Hi, Your second example looks right, I wounder if you could have had something else in your session when you committed? Could you try the code below, the only difference here is that we make sure the status is valid for the tasks project. session = ftrack_api.Session( auto_connect_event_hub=False ) task = session.query( 'select project.project_schema from Task' ).first() valid_statuses = task['project']['project_schema'].get_statuses( 'Task' ) task['status'] = valid_statuses[0] session.commit() cheers Eric
  3. Hi Tim, you can reach the custom attribute configuration like this project = session.query( 'select custom_attributes.configuration.label from Project' ).first() for custom_attribute in project.get('custom_attributes').collection: logging.info( custom_attribute.get('configuration').get('label') ) cheers Eric
  4. Hi, could you open a support case ( mail support@ftrack.com ) and attach the log files listed below after having run an other failed export job. /tmp/ftrack.log /tmp/ftrack_reg_worker_*.log /tmp/ftrack_cluster_worker_*.log cheers Eric
  5. Hi, you could order by the version attribute ie. asset_version = session.query( 'select version from AssetVersion where task_id is "{0}" order by version desc'.format( 'ecac0828-4d0a-11e7-953e-0a580aa00899' ) ).first() cheers Eric
  6. Hi Pramod, We resolved an other issue in regards maya 2018 and windows in version 0.7.5 ( turned out to be issues with the QtWebWidgets library ), the client we debugged that issue with have since reported that it is working for them with both 2018.1 and 2018.2 of Maya. Could you open a support case as it would be great if we could gather some additional information about your environment. Sorry for the inconvenience but it is tricky to debug a issue we are unable to recreate in our own environment. cheers Eric
  7. Hi Kat, We have identified one issue that was fixed in version 0.7.4 of connect. Since that release everything is working as expected within our test environments with maya 2018.1 running on windows 10, we do however have one customer, that we are aware of, running windows 7 that is still experiencing issues ( although it appears to be something other original issue but with a similar result ). We are continuing trying to debug the issue but it is a slow process as we are not able to replicate the issue locally. Could you tell us more about your environment, version of connect, exact version of maya and windows version. cheers Eric
  8. Hi Alex, the below example should replicate the drag and drop behavior: import ftrack_api import ftrack_api.symbol session = ftrack_api.Session() file_path = '/home/erhe/Downloads/colour_wheel.mov' asset_name, _ = os.path.splitext( os.path.basename(file_path) ) asset_type = session.query( 'AssetType where name is "Upload"' ).one() shot = session.get( 'Shot', '28032993-d3e7-44c8-83c5-fe42e080d86a' ) asset = session.create('Asset', { 'name': asset_name, 'type': asset_type, 'parent': shot }) asset_version = session.create('AssetVersion', { 'asset':asset, 'task': shot }) component = asset_version.create_component( path=file_path, data={ 'name': asset_name }, location=session.get('Location', ftrack_api.symbol.SERVER_LOCATION_ID) ) asset_version.encode_media( component ) session.commit() result : I am unsure why your first example where you set the metadata manually fails to play in the web player, could you tell me what version of the python api you are running? cheers Eric
  9. Hi Ozen, hope you are well! It is possible to using a advanced query filter to filter on linked entities, below are a few examples, it is however a bit fiddly to update these query filters if you wish to iterate over a few different shots / asset builds, so it might be worth writing a tool using the api to export the information in bulk Using a Shot Query filter, show only shots that have a incoming link to a asset builds named "Monkey" incoming_links.from.name = 'Monkey' Using a Asset Build Query filter, display all asset builds used for a specific shot outgoing_links.to.name = 'SHOT_NAME' cheers Eric
  10. Hi, you can get the asset types for a project / project schema like this session = ftrack_api.Session() project = session.query( 'Project where name is "<ProjectName>"' ).first() types = project.get('project_schema').get_types('AssetBuild') cheers Eric
  11. Hi Tim, I am not too familiar with python on windows, I would however start with making sure your PATH environment variable does not contain references to your standalone python interpreter, you could "sanitize" the environment in the base application launcher for nuke in the ftrack_connect_nuke_hook updating the _getApplicationEnvironment method. cheers Eric
  12. Hi Tim, could you send me the content of the PYTHONPATH, PYTHONHOME and PATH environment variables from inside of nuke or if your ok with it the full content of your environment. import os import pprint pprint.pprint( os.environ ) cheers Eric
  13. Hi Tim, it looks strange that it would pickup your external hashlib, I believe it should be picking up the version shipped with Nuke. Could you try running the below inside of a "clean" Nuke and one launched within your configured environment import random import hashlib print random.__file__ print hashlib.__file__ print random._hashlib.__file__ cheers Eric
  14. Hey Toke, currently our bug tracker is not publicly available, I have however made a note on the ticket to update this thread once addressed. cheers Eric
  15. Thanks for the additional information, I am able to reproduce the issue on Project entities. I will create a bug ticket for this. cheers Eric
  16. Hi Toke, There should be a event emitted when a hierarchical custom attribute is modified. I am not able to replicate your issue, what version of ftrack and the ftrack python api are you running? cheers Eric
  17. Hi Remus, I will take a deeper look at this, in the meantime could you use Session.populate, it should fore a reload of the data del test_asset['custom_attributes'] self._session.populate( test_asset, 'custom_attributes' ) cheers Eric
  18. Hi, Currently this does not exists for other entities, we are however discussing different approaches for allowing this in the future. In the meantime you could perhaps ( provided the entity was created through the web interface ) create send back some feedback to the user with something like: session.delete( task ) event = ftrack_api.event.base.Event( topic='ftrack.action.trigger-user-interface', data={ 'type': 'message', 'success': False, 'message': 'Your task was incorrectly named' }, target=( 'applicationId=ftrack.client.web and user.id={0}'.format( event['source']['user']['id'] ) ) ) session.event_hub.publish( event ) session.commit() cheers Eric
  19. Hi Julian, You are describing the current workflow our standard integrations correctly, it is however possible to extend these tools to fit other workflows. Below we create a new asset version, use it to generate a path through the locations structure, allow nuke to create the files and then add the generated files to the final location. Since we have set the location as unmanaged the data will not be touched but instead assumed to already be in the correct place. import ftrack_api session = ftrack_api.Session() # Get the current context current_context = session.get( 'TypedContext', os.getenv('FTRACK_TASKID') ) # Ensure that there is a asset called test asset = session.create( 'Asset', {'name':'test', 'parent':current_context.get('parent')} ) # Create a asset version attaching it to the current # context. asset_version = session.create( 'AssetVersion', {'task':current_context, 'asset':asset, 'is_published':True} ) # Here we must call commit, creating the asset version. session.commit() # We create a component for the nuke script script_component = asset_version.create_component( 'test-nuke.nk' ) # and one for a image sequence sequence_component = asset_version.create_component( 'image.%04d.exr [1-100]' ) # We pick the default location location = session.pick_location() # get the location for the nuke script nuke_script_path = location.structure.get_resource_identifier( script_component ) # get the location for the image sequence image_sequence_path = location.structure.get_resource_identifier( sequence_component ) # # Write your file to disk and then add your output files to the # components. # setup the location to be unmanaged, meaning that it will not try # to manage any files ftrack_api.mixin( location, ftrack_api.entity.location.UnmanagedLocationMixin ) # Add the components to the location location.add_component( script_component, None ) location.add_component( sequence_component, None ) asset_version['is_published'] = True session.commit() As you can see in the above example, we first create a AssetVersion in order to generate our expected filepath, this is a limitation of the base Structure plugin, but could be solved by implementing a custom Structure. To allow for this functionality in the current tools you would have to configure your preffered "location" with the UnmanagedLocationMixin, you can read more about that in the documentation found here : http://ftrack-python-api.rtd.ftrack.com/en/stable/locations/configuring.html and more about the general concepts of locations here : http://ftrack-python-api.rtd.ftrack.com/en/stable/locations/index.html cheers Eric
  20. Hi Denis, it is currently not possible to move the panels, you could however make the info panel bigger by dragging on its left edge so that the inbox does not completely cover it. cheers Eric
  21. Hi Denis, clicking the link should bring out the side panel to display the task, could it be that the side panel is hidden underneath your inbox? cheers Eric
  22. Hi Luigi, When filtering based on the asset type name on the versions page you would have to use ie: asset.type.name = "Camera" cheers Eric
  23. Hey, to me the idea of being able to link a shot / task to a "Asset" as opposed to a specific asset version makes more sense, this would allow you to control the version being loaded easily through the statuses of the published asset versions under the asset ie "Approved" / "Rejected" etc.. This would make the updating process less heavy as you would only need to change the asset version status in order to propagate new versions throughout the project. That being said in some cases you might end-up in a situation where different shots require different versions of the same asset. While splitting the asset into multiple at this stage might be the "clean" workflow that is of course not always a possibility and might cause issues later in the project. It would thus also be useful to be able to link a specific asset version as a override/locked version. One implementation of this is to introduce a separate asset / asset version that contains the information to build the shot published under each shot, versioned separately and basically contain references to each asset ( or specific asset version ) required to build the shot, it could be represented as a simple json file. The big downside to this however is that it would not be visible or modifiable through the web interface without implementing special actions. It would be great to hear more thoughts on this as I am sure there are many different implementations and considerations on this! cheers Eric
  24. Hi Phil, Support for accessing task templates through the API was added in version 3.5.3 ( http://ftrack.rtd.ftrack.com/en/stable/release/release_notes.html#release-3.5.3 ). You can find some examples of the usage in the ftrack python api documentation http://ftrack-python-api.rtd.ftrack.com/en/latest/example/task_template.html cheers Eric
  25. Hi Toke, how are you calling encode_media, with a local file path or a component? cheers Eric