Class BlenderLauncher

java.lang.Object
org.web3d.x3d.jsail.BlenderLauncher

public class BlenderLauncher
extends java.lang.Object
Utility class for invoking and launching Blender via local operating system to perform a variety of conversion tasks. Note use of static methods.

See Also:
Blender, Blender Quickstart Introduction, Blender API Introduction, Blender Python API Documentation, Scripting & Extending Blender, Blender 3D: Noob to Pro, Blender 3D: Noob to Pro/Advanced Tutorials/Python Scripting/Introduction, Video: Blender Tutorial Introduction to Python Scripting: Writing a Script That Makes a Simple 3D Model, Java Tutorials: Understanding (Static) Class Members, X3D Scene Authoring Hints
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String BLENDER_PATH_DEFAULT_LINUX
    Default Blender path default for Linux operating system, possibly unneeded if blender is in path already.
    static java.lang.String BLENDER_PATH_DEFAULT_MACOS
    Default Blender path default for macOS operating system, possibly unneeded if blender is in path already.
    static java.lang.String BLENDER_PATH_DEFAULT_WINDOWS
    Default Blender path default for Windows 7 or 10 operating system, possibly unneeded if blender is in path already.
    static java.lang.String BLENDER_PYTHON_SCRIPT_STL_TO_X3D
    Blender python script for converting STL model into X3D model.
    static java.lang.String BLENDER_PYTHON_SCRIPT_X3D_TO_PNG
    Blender python script for converting X3D model into PNG image.
    static java.lang.String BLENDER_URL
    Blender website URL
    static java.lang.String USAGE
    Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.BlenderLauncher sourceFile [-convert [resultFile]] [-toImage [snapshotName.*]] [-home | -help | -properties fileName.properties | -BLENDER_PATH directoryPath]
  • Constructor Summary

    Constructors 
    Constructor Description
    BlenderLauncher()  
  • Method Summary

    Modifier and Type Method Description
    static void checkBlenderPath()
    Check Blender local path and reset to operating system default, if necessary.
    static boolean convertModel​(java.lang.String inputFileName, java.lang.String outputFileName)
    TODO: Use Blender to convert model from one file to another.
    static boolean convertModel​(java.lang.String path, java.lang.String inputFileName, java.lang.String outputFileName)
    TODO: Use Blender to convert model from one file to another based on filename extensions.
    protected static java.lang.String executeCommand​(java.lang.String command)
    Launch blender in operating system and run command.
    static java.lang.String exportSTL​(X3DObject modelToExport)
    TODO: Use blender to export geometry to STL
    static boolean exportSTLtoFile​(X3DObject modelToExport, java.lang.String path, java.lang.String fileName)
    TODO: Use blender to export geometry to file
    static java.lang.String getBlenderAnalytics​(X3DObject modelOfInterest)
    TODO: Get Blender metrics for X3D model of interest.
    static MetadataSetObject getBlenderAnalyticsX3dMetadataSet​(X3DObject modelOfInterest)
    TODO: Get Blender metrics as MetadataSet object.
    static java.lang.String getBlenderExecutableName()
    Get directory path for location of blender program: blender.exe on Windows, blender otherwise.
    static java.lang.String getBlenderPath()
    Get preference for XSLT transformation engine to use: ConfigurationProperties.XSLT_ENGINE_SAXON or ConfigurationProperties.XSLT_ENGINE_NATIVE_JAVA.
    static java.lang.String getBlenderVersion()
    Get Blender version.
    static boolean hasBlender()
    Determine if Blender is locally available.
    static X3DObject importModel​(java.lang.String path, java.lang.String fileName)
    TODO: Use blender to import model to X3D
    static X3DObject importSTL​(java.lang.String path, java.lang.String fileName)
    TODO finish: Use blender to import STL geometry as X3D model
    static void initialize()
    Initialize this BlenderLauncher instance to default values.
    static void launchBlenderWebPage()
    Open Blender page
    static void main​(java.lang.String[] args)
    Default main() method provided for test and debugging purposes, invoking run() method.
    static void run​(java.lang.String arguments)
    Utility run() method provided for test and debugging purposes, allowing invocation with a single String (rather than a String[] array).
    static void run​(java.lang.String[] args)
    Default run() method provided for test and debugging purposes, first initializing ConfigurationProperties then reading properties file (if any) and processing arguments.
    static void setBlenderPath​(java.lang.String newValue)
    Set preference for XSLT transformation engine to use: ConfigurationProperties.XSLT_ENGINE_SAXON or ConfigurationProperties.XSLT_ENGINE_NATIVE_JAVA.
    static boolean wasPriorCommandSuccessful()
    Report whether prior command execution was successful.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait