Fix for Edit PolyShape tool reverting previously merged polyshapes - #583
Merged
Merged
Conversation
lopezt-unity
requested changes
Feb 3, 2025
Comment on lines
+66
to
+69
| // Remove PolyShape component if one is present post-merge | ||
| var polyShapeComp = mesh.gameObject.GetComponent<PolyShape>(); | ||
| if (polyShapeComp != null ) | ||
| UndoUtility.DestroyImmediate(polyShapeComp); |
Collaborator
There was a problem hiding this comment.
I think we should also remove ProBuilderShape Components when merging 2 PB objects (2 PBShapes or one PBShape + PolyShape) because it does not make sense either to have access to the shape parameters anymore in that case, right ?
Contributor
Author
There was a problem hiding this comment.
@lopezt-unity Good point! Added this in d00e0b4. Test also updated.
katherinesheridan1
approved these changes
Feb 3, 2025
katherinesheridan1
left a comment
Contributor
There was a problem hiding this comment.
Works great on my end !!
lopezt-unity
approved these changes
Feb 5, 2025
lopezt-unity
left a comment
Collaborator
There was a problem hiding this comment.
LGTM,
Adding some comments to make tests improvements but nothing blocking here :D
| m_mesh1 = ShapeFactory.Instantiate<Cube>(); | ||
| m_mesh2 = ShapeFactory.Instantiate<Cone>(); | ||
| m_mesh3 = ShapeFactory.Instantiate<Cylinder>(); | ||
| m_mesh1.gameObject.AddComponent<BoxCollider>(); |
Comment on lines
+35
to
+36
| [TestCase(typeof(PolyShape))] | ||
| [TestCase(typeof(ProBuilderShape))] |
Collaborator
There was a problem hiding this comment.
Maybe try to change this for something like:
[TestCase(typeof(PolyShape),typeof(PolyShape))]
[TestCase(typeof(ProBuilderShape),typeof(ProBuilderShape))]
[TestCase(typeof(ProBuilderShape),typeof(PolyShape))]
Contributor
Author
|
@lopezt-unity updated the test 👍 |
This file contains hidden or 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
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.
Purpose of this PR
PR fixes issue where merging two or more polyshape objects would not remove the PolyShape component resulting in issue down the line when
Edit PolyShapetool would be activated.Links
Jira: https://jira.unity3d.com/browse/PBLD-205
Comments to Reviewers
[List known issues, planned work, provide any extra context for your code.]