Philip

Members
  • Content Count

    33
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Philip

  1. Sorry, this would be a Internal review session. I can't personally see a use for it being available for the client as they probably wouldn't have access to the studios actions.
  2. Hi We would like to be able to provide the users of the review page, the ability to run some of our actions. It would seem there is no place currently for running actions on either the right hand panel or on multiple selected versions on the bottom panel. Could I request some ability to add user actions here? Thanks Phil
  3. Hi Est Yeah, that's fixed it. Now launches fine. Awesome!! Thank you for that. @Mattias Lagergren Did you still want me to open a support ticket on this? Thanks Phil
  4. Hi Mattias I haven't as yet, partly because it not a pressing issue for us right now. It will require more of my time to investigate. If I do the investigation and don't get anywhere I will open a ticket. I figured that because nobody's seen this before, It probably is linked in someway to our setup, but unfortunately I've inherited a lot of legacy startup code and set up of max which I know little about, so its potentially a rather large investigation. I'll have to start with a vanilla install of max and go from there. thanks
  5. Philip

    Sharing Components

    OK Thank you for confirming. I think I must have imagined it working, and probably thought that because you can share a thumbnail you could share any component. But I guess the thumbnails are handled differently.
  6. Philip

    Sharing Components

    HI Just wondered, is it possible to share components between asset versions? I'm pretty sure I was doing this and it was working, however, I'm noticing now that its not working and I'm questioning my a sanity as to whether it ever was. If I create a Component (unmanaged location) on a AssetVersion all is good, but if I try to add the same Component to another AssetVersion, it simply transfers it. sourceAssetVersion = session.get("AssetVersion","cf0e384c-606d-4bc1-9fdd-b7983562bc32") destAssetVersion = session.get("AssetVersion","d9fdddf7-d27d-45ec-8bfb-1c95ecf97afa") destAssetVersion['components'].append(sourceAssetVersion['components'][0]) session.commit() Is this normal behaviour? thanks Phil
  7. Shotgun has this, and I found it very useful indeed. It allowed us to make more complicated relationships between entities. Especially when paired with non project entities as well. (Which I don't think ftrack has?) An example of that would be, when we tracked materials as non project entities, we could associate our assets with the materials (that would happen at publish time) and then we know which assets in which projects depended upon certain materials. +1
  8. Philip

    Adding Component Error

    Thank you, I think that's helped clear up things in my mind about how assets and asset version should be treated. I think one of the problems I had was understanding the rules of what should be unique. I didn't expect the name, type, parent to be unique fields on an asset, which is fine and makes sense, but it felt like trial and error and then trying to understand the response to find out what the rules were. For an entity seeing what fields must be unique?
  9. Philip

    Adding Component Error

    Hi Mattias task = session.get("Task","14fc7f1d-8927-44aa-9e30-526d83956fb1") assetType = session.query('AssetType where short is "comp"').first() assetName = "renders" publishFile = r"c:\\apath\\01_025_Compositing_v003.nk" location = session.query('Location where name is "ftrack.unmanaged"').first() asset = session.query('select versions from Asset where name is "{0}"'.format(assetName)).first() if asset is None: data = { 'parent': task['parent'], 'name': assetName, 'type': assetType, } asset = session.create("Asset", data) data = { "task": task, "asset": asset, "name": assetName + task['name'], "version": 4, "comment": "Testing API", } assetVersion = session.create("AssetVersion", data) assetVersion.create_component(publishFile, data={'name':assetName}, location=location) session.commit() There is my code, I do check for the existence of the asset before publish. But I do see a mistake in my query, as I'm checking across the whole of ftrack and not specific to my shot. Thank you, I will make the asset unique to the task
  10. Philip

    Adding Component Error

    After running tests. I think I have my answer. I don't think it has anything to do with the components at all. I think whats happening is that I'm creating an asset called say "renders" and I'm then attaching an assetVersion (called "task1AssetVersion") to that in task 1. Then when publishing to task 2 I'm publishing to the same "renders" asset but I have named the assetVersion differently (called "task2AssetVersion"), however if its the same version as the assetversion "task1AssetVersion" then it treats it as an duplicate entry. So it seems the name on an assetversion is irrelevant, in making it unique, and you should have only one set of assetVersions per asset. My mistake is reusing the same asset in task2 if I want to start the versioning from 1 again. Which I guess leads me to a more designed base problem\decision. Should I share the same asset across all my tasks on the shot, and accept my version numbers go up across tasks not per task, or do I produce an asset per task. The down side with the last one is that I suppose each tasks assets are unrelated to the previous tasks, and Its up to me to make the connection. It also seems by design in ftrack, that the assets are designed to be shared across tasks, and that's the way it should be done. Does this seem right? Thanks Phil
  11. Hi I am trying to register a component, and I am getting the following error: Failed to register components with location <Location("ftrack.server", 3a372bde-05bc-11e4-8908-20c9d081909b)> due to error: Server reported error: IntegrityError((IntegrityError) (1062, "Duplicate entry 'ee47fa1c-13d3-11e3-93e0-f23c91dfaa16-scene_01_025_Compositing-03' for key 'asset_Asset.typeid_key'") 'INSERT INTO asset (id, name, context_id, taskid, type_id) VALUES (%s, %s, %s, %s, %s)' (u'fac36b79-29c7-42e4-8933-afa820bf0754', 'scene_01_025_Compositing', '0311ec39-7af3-48e1-8509-c8b3b0916c86', None, 'ee47fa1c-13d3-11e3-93e0-f23c91dfaa16')) Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 1850849152>, 'f6ecce05-3213-4f40-b1f1-e9b31b3b10c9')] The trouble is I'm not quite sure what exactly, the error is telling me. It seems that there is a duplication of data, where that is not allowed. The entry seems to be the combination of the component name and its potential ID, being added to the key asset_Asset.typeid_key, which confuses me, because I thought components were added to the AssetVersion and not the asset directly. Can somebody help explain what this error is telling me. thanks Phil
  12. Hi I've just tried launching max 2017 for the first time with the new ftrack connect action. However when it starts I get the following error: -- Error occurred in anonymous codeblock; filename: C:\Program Files\ftrack-connect-package\resource\ftrack_connect_3dsmax\scripts\startup\initftrack.ms; position: 99; line: 3 -- MAXScript Auto-load Script Error - C:\Program Files\ftrack-connect-package\resource\ftrack_connect_3dsmax\scripts\startup\initftrack.ms Exception: -- Compile error: Can't find include file: ftrackassethelper.ms -- In line: include "ftrackassethelper.ms" Is anyone else getting this, I presume this is probably unique to me for some reason i'll have to investigate. Thanks Phil
  13. Hi Just been reading the documentation in the following link: http://ftrack-python-api.rtd.ftrack.com/en/stable/example/publishing.html It seems to me that the documentation misses out the `"parent": asset_parent` from the dictionary used in the creation of the asset. It mentions gathering the asset_parent in the example above but then does nothing with the variable. thanks Phil
  14. Hi I'm wondering how to create the tasks from a task template, through the API. I can't figure out how to access them. I was following the following doc: http://ftrack-python-api.rtd.ftrack.com/en/stable/example/project.html but it doesn't show how to create from task template. The task template would appear to be a child of the schema if the interface is anything to go by, but there doesn't seem to be anything in the items of the schema object, or a dedicated function. I did see there was a "_task_workflow" is that what I want, I presume not as its marked as private. Also according to the API, http://ftrack-python-api.rtd.ftrack.com/en/stable/api_reference/entity/project_schema.html the "get_types" only require one arg called schema, its not clear whats wanted here. As the object its self is supposed to represent the schema. Looking at your example code though you have passed a string called "Task". How do I know what options I can pass here? thanks Phil
  15. Having done this I'm still running into the same Issue. I am now trying to create v18 and there is only a v17 in ftrack, yet I am still getting the same error. Can anyone explain exactly what the error is trying to tell me? I get that its probably happening when I do assetVersion.create_component(publishFile, data={'name':assetName}, location=location) I'm not sure what the rules are here, but I must be trying to duplicate something that is not allowed. The asset is preexisting (but should be resused I think?), the assetVersion is new, the component is trying to be newly created. Perhaps the path has been registered already, could it be trying to tell me this? I also don't understand this part: Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 2841717392>, '33adc5ee-90cd-4e4b-a3b0-21980c3efc8e')] Thanks Phil
  16. I think I know what is happening. A change in our config means our publish files are saving to another location, and starting the version again. So its trying to create v1 when it already exists. I should check ftrack for the latest version as well as on disk to make sure that, I have the highest possible version first.
  17. Hi I'm still having a few issues creating asset versions. I've posted a snippet from my code bellow and the Error I'm getting. I'm having a hard time pin pointing whats happening here. Using the exact same code, sometimes this works and sometimes it errors. I accept it probably is the case of sometimes the information I feed in to it causes it to error, however I'm not sure what in that case. The section of the error "Duplicate entry '0704febd-acdb-4fc5-b212-c037039caf74-2' for key 'asset_version_assetid_key'" seems to suggest to me that I'm somehow attaching the AssetVersion twice to the Asset. Am I correct in interpreting this? Overview of code bellow: Get existing Asset or create one if none exists. Create new AssetVersion and attach it to the asset. Attach the thumbnail to the AssetVersion Create a new component on the AssetVersion containing my publish File Commit the session assetType = session.query('AssetType where short is "scene"').first() asset = session.query('Asset where name is "{0}"'.format(assetName)).first() try: if not asset: data = { 'parent': lemonEngine.currentContext.shot, 'name': assetName, 'type': assetType, } asset = session.create("Asset", data) data = { "task":lemonEngine.currentContext.task, "asset": asset, "name":assetName, "version":publishVersion, "comment":description } assetVersion = session.create("AssetVersion",data) if thumbnail: tempFile = pc.get_temp_thumbnail(thumbnail) assetVersion.create_thumbnail(tempFile.fileName()) tempFile.remove() assetVersion.create_component(publishFile, data={'name':assetName}, location=location) session.commit() except: session.rollback() raise Failed to register components with location <Location("ftrack.server", 3a372bde-05bc-11e4-8908-20c9d081909b)> due to error: Server reported error: IntegrityError((IntegrityError) (1062, "Duplicate entry '0704febd-acdb-4fc5-b212-c037039caf74-2' for key 'asset_version_assetid_key'") 'INSERT INTO asset_version (id, asset_id, thumbnail_id, version, comment, date, user_id, task_id, is_published, status_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (u'7da43300-b4d6-4159-96fb-4c2525ba6d7e', '0704febd-acdb-4fc5-b212-c037039caf74', None, 2, '', datetime.datetime(2016, 8, 12, 11, 39, 15, 498604), None, '2b659258-8d44-4018-b1b9-9c096c892d28', 1, None)) Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 2841717392>, '33adc5ee-90cd-4e4b-a3b0-21980c3efc8e')]
  18. Yes Sorry: versionID = "4f1d2286-4f9c-4406-b1a4-b918dbfeb987" filename = "L:\\script_library\\temporary_files\\1470830134.mov" version = session.get('AssetVersion', versionID) job = session.encode_media(filename) job_data = json.loads(job['data']) for output in job_data['output']: component = session.get('FileComponent', output['component_id']) # Add component to version. component['version_id'] = version['id'] # Add thumbnail to the version. if output['format'] == 'image/jpeg': version['thumbnail_id'] = output['component_id'] session.commit() produces the following error for me: Traceback (most recent call last): File "C:/Users/Philips/Documents/source_code/test_project/ftrack/make_playable_media.py", line 36, in <module> session.commit() File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\session.py", line 1159, in commit result = self._call(batch) File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\session.py", line 1528, in _call raise ftrack_api.exception.ServerError(error_message) ftrack_api.exception.ServerError: Server reported error: ValidationError(FileComponent with id u'734a28f2-5fa3-11e6-b665-22000ab8015b' was not found in an a valid location, please make sure it is present in the ftrack.server location.) I've got around it for the time being by adding the following at the end, but this doesn't seem like a good solution: retry = True while retry: try: session.commit() retry = False except: pass
  19. Hi I followed the instructions, but when I commit (which is doesn't do in the example), it gives me an error. I think this is because the job hasn't finished. If I put an arbitrary `time.sleep(20)` then it works fine, because the job has already finished by then. It doesn't mention in the example that you need to wait for the job to finish before committing the attaching of the component to the version, and adding the thumbnail. How do I correctly wait for the job to finish? Thanks Phil
  20. OK Solved it. I didn't realise I needed to pass an AssetType obj to the data used in the asset creation rather than the string name for the code. shot = session.query('Shot where id is "bf127242-da0b-40aa-ac19-ca793f7590e0"').first() typeObj = session.query('AssetType where short is "scene"').first() data = { 'parent': shot, 'name':"aAsset", 'type':typeObj, } asset = session.create("Asset", data)
  21. OK my Code had a stupid mistake in it. Realised I wasn't actually passing the data to the creation of the asset, and that the context id will likely become the id of the parent. location = session.query('Location where name is "ftrack.unmanaged"').first() task = session.query('Task where id is "d4564359-2944-49d4-93fa-b11909f19ff5"').first() shot = session.query('Shot where id is "bf127242-da0b-40aa-ac19-ca793f7590e0"').first() data = { 'parent': shot, 'name':"aAsset", 'type':'scene' } asset = session.create("Asset", data) data = { "task": task, "asset": asset, "name": "Philip Test", "version": 99, } version = session.create("AssetVersion", data) component = version.create_component( path=r"P:\a_project\series_01\sequences\025\sq025_sh040\2d\publish\v009\040_Compositing.nk", data={ 'name': 'nuke_script' }, location=location ) session.commit() now get the error No handlers could be found for logger "ftrack_api.session.Session" Traceback (most recent call last): File "C:/Users/Philips/Documents/source_code/test_project/ftrack/create_version.py", line 51, in <module> location=location File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\entity\asset_version.py", line 47, in create_component return self.session.create_component(path, data=data, location=location) File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\session.py", line 1816, in create_component 'FileComponent', path, data, location File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\session.py", line 1887, in _create_component location.add_component(component, origin_location, recursive=False) File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\entity\location.py", line 77, in add_component [component], sources=source, recursive=recursive File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\entity\location.py", line 249, in add_components transferred=transferred ftrack_api.exception.LocationError: Failed to register components with location <UnmanagedLocation("ftrack.unmanaged", cb268ecc-8809-11e3-a7e2-20c9d081909b)> due to error: Server reported error: AttributeError('unicode' object has no attribute '_sa_instance_state') Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 71112632>, 'P:\\a_project\\series_01\\sequences\\025\\sq025_sh040\\2d\\publish\\v009\\040_Compositing.nk')]
  22. Also I can't work out how the formatting of code works on these forums, when creating the orignal post. so apologises for the mess above
  23. Hi I am struggling to work out how to create a new AssetVersion in the new API. I think I have to do the following: Create an Asset -- parented to the shot Create an AssetVersion -- linking to the task and asset Create the Component. Unfortunately I'm getting an error, it seems to want a context_id on the Asset, but I don't know what to give it? I have the following code: location = session.query('Location where name is "ftrack.unmanaged"').first() task = session.query('Task where id is "d4564359-2944-49d4-93fa-b11909f19ff5"').first() shot = session.query('Shot where id is "bf127242-da0b-40aa-ac19-ca793f7590e0"').first() data = { 'parent': shot, 'name':"aAsset", 'type':'scene' } asset = session.create("Asset", {}) data = { "task": task, "asset": asset, "name": "Philip Test", "version": 99, } version = session.create("AssetVersion", data) component = version.create_component( path=r"P:\a_project\series_01\sequences\025\sq025_sh040\2d\publish\v009\040_Compositing.nk", data={ 'name': 'nuke_script' }, location=location ) session.commit() And I get the following error: Traceback (most recent call last): File "C:/Users/Philips/Documents/source_code/test_project/ftrack/create_version.py", line 51, in <module> location=location File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\entity\asset_version.py", line 47, in create_component return self.session.create_component(path, data=data, location=location) File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\session.py", line 1816, in create_component 'FileComponent', path, data, location File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\session.py", line 1887, in _create_component location.add_component(component, origin_location, recursive=False) File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\entity\location.py", line 77, in add_component [component], sources=source, recursive=recursive File "L:\script_library\pipeline\libs\3rd_party\production\ftrack_api\entity\location.py", line 249, in add_components transferred=transferred ftrack_api.exception.LocationError: Failed to register components with location <UnmanagedLocation("ftrack.unmanaged", cb268ecc-8809-11e3-a7e2-20c9d081909b)> due to error: Server reported error: OperationalError((OperationalError) (1048, "Column 'context_id' cannot be null") 'INSERT INTO asset (id, name, context_id, taskid, type_id) VALUES (%s, %s, %s, %s, %s)' (u'6220bf4b-3d0f-45cf-aa6c-45106fd49396', None, None, None, None)) Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 54489720>, 'P:\\a_project\\series_01\\sequences\\025\\sq025_sh040\\2d\\publish\\v009\\040_Compositing.nk')]