Hey everybody,
while setting up a dynamic-enumerator-action, we noticed, that the information on the currently selected element doesn't help to retrieve an actual object. We always get 'None' as a result.
This is the event, that comes in:
{
"topic": "ftrack.dynamic-enumerator",
"source": {
"id": "c73c09beff154613ba61300782bb836e",
"user": {
"username": "TEdelmann",
"id": "75b59aae-e1bb-11e7-ad88-7ab7a47c9dda"
}
},
"target": "",
"data": {
"attributeName": "Briefing_Workflows_00_Maya_Config",
"sorters": [],
"filters": [
{
"disabled": "True",
"property": "name",
"root": "data",
"initialConfig": {
"disabled": "True",
"property": "name",
"root": "data",
"id": "ft-dynamicenumerator-2000671-query-filter"
},
"id": "ft-dynamicenumerator-2000671-query-filter"
}
],
"query": "",
"groupers": [],
"recordData": {
"changes": {},
"entity": {
"entityId": "883b74ea-132b-11e8-ae79-7ab7a47c9dda_15",
"entityType": "task"
}
}
},
"in_reply_to_event": "None",
"id": "27304c3ea333491fa793b457e91f7966",
"sent": "None"
}
As you can see, there is given an entity in 'recordData'. But for some reason, we can't query or get the actual object from it. This is what we tried so far..
obj_type = event['data']['recordData']['entity']['entityType']
obj_id = event['data']['recordData']['entity']['entityId']
# obj_id = event['source']['id']
# selected_object = self.session.get('TypedContext', obj_id)
# selected_object = self.session.query('Task where id is "{0}"'.format(obj_id)).first()
selected_object = self.session.query('{0} where id is "{1}"'.format(obj_type, obj_id)).first()
selected_object is always None.
any suggestions? How are we supposed to get the current selection, when reacting on 'topic=ftrack.dynamic-enumerator'?
Alternatively, it would be very helpful, if the information on what is currently selected, coulde be retrieved in a general way (i.e. like session.getCurrentSelection())
thanks a lot in advance
Tim