Skip to content

ReferenceError: weakly-referenced object no longer exists #12

@rsgalloway

Description

@rsgalloway

Wrapping a cask object from a PyAlembic IObject without creating a cask.Archive first can cause reference errors, e.g.

>>> iarch = alembic.Abc.IArchive(filepath)
>>> iobj = iarch.getTop().children[0]
>>> obj = cask.Xform(iobj)
>>> obj.is_animated()
...
    return self.parent.time_sampling_id
ReferenceError: weakly-referenced object no longer exists

This is because cask walks to the top to get the time smapling information, and the iarchive doesn't exist, or is weakly referenced.

A temporary fix is to pass in the time sampling id when instantiation the object, e.g.

>>> obj = cask.Xform(iobj, time_sampling_id=2)

A better fix might be to instantiate the archive on demand, or create a strong reference to the archive, if possible. I'm labeling this as an enhancement because this is an unexpected workflow in cask, but it'd be good to support.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions