kubric
kubric copied to clipboard
FileBasedObject: trigger error when changing filenames or asset-id after the fact
In regards to this TODO: https://github.com/google-research/kubric/blob/e5e4e495847425989ef4a1c44fa1eb354a4114a8/kubric/core/objects.py#L149
@Qwlouse would the mechanism that I have used in Asset.__init__
be suitable for what you wanted?
See how I declared the name
property read_only:
https://github.com/google-research/kubric/blob/e5e4e495847425989ef4a1c44fa1eb354a4114a8/kubric/core/base.py#L46
But allow its initialization in the constructor via a set_trait
:
https://github.com/google-research/kubric/blob/94aa6f6c5e5519529e37f90dd732cbfb6b5f3d4b/kubric/core/base.py#L59