Shotgun Find filters syntax

   3513   4   0
User Avatar
Member
65 posts
Joined: 2月 2013
Offline
Hi guys,

I'm trying to get all the shots (possibly Tasks, and then the shot field from them), using custom filter in the Shotgun Find node. The problem is I can't make it works correctly. There's some attempt:
#1 filters = [['project', 'is', {'type': 'Project', 'id': 327}]]
#2 filters = [['project', 'is', {'type': 'Project', 'id': 327}], ['entity.Shot.code', 'is', p.shotKnob.value()]]
#3 [['project', 'is', {'type': 'Project', 'id': 327}], ['entity.Shot.code', 'is', p.shotKnob.value()]]
#4 filter = [['project', 'is', {'type': 'Project', 'id': 327}], ['entity.Shot.code', 'is', p.shotKnob.value()]]
#5 filter = [['project', 'is', {'type': 'Project', 'id': 327}]]
I'm not sure what I'm supposed to enter in the custom code.

Thanks in advance for your help!
Marco
Edited by merlino3d - 2019年11月14日 14:03:57
User Avatar
スタッフ
529 posts
Joined: 8月 2019
Offline
Hi Marco,

If you want to get every result, you can set the Filter Type to “Custom”, and then remove all text in the Shotgun filter. This is essentially the same as passing an empty list.

You don't need the variable assignment as this is done for you.
Edited by johnmather - 2019年11月14日 13:57:28
User Avatar
Member
65 posts
Joined: 2月 2013
Offline
Hi John, and thanks for your reply.

The only real filter should be the project id in my case, but using this code doesn't works:
['project', 'is', {'type': 'Project', 'id': 327}]
Edited by merlino3d - 2019年11月14日 14:10:17
User Avatar
スタッフ
529 posts
Joined: 8月 2019
Offline
The Shotgun API expects a list of lists. The following should work:

[['project', 'is', {'type': 'Project', 'id': 327}]]
User Avatar
Member
65 posts
Joined: 2月 2013
Offline
Ooooooo great! It works!

Thanks a lot John!
  • Quick Links