Package org.blender.utils
Class MainLib
- java.lang.Object
-
- org.cakelab.blender.utils.MainLibBase
-
- org.blender.utils.MainLib
-
public class MainLib extends MainLibBase
Generated class MainLib derived from blenders BKE_main.hThis 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
@author homacdoVersionCheck(FileVersionInfo)
andgetFileGlobal()
).
-
-
Field Summary
Fields Modifier and Type Field Description static short
BLENDER_MINSUBVERSION
This is the minimal Blender file sub-version, the generated data model corresponds to.static short
BLENDER_MINVERSION
This is the minimal Blender file version, the generated data model corresponds to.static java.lang.String
BLENDER_MINVERSION_STRING
#BLENDER_MINVERSION and _MINSUBVERSION as a String.static short
BLENDER_SUBVERSION
This is the subversion of blender, the data model was generated from.static short
BLENDER_VERSION
This is the version of blender, the data model was generated from.static java.lang.String
BLENDER_VERSION_STRING
#BLENDER_VERSION and _SUBVERSION as a String.-
Fields inherited from class org.cakelab.blender.utils.MainLibBase
blenderFile, blockTable
-
-
Constructor Summary
Constructors Constructor Description MainLib(BlenderFile blendFile)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
doCompatibilityCheck(FileVersionInfo fileVersionInfo)
This method checks, whether the given blender file complies to the file version range (see e.g.static boolean
doVersionCheck(FileVersionInfo fileVersionInfo)
This method checks whether the given file is of the same version as the generated data model.bAction
getBAction()
SeebAction
for documentation.bArmature
getBArmature()
SeebArmature
for documentation.bGPdata
getBGPdata()
SeebGPdata
for documentation.bNodeTree
getBNodeTree()
SeebNodeTree
for documentation.Brush
getBrush()
SeeBrush
for documentation.bScreen
getBScreen()
SeebScreen
for documentation.bSound
getBSound()
SeebSound
for documentation.CacheFile
getCacheFile()
SeeCacheFile
for documentation.Camera
getCamera()
SeeCamera
for documentation.Collection
getCollection()
SeeCollection
for documentation.Curve
getCurve()
SeeCurve
for documentation.Curves
getCurves()
SeeCurves
for documentation.FileGlobal
getFileGlobal()
Information about the associated fileprotected CFacade
getFirst(CFacade libElem)
returns the first library element in the list of ids which the given libElem is a part of.FreestyleLineStyle
getFreestyleLineStyle()
SeeFreestyleLineStyle
for documentation.IdAdtTemplate
getIdAdtTemplate()
SeeIdAdtTemplate
for documentation.Image
getImage()
SeeImage
for documentation.Ipo
getIpo()
SeeIpo
for documentation.Key
getKey()
SeeKey
for documentation.Lamp
getLamp()
SeeLamp
for documentation.Lattice
getLattice()
SeeLattice
for documentation.Library
getLibrary()
SeeLibrary
for documentation.LightProbe
getLightProbe()
SeeLightProbe
for documentation.Mask
getMask()
SeeMask
for documentation.Material
getMaterial()
SeeMaterial
for documentation.Mesh
getMesh()
SeeMesh
for documentation.MetaBall
getMetaBall()
SeeMetaBall
for documentation.MovieClip
getMovieClip()
SeeMovieClip
for documentation.MainLib
getNext()
Linkage between main libraries.BlenderObject
getObject()
SeeBlenderObject
for documentation.PaintCurve
getPaintCurve()
SeePaintCurve
for documentation.Palette
getPalette()
SeePalette
for documentation.ParticleSettings
getParticleSettings()
SeeParticleSettings
for documentation.PointCloud
getPointCloud()
SeePointCloud
for documentation.MainLib
getPrev()
Linkage between main libraries.Scene
getScene()
SeeScene
for documentation.Script
getScript()
SeeScript
for documentation.Simulation
getSimulation()
SeeSimulation
for documentation.Speaker
getSpeaker()
SeeSpeaker
for documentation.Tex
getTex()
SeeTex
for documentation.Text
getText()
SeeText
for documentation.VFont
getVFont()
SeeVFont
for documentation.Volume
getVolume()
SeeVolume
for documentation.wmWindowManager
getWmWindowManager()
SeewmWindowManager
for documentation.WorkSpace
getWorkSpace()
SeeWorkSpace
for documentation.World
getWorld()
SeeWorld
for documentation.void
setBAction(bAction bAction)
SeebAction
for documentation.void
setBArmature(bArmature bArmature)
SeebArmature
for documentation.void
setBGPdata(bGPdata bGPdata)
SeebGPdata
for documentation.void
setBNodeTree(bNodeTree bNodeTree)
SeebNodeTree
for documentation.void
setBrush(Brush brush)
SeeBrush
for documentation.void
setBScreen(bScreen bScreen)
SeebScreen
for documentation.void
setBSound(bSound bSound)
SeebSound
for documentation.void
setCacheFile(CacheFile cacheFile)
SeeCacheFile
for documentation.void
setCamera(Camera camera)
SeeCamera
for documentation.void
setCollection(Collection collection)
SeeCollection
for documentation.void
setCurve(Curve curve)
SeeCurve
for documentation.void
setCurves(Curves curves)
SeeCurves
for documentation.void
setFreestyleLineStyle(FreestyleLineStyle freestyleLineStyle)
SeeFreestyleLineStyle
for documentation.void
setIdAdtTemplate(IdAdtTemplate idAdtTemplate)
SeeIdAdtTemplate
for documentation.void
setImage(Image image)
SeeImage
for documentation.void
setIpo(Ipo ipo)
SeeIpo
for documentation.void
setKey(Key key)
SeeKey
for documentation.void
setLamp(Lamp lamp)
SeeLamp
for documentation.void
setLattice(Lattice lattice)
SeeLattice
for documentation.void
setLibrary(Library library)
SeeLibrary
for documentation.void
setLightProbe(LightProbe lightProbe)
SeeLightProbe
for documentation.void
setMask(Mask mask)
SeeMask
for documentation.void
setMaterial(Material material)
SeeMaterial
for documentation.void
setMesh(Mesh mesh)
SeeMesh
for documentation.void
setMetaBall(MetaBall metaBall)
SeeMetaBall
for documentation.void
setMovieClip(MovieClip movieClip)
SeeMovieClip
for documentation.void
setObject(BlenderObject object)
SeeBlenderObject
for documentation.void
setPaintCurve(PaintCurve paintCurve)
SeePaintCurve
for documentation.void
setPalette(Palette palette)
SeePalette
for documentation.void
setParticleSettings(ParticleSettings particleSettings)
SeeParticleSettings
for documentation.void
setPointCloud(PointCloud pointCloud)
SeePointCloud
for documentation.void
setScene(Scene scene)
SeeScene
for documentation.void
setScript(Script script)
SeeScript
for documentation.void
setSimulation(Simulation simulation)
SeeSimulation
for documentation.void
setSpeaker(Speaker speaker)
SeeSpeaker
for documentation.void
setTex(Tex tex)
SeeTex
for documentation.void
setText(Text text)
SeeText
for documentation.void
setVFont(VFont vFont)
SeeVFont
for documentation.void
setVolume(Volume volume)
SeeVolume
for documentation.void
setWmWindowManager(wmWindowManager wmWindowManager)
SeewmWindowManager
for documentation.void
setWorkSpace(WorkSpace workSpace)
SeeWorkSpace
for documentation.void
setWorld(World world)
SeeWorld
for documentation.-
Methods inherited from class org.cakelab.blender.utils.MainLibBase
isLibraryElement
-
-
-
-
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
-
BLENDER_VERSION_STRING
public static final java.lang.String BLENDER_VERSION_STRING
#BLENDER_VERSION and _SUBVERSION as a String.- See Also:
BLENDER_VERSION
,BLENDER_SUBVERSION
, Constant Field Values
-
BLENDER_MINVERSION_STRING
public static final java.lang.String BLENDER_MINVERSION_STRING
#BLENDER_MINVERSION and _MINSUBVERSION as a String.
-
-
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 fromBlenderFile.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 filessource/blender/blenloader/intern/versioning_*.c
. These functions are not implemeted in Java .Blend. You can get file version info fromBlenderFile.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 classMainLibBase
- 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
-
getObject
public BlenderObject getObject()
SeeBlenderObject
for documentation.
-
setObject
public void setObject(BlenderObject object)
SeeBlenderObject
for documentation.
-
getCollection
public Collection getCollection()
SeeCollection
for documentation.
-
setCollection
public void setCollection(Collection collection)
SeeCollection
for documentation.
-
getPaintCurve
public PaintCurve getPaintCurve()
SeePaintCurve
for documentation.
-
setPaintCurve
public void setPaintCurve(PaintCurve paintCurve)
SeePaintCurve
for documentation.
-
getParticleSettings
public ParticleSettings getParticleSettings()
SeeParticleSettings
for documentation.
-
setParticleSettings
public void setParticleSettings(ParticleSettings particleSettings)
SeeParticleSettings
for documentation.
-
getWmWindowManager
public wmWindowManager getWmWindowManager()
SeewmWindowManager
for documentation.
-
setWmWindowManager
public void setWmWindowManager(wmWindowManager wmWindowManager)
SeewmWindowManager
for documentation.
-
getIdAdtTemplate
public IdAdtTemplate getIdAdtTemplate()
SeeIdAdtTemplate
for documentation.
-
setIdAdtTemplate
public void setIdAdtTemplate(IdAdtTemplate idAdtTemplate)
SeeIdAdtTemplate
for documentation.
-
getFreestyleLineStyle
public FreestyleLineStyle getFreestyleLineStyle()
SeeFreestyleLineStyle
for documentation.
-
setFreestyleLineStyle
public void setFreestyleLineStyle(FreestyleLineStyle freestyleLineStyle)
SeeFreestyleLineStyle
for documentation.
-
getLightProbe
public LightProbe getLightProbe()
SeeLightProbe
for documentation.
-
setLightProbe
public void setLightProbe(LightProbe lightProbe)
SeeLightProbe
for documentation.
-
getPointCloud
public PointCloud getPointCloud()
SeePointCloud
for documentation.
-
setPointCloud
public void setPointCloud(PointCloud pointCloud)
SeePointCloud
for documentation.
-
getSimulation
public Simulation getSimulation()
SeeSimulation
for documentation.
-
setSimulation
public void setSimulation(Simulation simulation)
SeeSimulation
for documentation.
-
-