-
Notifications
You must be signed in to change notification settings - Fork 127
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
General: Attribute definitions fixes #4392
Merged
Merged
+279
−150
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kalisp
approved these changes
Feb 1, 2023
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.
Tested in Publisher, Nuke, AE, didn't notice irregularities from before.
(But I didn't have mentioned issues that this should fix.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief description
Fix possible issues with attribute definitions in publisher if there is unknown attribute on an instance.
Description
Source of the issue is that attribute definitions from creator plugin could be "expanded" during
CreatedInstance
initialization. Which would affect all other instances using the same list of attributes -> literally object of list. If the same list object is used in "BaseClass" for other creators it would affect all instances (because of 1 instance). There had to be implemented other changes to fix the issue and keep behavior the same.Object of
CreatedInstance
can be created without reference to creator object.CreatedInstance
is responsible to give UI attribute definitions (technically is prepared for cases when each instance may have different attribute definitions -> not yet).Attribute definition has added more conditions for
__eq__
method and have implemented__ne__
method (which is required for Py 2 compatibility). RenamedAbtractAttrDef
toAbstractAttrDef
(fix typo).Developer explanation of bug
Imagine there are 2 instances in the scene created by same creator. One would have in attribute "key1" in creator attributes, second would have attribute "key2" in creator attributes but creator would return empty list for attribute definitions one. After collection both instances would have both attributes shown in UI and saved to scene because both added
UnknownDef
to creator's attribute definitions.In case the creator would inherit from class which return the list of attributes from attribute and there were more creators like that then all "unknown" attributes would get to all instances collected by those creators (fun with python pointers).
Additional information
Currently multiselection of instances may cause that attributes are not loaded as fast (that because of very inefficient way how to find "common attributes" for all instances. That could be solved by implementing "create hash" method for attribute definitions. The result would be string which would contain all information which makes the attribute unique by combination of all definitions properties (could be huge for enums). We could look into that if we'll find out it's an issue.
Testing notes:
Hosts where is used New Publisher should work as before (or better).
Publish
category should be shown correctly and they should work on multiselectionMore complex testing:
Follow steps in this issue #4379
Resolves #4379