Re: Rendering on Windows Server 2008 Possible?

by Puybaret » Wed Feb 08, 2017 3:05 pm

Under Windows, you must replace : separators by ;

About rendering photos at the stored points of view returned by the method getStoredCameras in [font=courier new]Home[/font] class, you could replace the following two lines in [font=courier new]ConsolePhotoGenerator.java[/font]:

Code: Select all

    renderer.render(image, home.getCamera(), null);
   ImageIO.write(image, homePhoto.substring(homePhoto.lastIndexOf('.') + 1), new File(homePhoto));
by:

Code: Select all

    for (Camera camera : home.getStoredCameras()) {
      renderer.render(image, camera, null);
      int dotIndex = homePhoto.lastIndexOf('.');
      String cameraPhoto = homePhoto.substring(0, dotIndex) + "-" 
          + camera.getName().replaceAll("/|\\\\|:|;", "-").replace(File.pathSeparatorChar, '-').replace(File.separatorChar, '-')
          + homePhoto.substring(dotIndex);
      ImageIO.write(image, homePhoto.substring(dotIndex + 1), new File(cameraPhoto));
    }
and you should import [font=courier new]com.eteks.sweethome3d.model.Camera[/font] class.