-
Notifications
You must be signed in to change notification settings - Fork 18
Load: Added actions to lock and unlock container versions #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nitpick - we could add type hints here 👻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean to add dict[str, Any]? Can we just approve it please if it works. Or add suggestions please. Because the typehints for the whole inventory actions are honestly unmanagable, and I have no intention in changing it at this moment.
|
Receive this when performing unlock version: |
@BigRoy I need help with this. |
In the imprint function ayon-maya/client/ayon_maya/api/lib.py Lines 672 to 721 in 1b02f1f
we need to make some adjustment (line 719-721) for checking if the attribute already exists. {the code...}
if not cmds.attributeQuery(key, node=node, exists=True):
cmds.addAttr(node, longName=key, **add_type)
cmds.setAttr(node + "." + key, value, **set_type)Once it was added, the action can be performed. |
Yup, that's roughly the issue - but I'm not entirely confident whether we should allow this long-standing function to allow "ignoring" existing attributes... I think we may for now be better of doing what the Creator plug-in also does, and that is explicitly removing the attribute if it does happen to pre-exist: https://github.com/ynput/ayon-maya/blob/394a83cae1efcb99580d3b27454f39cb0a9316d8/client/ayon_maya/api/plugin.py#L237-L242 This at least ensures that the created attribute is of the correct type. Not saying it's the nicest way to do this either. But I'm afraid we're somehow mixing the functionality here. Having said that - at the same time the amount of calls directly to |
BigRoy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (didn't test)
Changelog Description
Implement inventory actions to be able to lock/unlock version of a container.
Additional review information
The PR is related to ynput/ayon-core#1447 which adds the option to lock and unload version of a container.
Added 2 actions to lock and unlock the version by settings
"version_locked"on the object.Testing notes:
Actions > Lock versionon the container.