Polska
Joined: Nov 29, 2013
Post Count: 3
Status:
Offline
Plugins don't save a file on disc
sorry, my english level is low.'
I write plugin. It write walls, rooms and furniture to OBJ file. It's work but only when I debbuging this plugin. When I run it normally the plugin don't save file on my disc. ( when debug the file is saving ). I have no idea, any sugesstions? Mayby samethink like permissons or samethin in manifest file? I don't now. Please help.
return new PluginAction[] { new VolumeAction() }; }
public class VolumeAction extends PluginAction {
public VolumeAction() { putPropertyValue(Property.NAME, "Upload project on your android device"); putPropertyValue(Property.MENU, "ToucHHome"); // Enables the action by default setEnabled(true); }
public void testOBJWriter() throws IOException { Home home = getHome(); // 1. Open the OBJ file "Test.obj" OBJWriter writer = new OBJWriter("dragsy.obj", "Test", -1); // assertTrue("trots.obj not created", new File("trots.obj").exists());
//write walls int i =0; for (Wall wall : home.getWalls()) { // Create a not alive new wall to be able to explore its coordinates without setting capabilities Wall3D wallNode = new Wall3D(wall, home, true, true); writer.writeNode(wallNode, "wall_" + ++i); } // Write 3D rooms i = 0; for (Room room : home.getRooms()) { Room3D roomNode = new Room3D(room, home, false, true, true); writer.writeNode(roomNode, "room_" + ++i); }
//Write 3D furniture for (HomePieceOfFurniture piece : home.getFurniture()) { // if (piece.isVisible() && objFile.equals("." + File.separator + "My_Home" + File.separator + piece.getName() + ".obj")) { if (piece.isVisible()){ // Create a not alive new piece to be able to explore its coordinates without setting capabilities // I set as home = null HomePieceOfFurniture3D pieceNode = new HomePieceOfFurniture3D(piece, home, true, true); writer.writeNode(pieceNode); } }
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Plugins don't save a file on disc
Writing files in a plug-in doesn't work if you run Sweet Home 3D under Java Web Start. If this doesn't apply to your case, you should try to save the file dragsy.obj in a directory where you're sure you have the rights to write.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator