Skip to content

'name' and 'type' is missing when returning linked entities with custom fields #293

@manuelito02

Description

@manuelito02

Hi there!

There is a way to get additional fields of linked entities (not only 'id', 'name'/'code' and 'type') with the syntax

my_field.entity_type.entity_field

This is great to reduce the amount of queries to SG.

However, there seems to be a problem with the 'name' and 'type' field of that linked entity. Please check following code:

app.sgtk.shotgun.find(
  "Shot",
  [["id", "is", 39190]],
  ["sg_sequence"],
)

This returns:

# Results:
#  [{'type': 'Shot', 'id': 39190, 'sg_sequence': {'id': 17062, 'name': 'ANS_105_042', 'type': 'Sequence'}}]
app.sgtk.shotgun.find(
  "Shot",
  [["id", "is", 39190]],
  [
    "sg_sequence.Sequence.id",
    "sg_sequence.Sequence.name",
    "sg_sequence.Sequence.type",
    "sg_sequence.Sequence.task_template",
  ],
)```

Here, I'm specifically asking for the 'id', 'name', 'type' and 'task_template' fields, but I get back following:

Results:

[{'type': 'Shot', 'id': 39190, 'sg_sequence.Sequence.id': 17062, 'sg_sequence.Sequence.task_template': None}]```

I have my sequence 'id' and 'task_template', but not the 'name' and the 'type'.

Is this a bug or am I doing something wrong?

Greets,
Carlo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions