0

SimpleShotgunModel does not find Tasks

Hello Support,

i am just wondering why at least the SimpleShotgunModel does not find any Tasks using the load_data method.
It works pretty well with Asset, Sequence and Shot but not with Taks with or without any filters.

Am i missing something?

Cheers,
René

4 comments

  • 0
    Avatar
    Manne Öhrström

    Hello!

    That's unexpected! Can you send the code snippet you use to instantiate and load up the SimpleShotgunModel?

    Thanks!
    Manne

  • 0
    Avatar
    René Calles

    Hey Manne,

    i don't have the exact code but it's straight forward:

    shotgun_model = tank.platform.import_framework("tk-framework-shotgunutils", "shotgun_model")
    my_task_list = Qt.QListView(parent)
    tasks_model = shotgun_model.SimpleShotgunModel(my_task_list)
    my_task_list.setModel(tasks_model)
    tasks_model.load_data(entity_type="Task")

     

    I have seen that you use a "standard" sg_api_object.find(......) in tk-multi-workfiles to retrieve the tasks but thought this might be that there was no shotgunutils framework built already.

    Thanks,
    René

     

     

  • 0
    Avatar
    Manne Öhrström

    Thanks!

    I think this is because the SimpleShotgunModel defaults to pulling down the code field, which is the "name" field for most entity types: Shots, Assets, Sequences etc. However, Tasks are different and their "name" field is called content.

    Try this instead and see if that works better:

    tasks_model.load_data(entity_type="Task", fields=["content"])

    Hopefully that should start giving you some data back!

  • 0
    Avatar
    René Calles

    Thanks Manne,

    that was absolutely it. 

Please sign in to leave a comment.