//import controlP5.*; import java.util.*; import java.nio.file.*; //import java.io.*; //import java.io.File; //import static java.nio.file.StandardOpenOption.*; //ControlP5 cp5; //import processing.video.*; //Movie bgmov; import drop.*; SDrop drop; int buttonCount = 10; Button buttons[]; PImage[] texture_pi = new PImage[7]; PImage render, kaff; int ts = 20; boolean waitForExport; int exporttimer, exportinc; int imgCount; void setup() { size(275, 135); frameRate(30); //cp5 = new ControlP5(this); //List l = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h"); // cp5.addScrollableList("dropdown") // .setPosition(100, 100) // .setSize(200, 100) // .setBarHeight(20) // .setItemHeight(20) // .addItems(l) //.setType(ScrollableList.LIST) // currently supported DROPDOWN and LIST // ; drop = new SDrop(this); PImage icon = loadImage("icon.png"); surface.setIcon(icon); surface.setTitle("Boreal Alyph pbr2vmt"); textSize(ts); sa = new SecondApplet(); buttons = new Button[buttonCount]; buttons[0] = new Button("flip metallic", 15, height/2-(ts+ts/10)); buttons[1] = new Button("flip roughness", 15, height/2); buttons[2] = new Button("flip ao", 15, height/2+(ts+ts/10)); buttons[3] = new Button("save", width/7*5, height/2+2*(ts+ts/10)); buttons[4] = new Button("restore", 15, height/2+2*(ts+ts/10)); buttons[5] = new Button("skip", width/2-19, height/2+2*(ts+ts/10)); buttons[6] = new Button("yes", width/2+15, height/2+2*(ts+ts/10)); buttons[7] = new Button("no", width/2-40, height/2+2*(ts+ts/10)); buttons[8] = new Button("back", 15, 20); buttons[9] = new Button("Compile", width/2-38,height/2); kaff = loadImage("kaff.png"); // bgmov = new Movie(this, "bgmov.mp4"); // bgmov.loop(); } int readPhase_i; String inputName = ""; boolean intro_b = true; String[][] loadText_s = { {"1/3 Generate PBR map", "2/3 Generate PBR map", "3/3 Generate PBR map", "1/4 Generate .vtf", "2/4 Generate .vtf", "3/4 Generate .vtf", "4/4 Generate .vtf", "1/5 Generate .qc", "2/5 Generate .qc", "3/5 Generate .qc", "4/5 Generate .qc", "5/5 Generate .qc", "", "Enter Model / Material Name"}, {"Metallic Map", "Roughness Map", "Ambient Occlusion Map", "PBR", "Albedo Map", "Normal Map", "Height Map", "$body *.smd", "$sequence idle *.smd", "$collisionbox *.smd", "$surfaceprop", "$staticprop?", "", ""}, {"Drag and Drop here", "Drag and Drop here", "Drag and Drop here", "Configure", "Drag and Drop here", "Drag and Drop here", "Drag and Drop here", "Drag and Drop here", "Drag and Drop here", "Drag and Drop here", "select", "choose", "", ""}}; //void movieEvent(Movie m) { // m.read(); //} void draw() { background(29, 30, 30); // image(bgmov,0,0); image(kaff, width-kaff.width, 0); textAlign(CENTER); if (loading_b) { fill(255); text("Hold on", width/2, height/2); } else if (error_b) { errorDraw(); } else if (intro_b) { introDraw(); } else if (!smd_b) { texDraw(); } else { smdDraw(); } if (waitForExport) { exportVMT(); } back(); ad(); textSize(10); text(str(readPhase_i) + "/12", 15, 10); textSize(ts); //println(readPhase_i); } void back() { if (readPhase_i > 0) { textSize(10); buttons[8].update(); buttons[8].display(); textSize(ts); } } boolean error_b; int error_i; String error_s; boolean loading_b; String filePath, fileName, nameStamm, nameOut, nameExt; boolean loadSMD; boolean isImage; int textureWidth; int textureHeight; void dropEvent(DropEvent theDropEvent) { //file loading if (!intro_b && theDropEvent.isImage()) { isImage = true; getImage(theDropEvent); if (readPhase_i == 2) { PApplet.runSketch(args, sa); sa.loadMRAO(false, false, false); } else { sa.loadNewTex(); } } if (!intro_b && theDropEvent.isFile() && !isImage) { getSMD(theDropEvent); } isImage = false; }