Search the Community

Showing results for tags 'api'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Company news
    • General announcements
  • ftrack Studio (main app)
    • General discussion
    • Feature requests
    • API
    • Help
    • Actions and Widgets
    • ftrack Go
  • Connect and plugins
    • General discussion
    • Connect package releases
    • Feature requests
    • Help
    • Connect plugins releases
  • Reviews
    • General discussion
    • Feature requests
    • Help
  • Advisory Forum
  • Tech preview
    • API
    • New integrations
    • Studio overview
    • ftrack Review

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 25 results

  1. <ftrack_api.query.QueryResult object at 0x0000024562AC9CF8> # Error: ftrack_api.session.Session : Server reported error: ValueError(Cannot set relationship to string value.) # # Error: Server reported error: ValueError(Cannot set relationship to string value.) # Traceback (most recent call last): # File "<maya console>", line 1, in <module> # File "R:/Pipeline/configs/assetPipeline\assetAPI.py", line 430, in publishComponent # self.set_component(oVersion, filePath) # File "R:/Pipeline/configs/assetPipeline\assetAPI.py", line 420, in set_component # self.session.commit() # File "R:/Pipeline/APIs/ftrackAPI\ftrack_api\session.py", line 1241, in commit # result = self._call(batch) # File "R:/Pipeline/APIs/ftrackAPI\ftrack_api\session.py", line 1620, in _call # raise ftrack_api.exception.ServerError(error_message) # ServerError: Server reported error: ValueError(Cannot set relationship to string value.) # MY CODE def set_component(self, asset_version, filePath): logger.info("Publishing Component %s ---------------------------------" % filePath) location = self.session.query('Location where name is "ftrack.unmanaged"').one() # This is important # location = self.session.query('Location where name is "{}"'.format("ftrack.unmanaged")).one() print asset_version print "FilePath: %s" % filePath print "Location: " print location ft_component = asset_version.create_component(path=filePath, location=location) self.session.commit() if ft_component: logger.info("Publishing Component Succesful %s ---------------------------------" % ft_component) return ft_component def publishComponent(self, sAsset, componentType, filePath, sTaskType="Rigging",iVersionNumber=1): oVersion = self.build_asset_version(sAsset, sTaskType,iVersionNumber) print oVersion.keys() if componentType in ["model", "rig"]: publishChecks.sanityChecks(componentType) self.set_component(oVersion, filePath) def build_asset_version(self, sAsset, sTaskType, version=0, note=''): '''Builds an AssetVersion, it takes an asset and a task as arguments"''' asset = self.getOAsset(sAsset,sTaskType) task = self.getOTask(sAsset,sTaskType) try: # ONLY HERE FOR DEV DELETE AFTERWARDS version_query = 'AssetVersion where task_id is "{}" and version is "{}" and asset.type.id is "{}"'.format( task['id'], int(version), asset['type']['id']) current_versions = self.session.query(version_query).one() if current_versions: # Deletes the old version ^^^^^^^ DEV ONLY ^^^^^^^^ self.session.delete(current_versions) self.session.commit() except: logger.info("Asset Version Creation Error %s ---------------------------------" % asset['name'])
  2. Hello again, we would like to use Dynamic Enums to let our team-members select maya plugins from a drop-down which is populated from a folder containing all plugins available. For this we prepare the dropdown contents like described here: http://ftrack.rtd.ftrack.com/en/3.3.7/developing/dynamic_enumerator.html The resulting list looks like this: [{'name': '3Delight - 8.0.572', 'value': 'C:\\ConfigurationSync\\Maya\\3Delight\\3Delight_8.0.572'}, {'name': 'abcToA - 3.0.0 - 2018 - 2.0.1', 'value': 'C:\\ConfigurationSync\\Maya\\abcToA\\3.0.0_2018_2.0.1'}, {'name': 'abcToA - 3.0.1 - 2018 - 2.1.0.1', 'value': 'C:\\ConfigurationSync\\Maya\\abcToA\\3.0.1_2018_2.1.0.1'}, {'name': 'aTools - 2.0.1', 'value': 'C:\\ConfigurationSync\\Maya\\aTools\\2.0.1'}, {'name': 'aTools - 2.0.2', 'value': 'C:\\ConfigurationSync\\Maya\\aTools\\2.0.2'}, {'name': 'bonusTools - 2018', 'value': 'C:\\ConfigurationSync\\Maya\\bonusTools\\2018'}, {'name': 'cosmos - 1.0', 'value': 'C:\\ConfigurationSync\\Maya\\cosmos\\1.0'}, {'name': 'exocortex - crate - 1.1.153', 'value': 'C:\\ConfigurationSync\\Maya\\exocortex_crate\\1.1.153'}] This list has about 150 entries in the end. We noticed, that having 2-3 entries sometimes works and sometimes not. We Cannot figure out, what the problem with this might be. Are we missing anything here? Why is this not working? Thanks very much in advance Tim
  3. Hey there, we are currently trying to send custom events via the javascript api (as the title might let you guess... ) In a Node-style js-file we're testing the following code, which is sadly not working... var EventSender = function(server, user, key) { require('isomorphic-fetch') var ftrack = require('ftrack-javascript-api'); this.session = new ftrack.Session(server, user, key); if (this.session==null) { console.log('Error creating session'); return; } this.DoStuff = function() { // TODO: find another way to solve this // make session available to all subfunctions by creating a 'locally scoped' variable // otherwise 'this.session' is only available at the outermost usage (i.e. only on line 28) // the nested functions below line 28 don't know about 'this.session' var session = this.session; if (session==null) { console.log('Error - No active Session'); return; } return session.initializing.then(function() { var event = new ftrack.Event('infected.custom-event', {foo: 'bar', xyz: true}); console.log('sending...'); return session.eventHub.publish(event); }).catch(error => {console.log(error);}); } } sender = new EventSender('http://192.168.5.14', 'Admin', 'f22192fc-0cb6-11e8-b2cb-7ab7a47c9dda'); sender.DoStuff(); The resulting error-msg is: TypeError: Cannot read property 'socket' of null at EventHub._runWhenConnected (C:\dev\javascript\ftrack.OS.management\node_modules\ftrack-javascript-api\lib\event_hub.js:307:32) at C:\dev\javascript\ftrack.OS.management\node_modules\ftrack-javascript-api\lib\event_hub.js:224:23 at new Promise (<anonymous>) at EventHub.publish (C:\dev\javascript\ftrack.OS.management\node_modules\ftrack-javascript-api\lib\event_hub.js:223:31) at C:\dev\javascript\ftrack.OS.management\sendEventTest.js:30:28 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) So for some reason, the local property '_socketIo' in event_hub.js is still null inside the method '_runWhenConnected', which is called in 'publish()' on line 224. Can you tell me why that is the case? having the same setup, we already successfully created calendar-events and other objects. Side-Question: Is it possible to send a custom event via javascript-api and receive it via the python-api? Thanks in advance Tim
  4. Hi everyone, We use a cloud instance of our project and regularly our users experience some network error: proxy error, connection timeout etc Usually a retry is enough, but eventually it will stop a process and leave an asset unpublished or not entirely prepped. Have anyone experience issues like this ? Is there a common recipe to try/catch all errors that would be network related from ftrack_api ?
  5. I am trying to create a new Calendar Event using the api, but I think this is not currently being supported. The old api had a project.createPhase() method which is the one I am testing to create this entity. Is this the correct way to approach the creation of events through the api? FYI: I am currently using the 3.5 (latest) ftrack api for python.
  6. Hey there, as part of our integrations, we want to be able to setup entries in the 'overview calendar' for 'projects and users'. for example 'Add Leave' should be available. Ideally this should be done via external api-calls in javascript. by executing this: console.info(Object.keys(session.schemas)); for (schema in session.schemas) { console.info(session.schemas[schema]); } We found out, that there is something called: 'CalendarEvent'. Are we on the right track, playing with this? Since we don't know, how to deal with this, we shoot in every direction.. Is it possible to 'Add Leave' for a user via the javascript api? If yes, how is it done? We tried this: var query = 'select id from CalendarEvent'; But the result is: '(node:7332) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: request is not defined' Any help/assistance/ideas are greatly appreciated! thanks in advance Tim
  7. Is there a way to listen to when incoming/outgoing links are created/removed via the api? The ftrack.* topic doesn't seem to fire an event when a link is created. Alternatively is there a simple way to publish an event when a link is created/removed?
  8. Hey there, we are trying to add managers programatically when a corresponding field was altered. We tried this: project = ftrack.getProject('dev_tutorial') user = ftrack.User('username') managerType = ftrack.ManagerType('Supervisor') # Add the user as a supervisor on the dev_tutorial project. manager = project.createManager(user, managerType) (taking a correct project, user and managerType) ..which is described here. But sadly this didn't work. what do we have to do to create these managers via the new api, since 'Manager' is not a known type? Generally: it helps a lot going through the migration notes and code-snippets to get hints on how to use the new api, but every now and then, we stumble on something, that can not be found. Is there a common way to find out usages? EDIT: Some addition information: This is the line that crashes: manager = project.createManager(userToUse, managerType) the resulting log gives us: 2018-01-09 10:20:00,404 - ftrack_api.event.hub.EventHub - ERROR - Error calling subscriber <Subscriber metadata={'id': '619a63bab1c443d09f4d982926e36196'} subscription="topic=ftrack.update"> for event <Event {'topic': u'ftrack.update', 'source': {u'applicationId': u'ftrack.client.web', u'user': {u'username': u'TEdelmann', u'id': u'75b59aae-e1bb-11e7-ad88-7ab7a47c9dda'}, u'id': u'b85b77aa-f51d-11e7-92c6-7ab7a47c9dda'}, 'target': u'', 'data': {u'entities': [{u'keys': [u'Briefing_Team_01_TandemProducer_EUsers'], u'objectTypeId': u'show', u'entityType': u'show', u'parents': [{u'entityId': u'108157f2-e3d9-11e7-9067-7ab7a47c9dda', u'entityType': u'show', u'parentId': None}], u'parentId': None, u'action': u'update', u'entityId': u'108157f2-e3d9-11e7-9067-7ab7a47c9dda', u'changes': {u'Briefing_Team_01_TandemProducer_EUsers': {u'new': u'Daniel Brylka', u'old': u'Daniel Schindler'}}}], u'pushToken': u'b91a65ca-f51d-11e7-b15d-7ab7a47c9dda', u'parents': [u'108157f2-e3d9-11e7-9067-7ab7a47c9dda'], u'user': {u'userid': u'75b59aae-e1bb-11e7-ad88-7ab7a47c9dda', u'name': u'Tim Edelmann'}, u'clientToken': u'b85b77aa-f51d-11e7-92c6-7ab7a47c9dda'}, 'in_reply_to_event': None, 'id': u'5e7358c282f448729f42a0d342bdd3d3', 'sent': None}>. Traceback (most recent call last): File "c:\python27\lib\site-packages\ftrack_python_api-1.3.3-py2.7.egg\ftrack_api\event\hub.py", line 693, in _handle response = subscriber.callback(event) File "C:\git\Actions\AttributeChangedHandler.py", line 58, in launch manager = project.createManager(userToUse, managerType) File "c:\dev\fcp\ftrack-connect-package\.eggs\ftrack_python_legacy_api-3.6.2-py2.7.egg\FTrackCore\api\client.py", line 232, in createManager response = xmlServer.action('create', data) File "c:\dev\fcp\ftrack-connect-package\.eggs\ftrack_python_legacy_api-3.6.2-py2.7.egg\FTrackCore\api\xmlserver.py", line 300, in action response = function(data) File "c:\Python27\lib\xmlrpclib.py", line 1243, in __call__ return self.__send(self.__name, args) File "c:\Python27\lib\xmlrpclib.py", line 1596, in __request allow_none=self.__allow_none) File "c:\Python27\lib\xmlrpclib.py", line 1094, in dumps data = m.dumps(params) File "c:\Python27\lib\xmlrpclib.py", line 638, in dumps dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 660, in __dump f(self, value, write) File "c:\Python27\lib\xmlrpclib.py", line 741, in dump_struct dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 660, in __dump f(self, value, write) File "c:\Python27\lib\xmlrpclib.py", line 762, in dump_instance self.dump_struct(value.__dict__, write) File "c:\Python27\lib\xmlrpclib.py", line 741, in dump_struct dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 660, in __dump f(self, value, write) File "c:\Python27\lib\xmlrpclib.py", line 762, in dump_instance self.dump_struct(value.__dict__, write) File "c:\Python27\lib\xmlrpclib.py", line 741, in dump_struct dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 660, in __dump f(self, value, write) File "c:\Python27\lib\xmlrpclib.py", line 762, in dump_instance self.dump_struct(value.__dict__, write) File "c:\Python27\lib\xmlrpclib.py", line 741, in dump_struct dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 660, in __dump f(self, value, write) File "c:\Python27\lib\xmlrpclib.py", line 762, in dump_instance self.dump_struct(value.__dict__, write) File "c:\Python27\lib\xmlrpclib.py", line 741, in dump_struct dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 660, in __dump f(self, value, write) File "c:\Python27\lib\xmlrpclib.py", line 719, in dump_array dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 660, in __dump f(self, value, write) File "c:\Python27\lib\xmlrpclib.py", line 762, in dump_instance self.dump_struct(value.__dict__, write) File "c:\Python27\lib\xmlrpclib.py", line 741, in dump_struct dump(v, write) File "c:\Python27\lib\xmlrpclib.py", line 652, in __dump raise TypeError, "cannot marshal %s objects" % type(value) TypeError: cannot marshal <type 'file'> objects Hope, someone has an idea!? Thanks in advance! Tim
  9. Hey, I am having trouble formulating an advanced query via the interface and API. I am sure this is something that a lot of others must have already solved so I am hopeful I can get some help here. I have a basic structure of a custom object named "Episode" with multiple tasks. Assuming an episode has 2 tasks, I want to retrieve all shots that have task 1 status = Complete, task 2 status = Not Ready. Currently I have two queries - one that retrieves task 1, one that retrieves task 2 and I intersect these two lists to get only the episodes that exist on both. It would be get this down to one query via the API, but I would also want to be able to use a similar query via the interface
  10. Hi folks, My company has just updated our installation of Ftrack, and I would like to take advantage of the new features for linking dependencies in my code, specifically the AssetVersionLink entity. Can you please provide a use case that can illustrate some of the properties of this entity? How does it differ from usesVersions()? Is it supposed to replace it, or are we supposed to use them in tandem? There is no documentation on this feature, so any information would be very helpful. Thanks, Kim
  11. jerome

    Query join

    Hi, Is it possible to send queries with the new API that will use joins on several objects. I would like to query an asset for a specific asset build, i.e. something like this: Asset where parent.id is ( select id from AssetBuild where project.id is <projectId> and name is "<myAssetBuildName>")Is this kind of request valid with the new API ?
  12. Hi, I've created an event listener to require comments when logging time on certain tasks, and thought I should share it with the community. It shows the usage of triggering and handling an actions UI based on an event. Please let me know if you have any comments or feedback. You can find the snippet on bitbucket. Event listener: Require timelog comments The event listener can be used to require comments when logging time against certain tasks from the ftrack interface. The event listener will trigger an Action UI to require timelog comments if the custom attribute require_comments is set on the timelog context. Configuration You can configure the following in the script: REQUIRE_COMMENTS_ATTRIBUTE The name of the custom attribute, that can be used to control if a task requires timelog comments. Running the event listener You can run the event listener from the command line:: python require_timelog_comments.py You can also register the event listener as a plugin. For more information, see the links below. Read more Find more information in our documentation: * Developing: Events * Event: Action - trigger interface * Event: Update * Tracking time * Python API: Configuring plugins * Python API: Environment variables
  13. Hi, What is the best relationship we can use to extract notes from a task in a query? for example: something like, note = session.get('Note where content is "xyz" and parent.name is "something"'.one()) P.S.: I don't want to use 'ID' for extracting particular note. Thanks in advance,
  14. Hello, New to ftrack and its nomenclature. Does any one have a good workflow for creating and testing new event plugins? I currently find my self having to create a new shot everytime i want to test new code in the plugin. I also noticed that i cant query an event, if i try : [e.get('id') for e in session.query('select id,data from Event')] the ids are int's and not the database object id that the event entity like other ftrack entities use. Any help or an arrow in the right direction would be great. Cheers Kym
  15. Hi, I've created an example event listener which can be used to restrict which users should be allowed to set certain statuses. I thought it would be useful for the rest of the community and wanted to share it here. Let me know if you have any questions or feedback. You can find the snippet on bitbucket. Event listener: Restrict task status updates The event listener can be used to limit which users are allowed to set certain statuses. When a status is changed in the ftrack interface, the event listener will check if the status is restricted, and if the user is member of the group with users that are allowed to set to those statuses. If not, the status will be reverted to the old value, and a message will inform the user that the operation was not permitted. Configuration To use the event listener, first set the two variables at the top: RESTRICTED_STATUSES A list of task status names that are restricted, only the members of a group will be allowed to change these. ALLOWED_GROUP_NAME The name of the group in ftrack which contains the users that are allowed to set the restricted statuses. Running the event listener You can run the event listener from the command line:: python restrict_task_status_listener.py You can also register the event listener as a plugin. For more information, see the links below. Read more Find more information in our documentation: * Developing: Events * Event: Action - trigger interface * Event: Update * Managing statuses * Organizing users into groups * Python API: Configuring plugins * Python API: Environment variables
  16. Hello Guys, i am just wondering if there is any possibility to override those context templates by the new api using hook located on a FTRACK_CONNECT_PLUGIN_PATH instead of rewriting your default context templates delivered in connect package. I just tried something like this but it doesn't work so far. Thank you ! import ftrack_api import ftrack_api.event.base def get_sample_context_template(event): '''Return context templates for Nuke Studio.''' # Define tag regular expressions. return [{ 'name': 'Sample Shot', 'description': ( 'Match name before and after dash. ' 'Example: ch01_dragon_0010 will be matched as sequence with name ' 'ch01 and a shot named ch01_dragon_0010.' ), 'expression': '' }] def register(session, **kw): '''Register plugin.''' # Validate that session is an instance of ftrack_api.Session. If not, # assume that register is being called from an incompatible API # and return without doing anything. if not isinstance(session, ftrack_api.Session): # Exit to avoid registering this plugin again. return session.event_hub.subscribe('topic=ftrack.connect.nuke-studio.get-context-templates',get_sample_context_template)
  17. In our Ftrack installation, we have defined a custom attribute at the project level--let's call it "locations". I would like to create a function that allows users to add an additional location to a project after querying that the provided argument is indeed an available option in the collection of locations. I can't find an example of this kind of query; I just need to know whether this is something attached to Session or somewhere else. So let's say locations = {'Uptown': 'uptown', 'Downtown': 'downtown', 'Midtown': 'midtown'} (in settings it's an Enumerator that seems to be represented as a dictionary) We created our own wrappers for some of several of the Ftrack queries, so I decided not to include that code. The part in bold is what I'm getting at... is this the way to access it? I thought this might be the way because the documentation says: "The custom attributes available on entities are cached on the Session." It isn't working when I run unit tests.
  18. Hi all, we get this info log almost every time when we run a script via the API: requests.packages.urllib3.connectionpool> INFO | Resetting dropped connection: ftrackserver Do we have to worry about it? Do we have to change something? Cheers, Remus
  19. Over the past couple of weeks I've been trying to learn how to dev for ftrack. I'm making progress, but the process has been very painful. I have the basics working- connect is running and I'm able to publish using the Maya plugin, but I'd really like to customize the experience more. Here are some areas that have been a struggle for me: - The usage examples/tutorials in the docs are missing a lot of context for a beginner like myself. I have a hard time wrapping my head around a lot of the concepts because the examples either stop short or under-explain key concepts. - I'm uncertain what order I need to do things. Do I follow the API tutorials first and set up locations, get components working, and publishing through that system? Or do I set up connect and get custom hooks/actions working? Without a step by step tutorial to lay out the basic process, I find myself skipping all over the place and trying to do everything all at once which is a bit overwhelming. - An example of this jumping around: As I mentioned before I have ftrack connect working, but I think my files are only being published to the cloud (I'm not sure where the default project dir would be). So I jumped back to the API tutorials to see what they said about creating local files. Now I'm jumping back to the connect docs to see what they say about location integration. I feel like the whole dev process could be outlined and condensed into an hour-long video tutorial (2-3 mins for each step). Also, some visuals describing the dev process (like a road map), a quick video series outlining the basic process and performing common tasks, and a few more in-depth examples (maybe a downloadable example of a modified ftrack package) would help a lot of future devs. Everything else about ftrack is great and I'm excited about all the potential it has, I just wish it was a bit more accessible. -Mike
  20. Mike

    API Tutorial Errors

    A few errors/typos I've found while doing the tutorial and the fixes I made to get it working. I list the section, then the error, then the fix 1. Creating>Tasks Error: Change to: project.createTask('a task', taskType, taskStatus) shot.createTask('a shot task', taskType, taskStatus) 2. Using Lists Error: Change to: dailies.append(version)
  21. Hi everyone! I've been writing up a blog post about the paging and sorting of queries in our new Python API: https://www.ftrack.com/2016/02/api-introducing-paging-and-sorting.html Good documentation is still lacking but if you've any questions feel to ask them here!
  22. jerome

    Query operator

    Hi, Is there a simple way to query for the last version of an asset with the new API ? And more generally is there a plan to add new selection operator like: max, avg, sum or count ? Cheers, Jerome
  23. I want to get list of task that was changed in status or published during some period of time. There should be a function with input - start_date,end_date and output - List of Tasks
  24. Hi Is there any posibilities to get get Linked Asset Builds from shot? Acording to Api reference - there no such atributes of classftrack.Shot.
  25. Hello, I'm testing the use of ftrackplugins in visual studio 2010. Since this is my first time using python in VS, I was wondering if you have any idea how I can enable VS to recognize the ftrack API I've extracted the ftrackplugins-win64-1b17 archive into all three paths: C:\Python27\Lib\site-packages\ftrackplugins-win64-1b17\ C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\ftrackplugins-win64-1b17\ C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\ftrackplugins-win64-1b17\ and "ftrackplugins" shows up under all 3 environments in visual studio Solution Explorer (see attached image) I tried running the follwing script (our private information is replaced by # for security purposes) ---------- import os; import sys; ftLibPath = '#####/ftrackplugins-win64-1b17/ftrackplugins/libdir' ftApiKey = '##### ftLogName = '#####' if not ftLibPath in sys.path: sys.path.append(ftLibPath); print '>> Added to sys.path : '+ftLibPath; os.environ['FTRACK_SERVER'] = ftServer os.environ['FTRACK_APIKEY'] = ftApiKey os.environ['LOGNAME'] = ftLogName import ftrack; projects ftrack.getProjects(True) for proj in projects: print proj --------------- I get a printed output of all projects but the problem is "ftrack" is not recognized by the compiler while editing. If I open the interactive window and execute the script (line-by-line) "ftrack" is fully operational with intellisense enabled. Any idea how I can fix this? Kind regards, Wim Wouters