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

Shrink operator if possible (when changing data type) #6668

Merged
merged 5 commits into from
Jan 14, 2022

Conversation

julienamsellem
Copy link
Contributor

@julienamsellem julienamsellem commented Dec 23, 2021

Purpose of this PR

https://fogbugz.unity3d.com/f/cases/1364445/

Repro steps:

  • Create a multiply operator
  • Click on the gear icon ⚙ and change the type for input 'A' to a 'Vector4'
  • Change it back to 'Float'
  • Observe the operator remains large

👍 Expected result: the operator shrinks back to the min size required to display a Float value
👎 Actual result: the operator keeps a much larger size than needed

With this fix, the operator will shrink back to the minimum width only when the "edit ⚙" mode is ended.

[Before]
ei6p7BhpBx

[After]
ZgjIugnaVC


Testing status

  • Switch from float => vector3 => float
  • Checked collapse and super-collapse interaction

Comments to reviewers

Seems to happen for all operators (add, branch, noise, etc.)
Note that collapsing the operator and then expanding it was already resizing the operator to its minimum size and also it ends the "edit ⚙" mode.

This is somehow a regression introduced by the fix I did to keep the operator width constant, even when it's collapsed.
But I think the behavior is even better now because the operator does not change size every time you change the type of an input (while in edit mode) only when you leave the edit mode.

@github-actions
Copy link

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

VFX
/jobDefinition/.yamato%252Fall-vfx.yml%2523PR_VFX_trunk

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

@VitaVFX VitaVFX requested review from VitaVFX and removed request for a team December 27, 2021 08:33
@VitaVFX
Copy link

VitaVFX commented Dec 27, 2021

Checked different types of operators like Switch, Probability sampling. in graphs, subgraphs blocks and subgraph operators

  1. When switching to ‘larger operators’ ( bool → Vec2 → Vec4 let’s say) size changes immediately. If I switch from larger to smaller operator (Vec4 → float) it doesn’t happen immediately, I have to click gear icon to make it update to the smaller operator.

PTei2WZrKD

  1. Connecting operator to another operator when operators’ type does no match. There seem to be an issue with this behavior.
 Example:
       1. Create Arc Cosine and float operators
       2. Change Arc Cosine to vector4 type and connect float to it
       3. Observe that Arc Cosine type switches from vector to float but operator remains large with xyzw inputs

pPkUyh2xRD

  1. ✔️ Collapsing/expanding and changing the type of operator

Copy link

@VitaVFX VitaVFX left a comment

Choose a reason for hiding this comment

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

Did a quick verification and confidence check. Couldn't find any outstanding issues. Thank you for taking care of this!

@julienamsellem julienamsellem marked this pull request as ready for review January 4, 2022 13:59
Copy link
Contributor

@PaulDemeulenaere PaulDemeulenaere left a comment

Choose a reason for hiding this comment

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

LGTM! It's pretty minor, thanks for the fix.

@julienamsellem julienamsellem merged commit 0ac6a5e into master Jan 14, 2022
@julienamsellem julienamsellem deleted the vfx/fix/1364445-shrink-operator-if-possible branch January 14, 2022 16:30
julienf-unity pushed a commit that referenced this pull request Feb 3, 2022
* Shrink operator if possible (when changing data type)

* Updated changelog

* Reset minwidth when the operator is expanded (so that it can shrink if possible)
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.

4 participants