Class MainLib


  • public class MainLib
    extends MainLibBase
    Generated class MainLib derived from blenders BKE_main.h

    This class is basically the entry point to all data in a blender file and associated external files (so called libraries). The content of one blender file goes in one main library. While blender can open multiple files, every file gets its own main lib and all main libs are linked to each other.

    When initialised, it scans all block headers and searches for structs, which contain a variable of class ID as its first member and attaches them to the appropriate members of the main lib (represented by this class).

    This class is also vital to check whether a given blender file is compatible with the data model associated with this Main lib class (see doVersionCheck(FileVersionInfo) and getFileGlobal()).

    @author homac
    • Field Detail

      • BLENDER_VERSION

        public static final short BLENDER_VERSION
        This is the version of blender, the data model was generated from. It's also called Blender file version and is usually equivalent to the versino of the Blender program. Implicitly, it is the maximum file version the generated import code can understand.
        See Also:
        Constant Field Values
      • BLENDER_SUBVERSION

        public static final short BLENDER_SUBVERSION
        This is the subversion of blender, the data model was generated from. It's also called Blender file sub-version, which can differ from the patch-level of the Blender program. Implicitly, it is the maximum file sub-version the generated import code can understand.
        See Also:
        Constant Field Values
      • BLENDER_MINVERSION

        public static final short BLENDER_MINVERSION
        This is the minimal Blender file version, the generated data model corresponds to. Every file with a version lower than this needs conversion.
        See Also:
        BLENDER_VERSION, Constant Field Values
      • BLENDER_MINSUBVERSION

        public static final short BLENDER_MINSUBVERSION
        This is the minimal Blender file sub-version, the generated data model corresponds to. Every file with a version lower than this needs conversion.
        See Also:
        BLENDER_SUBVERSION, Constant Field Values
    • Constructor Detail

      • MainLib

        public MainLib​(BlenderFile blendFile)
                throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • doVersionCheck

        public static boolean doVersionCheck​(FileVersionInfo fileVersionInfo)
                                      throws java.io.IOException
        This method checks whether the given file is of the same version as the generated data model. You can get file version info from BlenderFile.readFileGlobal().
        Throws:
        java.io.IOException
      • doCompatibilityCheck

        public static boolean doCompatibilityCheck​(FileVersionInfo fileVersionInfo)
                                            throws java.io.IOException
        This method checks, whether the given blender file complies to the file version range (see e.g. #BLENDER_VERSION and #BLENDER_MINVERSION) that could in principle be supported by the data model. That means, required structs may exist but the content may have to be converted, which is generally not supported by the library. Unless you have added methods to convert the data, you should convert the file with. blender before reading it. Conversion code can be found in Blender's source code in files source/blender/blenloader/intern/versioning_*.c. These functions are not implemeted in Java .Blend. You can get file version info from BlenderFile.readFileGlobal().
        Throws:
        java.io.IOException
        See Also:
        getFileGlobal(), doVersionCheck(FileVersionInfo)
      • getFirst

        protected CFacade getFirst​(CFacade libElem)
                            throws java.io.IOException
        returns the first library element in the list of ids which the given libElem is a part of.
        Specified by:
        getFirst in class MainLibBase
        Throws:
        java.io.IOException
      • getNext

        public MainLib getNext()
        Linkage between main libraries.
      • getPrev

        public MainLib getPrev()
        Linkage between main libraries.
      • getFileGlobal

        public FileGlobal getFileGlobal()
        Information about the associated file
      • getLibrary

        public Library getLibrary()
        See Library for documentation.
      • setLibrary

        public void setLibrary​(Library library)
        See Library for documentation.
      • getIpo

        public Ipo getIpo()
        See Ipo for documentation.
      • setIpo

        public void setIpo​(Ipo ipo)
        See Ipo for documentation.
      • getKey

        public Key getKey()
        See Key for documentation.
      • setKey

        public void setKey​(Key key)
        See Key for documentation.
      • getText

        public Text getText()
        See Text for documentation.
      • setText

        public void setText​(Text text)
        See Text for documentation.
      • getCamera

        public Camera getCamera()
        See Camera for documentation.
      • setCamera

        public void setCamera​(Camera camera)
        See Camera for documentation.
      • getImage

        public Image getImage()
        See Image for documentation.
      • setImage

        public void setImage​(Image image)
        See Image for documentation.
      • getTex

        public Tex getTex()
        See Tex for documentation.
      • setTex

        public void setTex​(Tex tex)
        See Tex for documentation.
      • getLamp

        public Lamp getLamp()
        See Lamp for documentation.
      • setLamp

        public void setLamp​(Lamp lamp)
        See Lamp for documentation.
      • setMaterial

        public void setMaterial​(Material material)
        See Material for documentation.
      • getVFont

        public VFont getVFont()
        See VFont for documentation.
      • setVFont

        public void setVFont​(VFont vFont)
        See VFont for documentation.
      • setMetaBall

        public void setMetaBall​(MetaBall metaBall)
        See MetaBall for documentation.
      • getCurve

        public Curve getCurve()
        See Curve for documentation.
      • setCurve

        public void setCurve​(Curve curve)
        See Curve for documentation.
      • getMesh

        public Mesh getMesh()
        See Mesh for documentation.
      • setMesh

        public void setMesh​(Mesh mesh)
        See Mesh for documentation.
      • getLattice

        public Lattice getLattice()
        See Lattice for documentation.
      • setLattice

        public void setLattice​(Lattice lattice)
        See Lattice for documentation.
      • getWorld

        public World getWorld()
        See World for documentation.
      • setWorld

        public void setWorld​(World world)
        See World for documentation.
      • getScene

        public Scene getScene()
        See Scene for documentation.
      • setScene

        public void setScene​(Scene scene)
        See Scene for documentation.
      • getScript

        public Script getScript()
        See Script for documentation.
      • setScript

        public void setScript​(Script script)
        See Script for documentation.
      • getBScreen

        public bScreen getBScreen()
        See bScreen for documentation.
      • setBScreen

        public void setBScreen​(bScreen bScreen)
        See bScreen for documentation.
      • getBSound

        public bSound getBSound()
        See bSound for documentation.
      • setBSound

        public void setBSound​(bSound bSound)
        See bSound for documentation.
      • setCollection

        public void setCollection​(Collection collection)
        See Collection for documentation.
      • setBArmature

        public void setBArmature​(bArmature bArmature)
        See bArmature for documentation.
      • getBAction

        public bAction getBAction()
        See bAction for documentation.
      • setBAction

        public void setBAction​(bAction bAction)
        See bAction for documentation.
      • setBNodeTree

        public void setBNodeTree​(bNodeTree bNodeTree)
        See bNodeTree for documentation.
      • getBrush

        public Brush getBrush()
        See Brush for documentation.
      • setBrush

        public void setBrush​(Brush brush)
        See Brush for documentation.
      • getPalette

        public Palette getPalette()
        See Palette for documentation.
      • setPalette

        public void setPalette​(Palette palette)
        See Palette for documentation.
      • setPaintCurve

        public void setPaintCurve​(PaintCurve paintCurve)
        See PaintCurve for documentation.
      • getBGPdata

        public bGPdata getBGPdata()
        See bGPdata for documentation.
      • setBGPdata

        public void setBGPdata​(bGPdata bGPdata)
        See bGPdata for documentation.
      • getSpeaker

        public Speaker getSpeaker()
        See Speaker for documentation.
      • setSpeaker

        public void setSpeaker​(Speaker speaker)
        See Speaker for documentation.
      • setMovieClip

        public void setMovieClip​(MovieClip movieClip)
        See MovieClip for documentation.
      • getMask

        public Mask getMask()
        See Mask for documentation.
      • setMask

        public void setMask​(Mask mask)
        See Mask for documentation.
      • setCacheFile

        public void setCacheFile​(CacheFile cacheFile)
        See CacheFile for documentation.
      • setWorkSpace

        public void setWorkSpace​(WorkSpace workSpace)
        See WorkSpace for documentation.
      • setLightProbe

        public void setLightProbe​(LightProbe lightProbe)
        See LightProbe for documentation.
      • getHair

        public Hair getHair()
        See Hair for documentation.
      • setHair

        public void setHair​(Hair hair)
        See Hair for documentation.
      • setPointCloud

        public void setPointCloud​(PointCloud pointCloud)
        See PointCloud for documentation.
      • getVolume

        public Volume getVolume()
        See Volume for documentation.
      • setVolume

        public void setVolume​(Volume volume)
        See Volume for documentation.