Skip to content
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

Edit vector/rect properties in a "linked" manner when holding down Ctrl #41555

Closed

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Aug 27, 2020

Don't merge yet. This PR needs to be modified so it doesn't link coordinates when dragging properties to change their values while holding down Ctrl.


For Rect2, Rect2i and AABB, this only applies to the size, not the position.

This closes godotengine/godot-proposals#144.

Note: When cherry-picking to the 3.2 branch, remove the parts that modify the integer vector types as these aren't present in 3.2.x.

For Rect2, Rect2i and AABB, this only applies to the size,
not the position.

This closes godotengine/godot-proposals#144.
@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:editor usability labels Aug 27, 2020
@Calinou Calinou added this to the 4.0 milestone Aug 27, 2020
@Calinou Calinou marked this pull request as draft August 27, 2020 01:39
v3.z = spin[2]->get_value();
if (Input::get_singleton()->is_key_pressed(KEY_CONTROL)) {
// Set all components to the edited value to quickly set "linked" values such as scale.
if (p_name == "x") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_value_changed has a val parameter. Use that instead of whatever this is.

@nathanfranke
Copy link
Contributor

I think that a link button would make more sense. I did a bit of work in my fork

Copy link
Contributor

@nathanfranke nathanfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the lines to change and suggestions (Thanks @aaronfranke)

Comment on lines +1338 to +1352
if (p_name == "x") {
v3.x = spin[0]->get_value();
v3.y = spin[0]->get_value();
v3.z = spin[0]->get_value();
} else if (p_name == "y") {
v3.x = spin[1]->get_value();
v3.y = spin[1]->get_value();
v3.z = spin[1]->get_value();
} else if (p_name == "z") {
v3.x = spin[2]->get_value();
v3.y = spin[2]->get_value();
v3.z = spin[2]->get_value();
} else {
ERR_PRINT("Unexpected component name (please report).");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (p_name == "x") {
v3.x = spin[0]->get_value();
v3.y = spin[0]->get_value();
v3.z = spin[0]->get_value();
} else if (p_name == "y") {
v3.x = spin[1]->get_value();
v3.y = spin[1]->get_value();
v3.z = spin[1]->get_value();
} else if (p_name == "z") {
v3.x = spin[2]->get_value();
v3.y = spin[2]->get_value();
v3.z = spin[2]->get_value();
} else {
ERR_PRINT("Unexpected component name (please report).");
}
v3 = Vector3(val, val, val);

Comment on lines +1651 to +1665
if (p_name == "x") {
v3.x = spin[0]->get_value();
v3.y = spin[0]->get_value();
v3.z = spin[0]->get_value();
} else if (p_name == "y") {
v3.x = spin[1]->get_value();
v3.y = spin[1]->get_value();
v3.z = spin[1]->get_value();
} else if (p_name == "z") {
v3.x = spin[2]->get_value();
v3.y = spin[2]->get_value();
v3.z = spin[2]->get_value();
} else {
ERR_PRINT("Unexpected component name (please report).");
}
Copy link
Contributor

@nathanfranke nathanfranke Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with above

Suggested change
if (p_name == "x") {
v3.x = spin[0]->get_value();
v3.y = spin[0]->get_value();
v3.z = spin[0]->get_value();
} else if (p_name == "y") {
v3.x = spin[1]->get_value();
v3.y = spin[1]->get_value();
v3.z = spin[1]->get_value();
} else if (p_name == "z") {
v3.x = spin[2]->get_value();
v3.y = spin[2]->get_value();
v3.z = spin[2]->get_value();
} else {
ERR_PRINT("Unexpected component name (please report).");
}
v3 = Vector3(val, val, val);

@aaronfranke
Copy link
Member

@Calinou What's the status of this PR? Do you plan to continue working on this? There are requested changes above that need to be addressed.

@akien-mga
Copy link
Member

Superseded by #59125.

@akien-mga akien-mga closed this Jun 14, 2022
@akien-mga akien-mga added archived and removed cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a link/unlink option for subproperties like "scale"
4 participants