by anemoff » Fri Feb 12, 2021 6:39 pm
Hi Jeremy,
- set_read_only and set_user_locked are very similar in that they have the same result in spite of being 2 separate states. User-locked is intended to be used by the user via the UI with the Shelf buttons Lock and Unlock, whereas read-only doesn't have UI actions (so it's mostly updated via script/code for internal logic to control items state).
- set_remote: it's used to flag the item as "remote" object to tell that it comes from an external source. Remote items have some limitations: for example, they can't be deleted or renamed but you can edit their attributes. It is mostly used internally. For example, all the items inside a Reference Context are automatically flagged as remote by the Reference engine.
- set_read_only and set_user_locked and set_remote are not recursive, so yes you need to do the recursion your self (using OfContext.get_objects and OfContext.get_contexts).
- set_read_only and set_user_locked will forbid edit actions in direct children, but not on grandchildren, so you will need to lock/unlock recursively yourself to forbid edits at all levels.
- finally, set_name_dirty is not meant for public usage. It's used by the internal name cache to notify when the name has changed. Shouldn't be public I think.
Cheers,
Anthony Nemoff
Isotropix
R&D Engineer