-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 vector value linking #59125
Add vector value linking #59125
Conversation
This looks great! However, I think the link button should be moved to the right side as it'd make more sense there than on the left. Also, are you considering doing this for Vector3 as well? The same argument about scale usually being the same on all axes can be applied to 3D too. |
Not in this PR. I didn't want it too big and we still need to agree on the design of this feature. |
This is actually possible already, see |
As discussed on a the PR meeting, the PR is very good but would need small changes:
As a side note (that was not discussed in the PR meeting), do you think you could make the same changes for Vector3/Vector3i too? |
This is for dependent properties, it doesn't allow for conditional linking (like with the link button).
Yes, I was already planning to do it, just waited for the feature approval before putting more work. |
cd9fde7
to
6fb3c39
Compare
6fb3c39
to
ebf4250
Compare
ebf4250
to
8b99365
Compare
8b99365
to
66acf48
Compare
Ok added new icon contributed by @redlamp: |
2d336c4
to
4799ee4
Compare
if (spin[0]->get_value() != 0 && spin[1]->get_value() != 0) { | ||
ratio_yx = spin[1]->get_value() / spin[0]->get_value(); | ||
ratio_zx = spin[2]->get_value() / spin[0]->get_value(); | ||
ratio_xy = spin[0]->get_value() / spin[1]->get_value(); | ||
ratio_zy = spin[2]->get_value() / spin[1]->get_value(); | ||
ratio_xz = spin[0]->get_value() / spin[2]->get_value(); | ||
ratio_yz = spin[1]->get_value() / spin[2]->get_value(); | ||
} else { | ||
ratio_yx = 1.0; | ||
ratio_zx = 1.0; | ||
ratio_xy = 1.0; | ||
ratio_zy = 1.0; | ||
ratio_xz = 1.0; | ||
ratio_yz = 1.0; | ||
} |
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.
ratio_yx
is the same as 1.0 / ratio_xy
.
Maybe you could reduce the amount of member variables and computation needed by keeping only 3 and using *
or /
operations as appropriate?
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.
I could, I even tried it at first, but IIRC there were some precision issues.
If you do add this in the future, perhaps it could be used to link the corner radius and border width properties of StyleBoxFlat. I find that I usually use the same values for all 4 sides/corners and having the link button there would make it easier to edit them all at once. |
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.
Should be good to merge once rebased.
Co-authored-by: redlamp <244062+redlamp@users.noreply.github.com>
4799ee4
to
5553e27
Compare
Thanks! |
Maybe these should be a single property with type |
Vector4 wouldn't allow to explicitly indicate what each bit indicates, whether it's a side or a corner, without some inspector hackery. So I'm not sure. I was thinking about making a custom inspector widget here anyway, but so far only prototyped some stupid ideas and not much. But I think it would be the way to do it. |
Cherry-picked for 3.6. |
Closes godotengine/godot-proposals#144
Linked values change proportionally (unless any of them is 0). The link button only appears if property has
PROPERTY_HINT_LINK
(for now only Node2D/3D/Controlscale
).The linked/unlinked icon is a placeholder, I did my best :/ I'll optimize them when they are replaced.
On a side note, I'm thinking about adding possibility to link 2 properties. This would be mostly useful for min/max values in ParticlesMaterial. So I wonder if the new property hint could be reused for that in the future.