extern Mesh UVW_Source; extern Mesh UVW_Target; extern Material Channel_Material; extern bool Activate_Channel; extern bool Do_Not_Zero_Channel; void main() { // Use Source Material? if(Channel_Material == NULL) Channel_Material = UVW_Source.GetMaterial(0); // Output error msg, if material is already used in one of the channels! for(int j = 0; j < UVW_Target.GetChannelCount(); j++) { if(UVW_Target.GetChannelMaterial(j) == Channel_Material) { ac.OutputToConsole("Error! This material is already used by the mesh. Execution abborted", true); return; } } // add new channel to mesh UVW_Target.AddChannel(Channel_Material, false); int lastChannelIndex = UVW_Target.GetChannelCount()-1; float u, v; for(int i = 0; i