
I have no idea on scripting so:limitations,
-First i used a method from mCleaner to select NGons so you need mCleaner.
2)It works only if the mesh is named cube
3)For fast undo delete the operators, freeze after use if you plan to use it more than once.
4)Dosn`t work for parallel loops that are touching or nested loops etc, or complex shapes of dissolved stuff.
5)Outside of dissolved loops it needs a mesh with quads or triangles, other Ngons will possibly end up like holes or some monstrocity.
6)Extreme dissolves (like for example a dissolve of almost an entire loop around a cylinder) might give probs with welding, so split in more parts with a polygon in between and freeze again before use.
Corespondent edges will weld at some point adjust weldedgesop.distance", 1 to something else if distance is the prob.
Code: Select all
var Sel= Selection;
mSelNgons();
SelectFilter("Polygon");
DuplicateMeshComponent();
//Translate(null, 0, 0.2, 0, siRelative, siLocal, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
SelectAdjacent(null, "Edge", false);
ActivateRaycastPolySelTool(null);
ApplyTopoOp("DeleteComponent",null, siUnspecified, siPersistentOperation, null);
ActivateRaycastEdgeSelTool(null);
ApplyTopoOp("WeldEdges", null, siUnspecified, siPersistentOperation, null);
SetValue("cube.polymsh.weldedgesop.distance", 1, null);
SelectAdjacent(null, "Point", false);
ActivateRaycastEdgeSelTool(null);
ApplyTopoOp("DissolveComponent", null, siUnspecified, siPersistentOperation, null);
ActivateVertexSelTool(null);
ApplyTopoOp("Collapse", null, siUnspecified, siPersistentOperation, null);
