//- // ========================================================================== // Copyright (C) 1995 - 2005 Alias Systems Corp. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files are provided by Alias // Systems Corp. ("Alias") and/or its licensors for the exclusive use of the // Customer (as defined in the Alias Software License Agreement that // accompanies this Alias software). Such Customer has the right to use, // modify, and incorporate the Data into other products and to distribute such // products for use by end-users. // // THE DATA IS PROVIDED "AS IS". ALIAS HEREBY DISCLAIMS ALL WARRANTIES // RELATING TO THE DATA, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR // IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES // WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY, // ARISING OUT OF ACCESS TO, USE OF, OR RELIANCE UPON THE DATA. // ========================================================================== //+ #ifndef _splitUVFty #define _splitUVFty // // File: splitUVFty.h // // Node Factory: splitUVFty // // Author: Lonnie Li // // Overview: // // The splitUV factory implements the actual splitUV operation. It takes in // only two parameters: // // 1) A polygonal mesh // 2) An array of selected UV Ids // // The algorithm works as follows: // // 1) Parse the mesh for the selected UVs and collect: // // (a) Number of faces sharing each UV // (stored as two arrays: face array, indexing/offset array) // (b) Associated vertex Id // // 2) Create (N-1) new UVIds for each selected UV, where N represents the number of faces // sharing the UV. // // 3) Set each of the new UVs to the same 2D location on the UVmap. // // 3) Arbitrarily let the last face in the list of faces sharing this UV to keep the original // UV. // // 4) Assign each other face one of the new UVIds. // // #include "polyModifierFty.h" // General Includes // #include #include #include class splitUVFty : public polyModifierFty { public: splitUVFty(); virtual ~splitUVFty(); void setMesh( MObject mesh ); void setUVIds( MIntArray uvIds ); // polyModifierFty inherited methods // MStatus doIt(); private: // Mesh Node - Note: We only make use of this MObject during a single call of // the splitUV plugin. It is never maintained and used between // calls to the plugin as the MObject handle could be invalidated // between calls to the plugin. // MObject fMesh; // Selected UVs // MIntArray fSelUVs; }; #endif