Eder Agreda

Members
  • Content count

    18
  • Joined

  • Last visited

About Eder Agreda

  • Rank
    Member

Profile Information

  • Gender
    Male
  1. need some hep with a event listener

    Hello. I am trying to create an event Listener that basically prevents people from moving assets inside ftrack. I found an example and tried to do it my self, but Iam getting some issues. the script is suscribed to 'topic=ftrack.update', and will always revert changes,but it seems the "revert function" also activates the listener, so it enters in an infinite loop. these are the functions used in my script. Any help would be very appreciated: def MoveAssetsBlock(session, event): reverted= False for entity in event['data'].get('entities', []): if (entity.get("entityType") == "task" and entity["action"] == "move"): entity_id = entity['entityId'] fObject = session.query("Context where id is '{0}' ".format(entity_id))[0] fObject['parent_id'] = entity["changes"]["parent_id"]["old"] reverted=True if reverted: try: session.commit() except Exception: session.rollback() raise def register(session, **kw): if not isinstance(session, ftrack_api.Session): return handle_event = functools.partial( MoveAssetsBlock, session) session.event_hub.subscribe('topic=ftrack.update', handle_event)
  2. uploading an image and setting components

    Yes. It works know. Thank you!
  3. uploading an image and setting components

    Hello . I am working in a script that will let me upload images to ftrack.server location .Then I set its thumbnail.For this I do this: modelcomponent = # file uploaded to ftrack version = model_component['version'] version['thumbnail_id'] = model_component['id'] fo.session.commit() It works finel.Image goes to ftrack and its thumbnail appears with no issues. But I realized there is no FtrackReviewcomponent. I found and example and add this to my script: model_component['metadata']['ftr_meta'] = json.dumps({ 'format': 'image'}) model_component['name'] = 'ftrackreview-image' With this I get the FtrackReview component, but I lose the file component.I can´t see the url to the image anymore.
  4. Hello. I want to know whether or not it is possible to create a ennumerator custom attribute and be able to edit it . The situation : I want to create a custom attribute called 'Character List' which will be a enumerator type. by default it won´t have any value, and anytime a shot is uploaded to ftrack , it would set the "Character List" custom attribute, with values we would provide. So far I found out about "CustomAttributeConfiguration" and saw there is config key which shows configuration for the custom attribute. But I don´t know if I could edit and actually wouldn´t know how to do it either. Thank you very much. Greetings
  5. how to edit custom atributtes

    Yes, I have fo.session for not needing to write user, url and apikey everytime I need to test something. About the tasks, they are both in the same project, they were created the same day, the same way and they also shared the same parent. The only difference I could recall besides taskType is that shading("the one that works") has no bidding value while "model"(that one that doesn´t work does ). Greetings
  6. how to edit custom atributtes

    Hello. well I got an error again with another task.Its kind of wierd: I have a shot with 2 taks: model and shading.If I try to change custom attribute in shading It does it without issues but If I try in the model task I got an AssettionError: the Code I´m trying is: #task =session.query("Task where name is 'shading' and parent.name is 'condoChair' and parent.parent.name is 'props'").first() #this one works #task =session.query("Task where name is 'model' and parent.name is 'condoChair' and parent.parent.name is 'props'").first() # this one generates error task['custom_attributes']['lastVersion'] = 1 fo.session.commit() print "version modified to: {0} ".format(1) Greetings!
  7. how to edit custom atributtes

    Hello.Aparently It was an error with that entity.I tried in another one and It works fine. Thanks for the answer. Greetings!
  8. how to edit custom atributtes

    Hello. I got an issue I hope you could help me with. I have a task with 2 custom atributtes and I want to change one of these via a python script. According to documentation I have 2 options: task['custom_attributes']['my_text_field'] = 'foo' task['custom_attributes'] = { 'my_text_field': 'bar'} If I use the first one, it doesn´t update the info and if I use the second one, it works but generates a warning for the other custom atributte I am not setting To be precise: my task got 2 custom atributtes: lastVersion and retakes.I want to update lastVersion so I do this: task['custom_attributes']['lastVersion'] == value And it doesn't do anything. So I tried the second option: task['custom_attributes'] = { 'lastVersion': value} This one works but I got an annoying warning: WARNING:ftrack_api.collection.CustomAttributeCollectionProxy:Cannot delete u'retakes' on <dynamic ftrack Task object 192507688>, no custom attribute value set.
  9. can´t find my Assets

    I already fixed it. It was related to parenting. If I upload an asset via scripting or if I do it via ftrack-connect ;parenting is slightly differente, but that was all Thanks
  10. can´t find my Assets

    Hello, I found something weird and I would like some opinions: I have created many assets directly in my ftrack project web page, but also created some from Python Script. The issue is that if I query all assets from my Project using for example: assets = session.query("Asset where parent.name is '{0}'".format(parent["name"])) for asset in assets: print asset["name"] I get all the Assets but the ones created from Python Script. I know they exist. I can even see them in the web page since there are components. If I search for them using their names, I can actually find them: assets = session.query("Asset where name is 'test' and parent.name is '{0}'".format(parent["name"])) for asset in assets: print asset["name"] I am missing something?? Is there a way to query all Assets regardless of the method that I used to create them?? Greetings
  11. Actions using ftrack_api

    here it is: # :coding: utf-8 import logging import uuid import ftrack_api class checkShots(object): """Custom action""" label = "Check Shot(s)" identifier = 'com.ftrack.{0}'.format(str(uuid.uuid1())) description = "Let you populate shots" def __init__(self, self.session): '''Initialise action handler.''' self.logger = logging.getLogger( __name__ + '.' + self.__class__.__name__ ) self.session = session def register(self): '''Register action.''' self.session.event_hub.subscribe( 'topic=ftrack.action.discover', self.discover ) self.session.event_hub.subscribe( 'topic=ftrack.action.launch and data.actionIdentifier={0}'.format( self.identifier ), self.launch ) def discover(self, event): '''Return action config.''' selection = event['data']['selection'] # Need something to convert. if not selection: return def launch(self, event): selection = event['data']['selection'] if selection: return { "success": True, "message": "Looking good!" } def main(): logging.basicConfig(level=logging.INFO) session = ftrack_api.session() action = checkShots(session) action.register() session.event_hub.wait() if __name__ == "__main__": main() thanks!
  12. Actions using ftrack_api

    Hello,so far I used legacy api to create some actions.Then using "FTRACK_EVENT_PLUGIN_PATH" I made them visible for all my team; but lately I've been reading about the new api and tried to create an action using it.I found a sort of example but I am having some trouble to make it work. Please look at this and tell me what is wrong or what is missing:
  13. How to keep both apis running at the same time

    thanks!! It helped a lot
  14. Hello. as you suggested, I am trying the new api.I read that its possible to keep both apis running at the same time and I tried a little exercise: I queried a sequence using both apis and I got this result: the first line its the result using the old api and the last one ,using the last one. Then,I tried to create a folder: if in "session.create" in "parent " I use "sequence01" it works fine but If I use "sequence" I got an error ,so I would appreciate If anyone could tell me what do I need to make it work. Greetings and sorry If I am asking too many questions.
  15. Problem creating Asset Builds

    Thank you! I´ll start reading abut it