public class BlenderContext
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BlenderContext.LoadedDataType
This enum defines what loaded data type user wants to retrieve.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<FileBlockHeader> |
blocks
The blocks read from the file.
|
protected java.util.Map<java.lang.Long,BoneContext> |
boneContexts
A map of bone contexts.
|
protected java.util.Map<java.lang.Long,java.util.List<Constraint>> |
constraints
A list of constraints for the specified object.
|
| Constructor and Description |
|---|
BlenderContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAction(BlenderAction action)
Adds blender action to the context.
|
void |
addAnimation(java.lang.Long ownerOMA,
Animation animation)
This method adds the animation for the specified OMA of its owner.
|
void |
addConstraints(java.lang.Long ownerOMA,
java.util.List<Constraint> constraints)
This method adds a new modifier to the list.
|
void |
addFileBlockHeader(java.lang.Long oldMemoryAddress,
FileBlockHeader fileBlockHeader)
This method adds a file block header to the map.
|
void |
addLinkedFeature(java.lang.String blenderFilePath,
java.lang.String featureGroup,
java.lang.Object feature)
Deprecated.
|
void |
addLoadedFeatures(java.lang.Long oldMemoryAddress,
BlenderContext.LoadedDataType featureDataType,
java.lang.Object feature)
This method adds a loaded feature to the map.
|
void |
addMarker(java.lang.String marker,
java.lang.Object feature,
java.lang.Object markerValue)
Adds a custom marker for scene's feature.
|
java.util.Map<java.lang.String,BlenderAction> |
getActions() |
java.util.List<Constraint> |
getAllConstraints() |
java.util.List<Animation> |
getAnimations(java.lang.Long ownerOMA)
This method returns the animation data for the specified owner.
|
AssetManager |
getAssetManager()
This method returns the asset manager.
|
BlenderKey |
getBlenderKey()
This method returns the blender key.
|
int |
getBlenderVersion() |
java.util.List<FileBlockHeader> |
getBlocks() |
BoneContext |
getBoneByName(java.lang.Long skeletonOMA,
java.lang.String name)
Returns bone by given name.
|
BoneContext |
getBoneContext(Bone bone)
Returns bone context for the given bone.
|
BoneContext |
getBoneContext(java.lang.Long boneOMA)
This method returns the bone context for the given bone old memory
address.
|
java.util.List<Constraint> |
getConstraints(java.lang.Long ownerOMA)
Returns constraints applied to the feature of the given OMA.
|
Node |
getControlledNode(Skeleton skeleton)
This method returns the armature node that is defined for the skeleton.
|
Material |
getDefaultMaterial()
This metod returns the default material.
|
DnaBlockData |
getDnaBlockData()
This method returns the dna block data.
|
FileBlockHeader |
getFileBlock(java.lang.Long oldMemoryAddress)
This method returns the block header of a given memory address.
|
java.util.List<FileBlockHeader> |
getFileBlocks(FileBlockHeader.BlockCode code)
This method returns a list of file blocks' headers of a specified code.
|
<T> T |
getHelper(java.lang.Class<?> clazz) |
BlenderInputStream |
getInputStream()
This method returns the input stream of the blend file.
|
java.lang.Object |
getLinkedFeature(java.lang.String blenderFilePath,
java.lang.String featureName)
The method returns linked feature of a given name from the specified blender path.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
getLinkedFeatures() |
java.lang.Object |
getLoadedFeature(java.lang.Long oldMemoryAddress,
BlenderContext.LoadedDataType loadedFeatureDataType)
This method returns the feature of a given memory address.
|
java.lang.Object |
getMarkerValue(java.lang.String marker,
java.lang.Object feature)
Returns the marker value.
|
Structure |
getSceneStructure()
This method returns the scene structure data.
|
Skeleton |
getSkeleton(java.lang.Long skeletonOMA)
This method returns the skeleton for the specified OMA of its owner.
|
Structure |
peekParent()
This method retrieves the structure at the top of the parent's stack but
does not remove it.
|
Structure |
popParent()
This method removes the structure from the top of the parent's stack.
|
void |
pushParent(Structure parent)
This method adds the structure to the parent stack.
|
<T> void |
putHelper(java.lang.Class<T> clazz,
AbstractBlenderHelper helper)
This method adds a helper instance to the helpers' map.
|
void |
setAssetManager(AssetManager assetManager)
This method sets the asset manager.
|
void |
setBlenderKey(BlenderKey blenderKey)
This method sets the blender key.
|
void |
setBlenderVersion(java.lang.String blenderVersion)
This method sets the blender file version.
|
void |
setBlockData(DnaBlockData dnaBlockData)
This method sets the dna block data.
|
void |
setBoneContext(java.lang.Long boneOMA,
BoneContext boneContext)
This method sets the bone context for the given bone old memory address.
|
void |
setInputStream(BlenderInputStream inputStream)
This method sets the input stream of the blend file.
|
void |
setNodeForSkeleton(Skeleton skeleton,
Node node)
The method stores a binding between the skeleton and the proper armature
node.
|
void |
setSceneStructure(Structure sceneStructure)
This method sets the scene structure data.
|
void |
setSkeleton(java.lang.Long skeletonOMA,
Skeleton skeleton)
This method sets the skeleton for the specified OMA of its owner.
|
java.lang.String |
toString() |
protected java.util.List<FileBlockHeader> blocks
protected java.util.Map<java.lang.Long,java.util.List<Constraint>> constraints
protected java.util.Map<java.lang.Long,BoneContext> boneContexts
public void setBlenderVersion(java.lang.String blenderVersion)
blenderVersion - the blender file versionpublic int getBlenderVersion()
public void setBlenderKey(BlenderKey blenderKey)
blenderKey - the blender keypublic BlenderKey getBlenderKey()
public void setBlockData(DnaBlockData dnaBlockData)
dnaBlockData - the dna block datapublic DnaBlockData getDnaBlockData()
public void setSceneStructure(Structure sceneStructure)
sceneStructure - the scene structure datapublic Structure getSceneStructure()
public AssetManager getAssetManager()
public void setAssetManager(AssetManager assetManager)
assetManager - the asset managerpublic BlenderInputStream getInputStream()
public void setInputStream(BlenderInputStream inputStream)
inputStream - the input stream of the blend filepublic void addFileBlockHeader(java.lang.Long oldMemoryAddress,
FileBlockHeader fileBlockHeader)
oldMemoryAddress - the address of the block headerfileBlockHeader - the block header to storepublic java.util.List<FileBlockHeader> getBlocks()
public FileBlockHeader getFileBlock(java.lang.Long oldMemoryAddress)
oldMemoryAddress - the address of the block headerpublic java.util.List<FileBlockHeader> getFileBlocks(FileBlockHeader.BlockCode code)
code - the code of file blockspublic <T> void putHelper(java.lang.Class<T> clazz,
AbstractBlenderHelper helper)
T - the type of the helperclazz - helper's class definitionhelper - the helper instancepublic <T> T getHelper(java.lang.Class<?> clazz)
public void addLoadedFeatures(java.lang.Long oldMemoryAddress,
BlenderContext.LoadedDataType featureDataType,
java.lang.Object feature)
oldMemoryAddress - the address of the featurefeatureDataType - feature - the feature we want to storepublic java.lang.Object getLoadedFeature(java.lang.Long oldMemoryAddress,
BlenderContext.LoadedDataType loadedFeatureDataType)
oldMemoryAddress - the address of the featureloadedFeatureDataType - the type of data we want to retrieve it can be either filled
structure or already converted feature@Deprecated
public void addLinkedFeature(java.lang.String blenderFilePath,
java.lang.String featureGroup,
java.lang.Object feature)
blenderFilePath - the path of linked blender filefeatureGroup - the linked feature group (ie. scenes, materials, meshes, etc.)feature - the linked featurepublic java.lang.Object getLinkedFeature(java.lang.String blenderFilePath,
java.lang.String featureName)
blenderFilePath - the blender file pathfeatureName - the feature name we want to getpublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getLinkedFeatures()
public void pushParent(Structure parent)
parent - the structure to be added to the stackpublic Structure popParent()
public Structure peekParent()
public void addConstraints(java.lang.Long ownerOMA,
java.util.List<Constraint> constraints)
ownerOMA - the owner's old memory addressconstraints - the object's constraintspublic java.util.List<Constraint> getConstraints(java.lang.Long ownerOMA)
ownerOMA - the constraints' owner OMApublic java.util.List<Constraint> getAllConstraints()
public void addAnimation(java.lang.Long ownerOMA,
Animation animation)
ownerOMA - the owner's old memory addressanimation - the animation for the feature specified by ownerOMApublic java.util.List<Animation> getAnimations(java.lang.Long ownerOMA)
ownerOMA - the old memory address of the animation data ownerpublic void setSkeleton(java.lang.Long skeletonOMA,
Skeleton skeleton)
skeletonOMA - the skeleton's old memory addressskeleton - the skeleton specified by the given OMApublic void setNodeForSkeleton(Skeleton skeleton, Node node)
skeleton - the skeletonnode - the armature nodepublic Node getControlledNode(Skeleton skeleton)
skeleton - the skeletonpublic Skeleton getSkeleton(java.lang.Long skeletonOMA)
skeletonOMA - the skeleton's old memory addresspublic void setBoneContext(java.lang.Long boneOMA,
BoneContext boneContext)
boneOMA - the bone's old memory addressboneContext - the bones's contextpublic BoneContext getBoneContext(java.lang.Long boneOMA)
boneOMA - the bone's old memory addresspublic BoneContext getBoneByName(java.lang.Long skeletonOMA, java.lang.String name)
skeletonOMA - the OMA of the skeleton where the bone will be searchedname - the name of the bonepublic BoneContext getBoneContext(Bone bone)
bone - the bonepublic Material getDefaultMaterial()
public void addMarker(java.lang.String marker,
java.lang.Object feature,
java.lang.Object markerValue)
marker - the marker namefeature - te scene's feature (can be node, material or texture or
anything else)markerValue - the marker valuepublic java.lang.Object getMarkerValue(java.lang.String marker,
java.lang.Object feature)
marker - the marker namefeature - the scene's featurepublic void addAction(BlenderAction action)
action - the action loaded from the blend filepublic java.util.Map<java.lang.String,BlenderAction> getActions()
public java.lang.String toString()
toString in class java.lang.Object