-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Add read-only mode to AnimationTreeEditor plugins #63249
Add read-only mode to AnimationTreeEditor plugins #63249
Conversation
cea81a9
to
bec7eca
Compare
Looks good to me save for minor nitpick, I think @TokageItLab should review too. |
I have confirmed that the change to BlendSpace is prevented. But I concerned about the behavior of the BlendSpace point being canceled after it is grabbed. It would be better if it could be prevented from grabbing the point. I am more concerned that #63245 is not working very well. I think that instead of preventing overwrites, #63245 should also cancel the user's operation, just like this PR. |
bec7eca
to
25bd697
Compare
Okay, @reduz, this has now been updated to address the issues @TokageItLab pointed out; the dragging of points in the blend spaces is no longer allowed, amongst other tweaks such as disabling a few buttons which I missed. I apologize that the read-only modes for blend spaces was so sloppy, I think that part of the code was a bit rushed on my behalf. I also went and replaced some of the duplicate code required for detecting if a resource is read_only with the new 'is_resource_read_only' function introduced in #63282 Aside from that, I've actually gone and ostensibly finished this PR by going ahead and adding read-only mode to the blend trees too, which did requires some minor tweaks the GraphEdit and GraphNode APIs, such as including a new 'draggable' and 'selectable' property for GraphNodes, and an option to hide the Arrange Nodes button in GraphEdit. I also introduced a new behaviour to GraphNode slots which does have accompanying documentation explaining it. The rule introduced is that slot types with negative numbers will not allow the user to create connections via the GraphEdit, which taking advantage of now allows the GraphEdit node in the BlendTreeEditor to be exist in a fully read-only state. My gut instincts tells me this feels more reasonable than shoe-horning a whole other variable for controlling this. It also fixes a bug in the EditorSpinSplider which allowed the slider to still be moved in read-only mode. |
25bd697
to
435bf73
Compare
Looks good except that the StateMachine's Node name is still editable. |
435bf73
to
75f1357
Compare
Thanks @TokageItLab, I missed that 👀 |
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.
Seems good.
Thanks! |
Adds a read-only mode to the AnimationTreeEditor plugin when operating on resources embedded in foreign scenes. Currently only covers state machines, blend 1D, and blend 2D editors. Blend trees do not currently support a read-only mode due to their reliance on the built-in GraphEdit control which does not yet have the required read-only state needed to prevent edits.
Complementary PR to #63245