C# Class FBX.SceneLoader.SceneLoader

This class is able to convert a FBX scene into a custom scene Load a scene like this: 1) Create an empty scene 2) Create the scene loader 3) Ask the loader to load a FBX scene providing: . The filename of the scene to load . A material map that is able to convert FBX materials into Cirrus render techniques that render these materials . A texture provider that loads textures for the scene materials Once the FBX scene is loaded, you can save the scene into a proprietary scene format and shouldn't need the FBX format anymore (i.e. FBX is only a DEBUG mode format that should NOT be used at runtime as proprietary scenes are much more lightweight).
_ ZUp fix from Max orientation is done in the RecurseProcessNode() method at root node level _ V coordinate complement to 1 is done in PrimitiveFeeder.GetField() method for the TEX_COORD2D case
Afficher le fichier Open project: Patapom/GodComplex

Protected Properties

Свойство Type Description
m_ConvertDiffuse TEXTURE_CONVERSION_TYPES
m_ConvertNormal TEXTURE_CONVERSION_TYPES
m_ConvertRegular TEXTURE_CONVERSION_TYPES
m_JPEGQuality int
m_Material2Parameters Scene.Materials.MaterialParameters>.Dictionary
m_MaterialsDatabase MaterialsDatabase
m_MinUVsCount int
m_NoTangentSpaceAction NO_TANGENT_SPACE_ACTION
m_ScaleFactor float
m_Scene FBX.Scene.Scene
m_TargetTexturesBaseDirectory System.IO.DirectoryInfo
m_TempMesh2FinalMesh Scene.Nodes.Mesh>.Dictionary
m_Textures List
m_bCompactIdenticalMeshes bool
m_bCompactUVs bool
m_bConsolidateMeshes bool
m_bConsolidateSplitByColor bool
m_bConsolidateSplitBySMG bool
m_bConsolidateSplitByUV bool
m_bExportAnimations bool
m_bGenerateBoundingBoxes bool
m_bGenerateMipMapsDiffuse bool
m_bGenerateMipMapsNormal bool
m_bGenerateMipMapsRegular bool
m_bGenerateTangentSpace bool
m_bGenerateTriangleStrips bool
m_bResetXForm bool
m_bStoreHDRVertexColors bool

Méthodes publiques

Méthode Description
Load ( FileInfo _FileName, FBX _Scene ) : void

Loads a FBX file into a temp scene representation (which may already contain meshes and materials, don't care)

Load ( FileInfo _FileName, FBX _Scene, float _ScaleFactor, MaterialsDatabase _Materials ) : void

Converts a FBX file into a temp scene representation (which may already contain meshes and materials, don't care)

SceneLoader ( ) : System

Méthodes protégées

Méthode Description
BuildConsolidatedMeshes ( ) : void

Optimizes the existing meshes and build the primitives necessary for runtime display This will attempt to compact identical meshes and also consolidate mesh primitives

CreateCamera ( FBXImporter _FBXCamera, Scene _Parent ) : Scene.Nodes.Camera

Creates a Cirrus camera node

CreateLight ( FBXImporter _FBXLight, Scene _Parent ) : Scene.Nodes.Light

Creates a Cirrus light node

CreateMesh ( FBXImporter _FBXMesh, Scene _Parent ) : Scene.Nodes.Mesh

Creates a Cirrus mesh node

CreateTextureParameter ( FBXImporter _Material, string _PropertyName, Scene _MaterialParameters, string _ParameterName ) : bool

Creates a texture parameter from a material property that contains a texture (e.g. DiffuseColor, SpecularColor, etc.)

CreateTextureParameter ( FBXImporter _Material, string _PropertyName, Scene _MaterialParameters, string _ParameterName, string _OpacityPropertyName ) : bool
PostProcessNodes ( Scene _Node ) : void

Post-processes nodes, attaches light and camera targets, that kind of stuff

ProcessMaterials ( FBXImporter _Materials ) : void

Attempts to map FBX materials to render techniques

RecurseProcessNode ( FBXImporter _FBXNode, Scene _ParentNode ) : void

Processes a FBX node and converts it into a Cirrus object

Method Details

BuildConsolidatedMeshes() protected méthode

Optimizes the existing meshes and build the primitives necessary for runtime display This will attempt to compact identical meshes and also consolidate mesh primitives
protected BuildConsolidatedMeshes ( ) : void
Résultat void

CreateCamera() protected méthode

Creates a Cirrus camera node
protected CreateCamera ( FBXImporter _FBXCamera, Scene _Parent ) : Scene.Nodes.Camera
_FBXCamera FBXImporter
_Parent Scene
Résultat Scene.Nodes.Camera

CreateLight() protected méthode

Creates a Cirrus light node
protected CreateLight ( FBXImporter _FBXLight, Scene _Parent ) : Scene.Nodes.Light
_FBXLight FBXImporter
_Parent Scene
Résultat Scene.Nodes.Light

CreateMesh() protected méthode

Creates a Cirrus mesh node
protected CreateMesh ( FBXImporter _FBXMesh, Scene _Parent ) : Scene.Nodes.Mesh
_FBXMesh FBXImporter
_Parent Scene
Résultat Scene.Nodes.Mesh

CreateTextureParameter() protected méthode

Creates a texture parameter from a material property that contains a texture (e.g. DiffuseColor, SpecularColor, etc.)
protected CreateTextureParameter ( FBXImporter _Material, string _PropertyName, Scene _MaterialParameters, string _ParameterName ) : bool
_Material FBXImporter
_PropertyName string
_MaterialParameters Scene
_ParameterName string
Résultat bool

CreateTextureParameter() protected méthode

protected CreateTextureParameter ( FBXImporter _Material, string _PropertyName, Scene _MaterialParameters, string _ParameterName, string _OpacityPropertyName ) : bool
_Material FBXImporter
_PropertyName string
_MaterialParameters Scene
_ParameterName string
_OpacityPropertyName string
Résultat bool

Load() public méthode

Loads a FBX file into a temp scene representation (which may already contain meshes and materials, don't care)
public Load ( FileInfo _FileName, FBX _Scene ) : void
_FileName System.IO.FileInfo The name of the FBX file to load
_Scene FBX The cirrus scene into which we should store the data
Résultat void

Load() public méthode

Converts a FBX file into a temp scene representation (which may already contain meshes and materials, don't care)
public Load ( FileInfo _FileName, FBX _Scene, float _ScaleFactor, MaterialsDatabase _Materials ) : void
_FileName System.IO.FileInfo The name of the FBX file to load
_Scene FBX The cirrus scene into which we should store the data
_ScaleFactor float The scale factor to apply to the entire scene /// By default, internal MAX units can be considered as centimeters so if you create a scene whose dimensions of a one meter box are 100x100x100, you /// will want to use a scale factor of 0.01. /// FBX offers the possibility of scaling but does a shitty job at it as it doesn't even rescale other dimensions like near/far clips or ranges for lights /// and camera, which plain sucks.
_Materials MaterialsDatabase An optional materials database containing informations about materials required by the scene
Résultat void

PostProcessNodes() protected méthode

Post-processes nodes, attaches light and camera targets, that kind of stuff
protected PostProcessNodes ( Scene _Node ) : void
_Node Scene
Résultat void

ProcessMaterials() protected méthode

Attempts to map FBX materials to render techniques
protected ProcessMaterials ( FBXImporter _Materials ) : void
_Materials FBXImporter The list of materials to process
Résultat void

RecurseProcessNode() protected méthode

Processes a FBX node and converts it into a Cirrus object
protected RecurseProcessNode ( FBXImporter _FBXNode, Scene _ParentNode ) : void
_FBXNode FBXImporter
_ParentNode Scene
Résultat void

SceneLoader() public méthode

public SceneLoader ( ) : System
Résultat System

Property Details

m_ConvertDiffuse protected_oe property

protected TEXTURE_CONVERSION_TYPES m_ConvertDiffuse
Résultat TEXTURE_CONVERSION_TYPES

m_ConvertNormal protected_oe property

protected TEXTURE_CONVERSION_TYPES m_ConvertNormal
Résultat TEXTURE_CONVERSION_TYPES

m_ConvertRegular protected_oe property

protected TEXTURE_CONVERSION_TYPES m_ConvertRegular
Résultat TEXTURE_CONVERSION_TYPES

m_JPEGQuality protected_oe property

protected int m_JPEGQuality
Résultat int

m_Material2Parameters protected_oe property

protected Dictionary m_Material2Parameters
Résultat Scene.Materials.MaterialParameters>.Dictionary

m_MaterialsDatabase protected_oe property

protected MaterialsDatabase,FBX.SceneLoader m_MaterialsDatabase
Résultat MaterialsDatabase

m_MinUVsCount protected_oe property

protected int m_MinUVsCount
Résultat int

m_NoTangentSpaceAction protected_oe property

protected NO_TANGENT_SPACE_ACTION m_NoTangentSpaceAction
Résultat NO_TANGENT_SPACE_ACTION

m_ScaleFactor protected_oe property

protected float m_ScaleFactor
Résultat float

m_Scene protected_oe property

protected FBX.Scene.Scene m_Scene
Résultat FBX.Scene.Scene

m_TargetTexturesBaseDirectory protected_oe property

protected DirectoryInfo,System.IO m_TargetTexturesBaseDirectory
Résultat System.IO.DirectoryInfo

m_TempMesh2FinalMesh protected_oe property

protected Dictionary m_TempMesh2FinalMesh
Résultat Scene.Nodes.Mesh>.Dictionary

m_Textures protected_oe property

protected List m_Textures
Résultat List

m_bCompactIdenticalMeshes protected_oe property

protected bool m_bCompactIdenticalMeshes
Résultat bool

m_bCompactUVs protected_oe property

protected bool m_bCompactUVs
Résultat bool

m_bConsolidateMeshes protected_oe property

protected bool m_bConsolidateMeshes
Résultat bool

m_bConsolidateSplitByColor protected_oe property

protected bool m_bConsolidateSplitByColor
Résultat bool

m_bConsolidateSplitBySMG protected_oe property

protected bool m_bConsolidateSplitBySMG
Résultat bool

m_bConsolidateSplitByUV protected_oe property

protected bool m_bConsolidateSplitByUV
Résultat bool

m_bExportAnimations protected_oe property

protected bool m_bExportAnimations
Résultat bool

m_bGenerateBoundingBoxes protected_oe property

protected bool m_bGenerateBoundingBoxes
Résultat bool

m_bGenerateMipMapsDiffuse protected_oe property

protected bool m_bGenerateMipMapsDiffuse
Résultat bool

m_bGenerateMipMapsNormal protected_oe property

protected bool m_bGenerateMipMapsNormal
Résultat bool

m_bGenerateMipMapsRegular protected_oe property

protected bool m_bGenerateMipMapsRegular
Résultat bool

m_bGenerateTangentSpace protected_oe property

protected bool m_bGenerateTangentSpace
Résultat bool

m_bGenerateTriangleStrips protected_oe property

protected bool m_bGenerateTriangleStrips
Résultat bool

m_bResetXForm protected_oe property

protected bool m_bResetXForm
Résultat bool

m_bStoreHDRVertexColors protected_oe property

protected bool m_bStoreHDRVertexColors
Résultat bool