News:

Latest addition to the collection: Prefab Maker

Main Menu

Mesh Editor: Undo too far and get lots of Box Colliders

Started by Sleepy, September 22, 2015, 04:08:35 AM

Previous topic - Next topic

Sleepy

I have been playing with Mesh Editor on a cube. Just dragging some vertexes around, subdividing a triangle, not too much.
If I then hit Ctrl-Z (Undo) a lot my cube ends up vanishing, there are warnings in the console, and the original cube gets lots of Box Colliders. See attached screenshot.
Console says to use Undo.AddComponent instead of GameObject.AddComponent.
Unity 5.2.03f Personal. Mesh Maker 1.9.7.

MediaGiant

I'll certainly look into this for the next update. I am yet to see the addition of multiple colliders when using Undo/Redo, but I do recommend keeping an eye on how many times you do an undo. The reason for this is that Unity gives us no way to limit the number of undo operations and stepping back too far and will deselect the object which breaks the lock on the object.

In fact doing an undo/redo via the ctrl-z and ctrl-y shortcuts is almost impossible for a mesh edit and I stumbled upon a new way almost by accident. I am sure I can improve on this and will use your console notifications as a starting point.

Sleepy

You got it - I made a few changes then typed a lot of Ctrl-Z. I wanted to undo everything and start over.

(Log messages attached.)
I started a new project, created a cube, locked it, selected the top two triangles, subdivided them.
The Shader Warning seems to be associated with the Mesh Maker button panel.
The 26.0 debug message is associated with the Subdivide Triangles button.
First Ctlr-Z makes the cube invisible but leaves the box collider. The Inspector shows Mesh Filter: [none] and the Mesh property has Missing (Mesh).
Second Ctrl-Z brings back what looks like the original cube. The top triangles are no longer subdivided. The Mesh Filter in the Inspector is now correct, but there is an additional Box Collider. And that Undo.AddComponent message is logged.
Third Ctrl-Z undoes cube creation.
Interesting that Ctrl-Y works just fine from here. First the cube reappears, then the Box Collider only appears, then the cube with subdivided triangles appears.

Do you want any more details?

MediaGiant

Hi Sleepy,

I've checked for any Debug.Log messages and that one is a mystery to me as I cannot find one in the current version. It may be that your installation is an earlier version or the new version hasn't imported over the old one correctly. I always recommend the previous version be removed/deleted before importing the latest version.

I'm in the process of updating Mesh Editor and will add an Undo.AddComponent for the colliders and other components.

That shader is related to the selection highlight. I will try to edit the shader to make it compatible or change it out.

Thanks for the info, and just to let you know, I've put down the new project that I've been working on and will get these fixes out in less than a week.


Sleepy

Thanks.
This is not high priority. I am detail oriented and I just wanted to log these minor issues while I noticed them. Unity must be a bit of a moving target!

MediaGiant

#5
Thanks for your understanding. It's been a busy time, and yes, with each Unity update there seem to be new issues.

I did find out that the scripted shaders are being phased out by Unity (http://answers.unity3d.com/questions/1068700/gllines-shader-is-not-supported.html) so I will be replacing this with something else.

The update for Mesh Editor has now been prioritized and the update will address most of the small fixes that are needed and a couple of big changes.

Sleepy

Here's a bit more detail.
This is a new Unity project with only MeshMaker imported. I downloaded a fresh MeshMaker 1.9.7.
Unity complains about the use of some "obsolete" API during the import. Pity they don't give more detail. I chose the Go Ahead option.
The debug message claims to come from SubdivideTriangles().