Beispiel #1
0
        /// <summary>
        /// Utility method to dump UV maps from every model currently in the model database.
        /// TODO -- has issues/errors on some models/meshes/renderers (might be a skinned-mesh-renderer problem...)
        /// TODO -- has issues with part names that have invalid characters for file-system use -- should sanitize the names
        /// </summary>
        public static void dumpUVMaps(bool force = false)
        {
            UVMapExporter exporter = new UVMapExporter();
            ConfigNode    node     = TexturesUnlimitedLoader.configurationNode.GetNode("UV_EXPORT");
            bool          export   = node.GetBoolValue("exportUVs", false);

            if (!export && !force)
            {
                return;
            }
            string path = node.GetStringValue("exportPath", "exportedUVs");

            exporter.width  = node.GetIntValue("width", 1024);
            exporter.height = node.GetIntValue("height", 1024);
            exporter.stroke = node.GetIntValue("thickness", 1);
            foreach (GameObject go in GameDatabase.Instance.databaseModel)
            {
                exporter.exportModel(go, path);
            }
        }
 public static void dumpUVMaps()
 {
     ConfigNode[] nodes = GameDatabase.Instance.GetConfigNodes("UV_EXPORT");
     if (nodes.Length > 0)
     {
         UVMapExporter exporter = new UVMapExporter();
         ConfigNode    node     = nodes[0];
         bool          export   = node.GetBoolValue("exportUVs", false);
         if (!export)
         {
             return;
         }
         string path = node.GetStringValue("exportPath", "exportedUVs");
         exporter.width  = node.GetIntValue("width", 1024);
         exporter.height = node.GetIntValue("height", 1024);
         exporter.stroke = node.GetIntValue("thickness", 1);
         foreach (GameObject go in GameDatabase.Instance.databaseModel)
         {
             exporter.exportModel(go, path);
         }
     }
 }