public bool UpdatePackage(MeshConstructor sm, Type dataType) { // if (!sm.valid) //{//(sm.verts == null) || (sm.tris == null) || (sm.verts.Length < 3) || (sm.tris.TotalCount() < 3)) { // Debug.Log("Got no stuff to regenerate mesh. "); // return false; //} MeshSolutions.CurMeshDta = sm; MeshSolutions.dataTypeFilter = dataType; foreach (VertexSolution vs in sln) { if (vs.enabled) { vs.Pack(); } } foreach (VertexDataType vt in MeshSolutions.types) { vt.Clear(); } return(true); }
public bool Repack(MeshConstructor sm) { if (!sm.Valid) {//(sm.verts == null) || (sm.tris == null) || (sm.verts.Length < 3) || (sm.tris.TotalCount() < 3)) { Debug.Log("Got no stuff to regenerate mesh. "); return(false); } sm.mesh.Clear(); MeshSolutions.CurMeshDta = sm; MeshSolutions.dataTypeFilter = null; foreach (VertexSolution vs in sln) { if (vs.enabled) { vs.Pack(); } } foreach (VertexDataType vt in MeshSolutions.types) { vt.Clear(); } return(true); }
public void Redraw() { if (target != null) { MeshConstructor mc = new MeshConstructor(edMesh, target.MeshProfile, target.meshFilter.sharedMesh); if (!edMesh.dirty_Vertices && !edMesh.dirty_Normals && EditedMesh.Dirty) { if (EditedMesh.dirty_Position) { mc.UpdateMesh <MeshSolutions.VertexPos>(); } if (edMesh.dirty_Color) { mc.UpdateMesh <MeshSolutions.VertexColor>(); } } else { target.meshFilter.sharedMesh = mc.Construct(); mc.AssignMeshAsCollider(target.meshCollider); } } edMesh.Dirty = false; // if (_meshTool == MeshTool.VertexAnimation) //{ //UpdateAnimations(SaveAbleMesh sbm); /* int curFrame = _target.GetAnimationUVy();//getBaseDependencies().stretch_Monitor.curUVy; * MeshConstructionData svm = _target.saveMeshDta; * vertexAnimationFrame vaf = svm.anims[curFrame]; * if (vaf != null) * { * foreach (vertexpointDta vp in _Mesh.vertices) * vaf.verts[ vp.index] = vp.anim[curFrame]; * * svm.updateAnimation(curFrame); * } */ //} // Debug.Log("Redraw "); }