It most certainly looks to me to be a nightmare so far.
Ill take any help i can get on it.
So far i have basically just figured out the node element data structure of the ascii and have it loading up the text into separated string parts. I have a general grasp on how to parse most of the data vertices indices uv ectā¦ there are special rules for much of it that one would think should be simple but its been complicated.
Though not sure about how to parse the blendweights which is really important.
I havenāt yet figured what to do with most of it after that or out how to link that data or how to decode much of it at all like the transform properties.
I canāt see how the animation bones or bone transformations are intended to link together.
If you have had any success with decoding the keyframes in the ascii or any insights on how that data is structured i would be much appreciative for any information that might help.
Whatever work i do on this if it amounts to anything will be shared and probably at the least posted i just started on this a couple days ago though.
Here are my preliminary notes.
/// <summary>
/// Specification Details for loading.
///
/// We denote the data block identifiers as [markers]
/// So as to avoid confusion between elements or nodes, which have not yet been determined till the text is processed.
///
/// These so called markers as i have named them ... denote nodes or elements which can contain
/// Other nodes or element data that is not in a child node but a child element of that node or at the node level.
///
/// FBXHeaderExtension: { // node // this is the [markers name] (FBXHeaderExtension) but the [markers type] (node) must be determined when the text is processed.
/// FBXHeaderVersion: 1003 // element (the value here 1003 is the [markerData] or marker type data of the data type element named (FBXHeaderVersion:)
/// FBXVersion: 6100
///
/// My method indexing routines ... neseccary as this whole thing is composed in such a odd format ill keep things as defined as i can.
///
/// Most of my methods will be using positional looping instead of index and length.
/// Index parameter and variable prefixing will be denoted by from and to ... from 0 to 10 denotes indexs 0 thru 10
/// start and end will be used to specify indexing before the end location. start 0 end 10 denotes indexs 0 thru 9
///
///
/// Identifying and catagorizing the text structure seen in the ascii fbx.
///
/// Important characters.
///
/// { } : are extremely important for processing the ascii text data be aware :: double colons are used though in variables as part of litteral name identifiers.
/// ; are comment areas in the fbx and are ignored till the next line return which may also then start with a comment.
/// "" are used to identify a string Type variable a element might be empty in this case i believe it is in most cases a empty string type.
///
/// Organizational structure.
///
/// Properties are a big part of the fbx data they appear to have a well defined structural order.
///
/// The data here appears to define A "VariableName", "TheDataType", "a unknown type modifier" , the comma spaced [data] the Types actual data
/// below we can see a new Color(.8f,.8f,.8f, 1f); though im unclear on the alpha value here.
///
/// NodeUnDefined Properties60: Depth(3) parent Model: children[0] elements [71] // this node defines the properties60 this appears to act to indicate a processing data handling routine.
/// Property: "Color", "ColorRGB", "",0.8,0.8,0.8
/// Property: "Color", "Color", "A",0.8,0.8,0.8
///
/// Here are some ascii text and comments denoting how to look at this structure when procesing it.
///
/// Definitions: // marker name they type of the marker will need to be determined.
/// { // this bracket determines that the marker is a node type not a element thus Definitions: is a marker till it is determined to be a node or element.
/// Version: 100 // element
/// Count: 18 // finding another colon indicates that the last item is a element not a node
///
/// ObjectType: // marker name it will be a node.
/// "Model" // marker this nodes specific identifying data or modifying data.
/// { // this acts as a processing terminator for a marker to be identifyed it determines that the marker is a node type.
///
/// // This following is a marker element we know this because a ending bracket will be found immediately after.
/// // A colon after it would also indicate it was a element.
/// // note properties are basically a type of element.
/// Count: // the colon is a key char for processing;
/// 12 // this is element data.
///
/// // a ending bracket in this case means that the element and the node must end here.
/// // the bracket defines a previous element ends here, in this case as well it denotes the elements node must return also.
/// }
/// ObjectType: "Geometry" // this node type specifys marker data i think this is for linking.
/// { // the bracket denotes the ObjectType is a node as well as the end of the marker data search
/// } // the end bracket denotes the return of the node if there had been a element it denotes the end of the element
/// }
///
/// Terminating markers of type element is determined by the method.
///
/// Count: // the colon is a marker key char
/// 12 // this is element data.
/// // a ending bracket in this case means that the element and the node must end here.
/// } // the bracket defines a element end in this case as well as denotes the node return
///
///
/// Marker and marker name distinctions of importance to note.
///
/// Elements are just a variable name: followed by data the type is determined unless we code instructions individually to handle them.
/// I will and have started to plan for that already but by default they must be handled in a generic manner.
///
/// Quotations indicate a string in this case the string may act as a data type such as for culling on as a enum.
/// Or it appears they may be used to link node types together as name identifiers.
///
/// Culling: "CullingOff"
/// Version: 101
/// Name: "Model::Camera Switcher" /// (be aware handle :: seperately when processing text). this appears to act as a string identifier for linking not the double colons
/// CameraIndexName: // it is possible to have empty strings which a empty spot should indicate as a string i believe.
/// // if not this whole processing thing could get very specific vert fast.
/// Vertices: 0.000000,0.000000,-5.895833,0.350694,0.000000,-5.845238, ... ect...
/// // elements may also have a stream of data this is just made to happen with commas. this actually makes them a lot like properties but the data can be variably continuous.
/// // this is somewhat annoying as i would need a list to store this and probably need to handle each type name as if it were a datatype so individually.
/// // however in this case some of these elements will need very specific handling such as the model data.
///
///
/// The most important node is surely the Objects node.
///
///It contains the vertices of our models, the indices, the normals, the UV coordinates, and the materials.Itās structured like this:
///1
///2
///3
///4
///5
///6
///7
///8
///9
///10
///11
///
///Objects: { //---- beginning of node Objects
///
/// Model: āmodel nameā, āMeshā //---- beginning of node of the model
/// {
///
/// [ā¦]
/// Vertices: [ā¦] //---- vertices
/// PolygonVertexIndex: [ā¦] //---- indices
/// LayerElementNormal: { } //---- node of the normals
/// LayerElementUV: { } //---- node of the UV coords
/// } //---- end of node of the model
/// Material: āmaterial nameā, āā { } //---- node of the material
/// [ā¦]
/// } //---- end of node Objects
///
///
/// from here basically im looking to decode the data after parsing it to c# data types.
/// following the instructions here and on other sites ...
/// https://banexdevblog.wordpress.com/2014/06/23/a-quick-tutorial-about-the-fbx-ascii-format/
/// Im still gathering information though.
/// Much of the degree of success or failure will rely on having all the decoding and linking knowlege i can get on the fbx 6.1 ascii file.
///
/// </summary>
My actual project is more a bunch of messy comments then code when i can actually load in all the text variables to actual c# data types ill post it up.
If there is anyone who would like to help out with decoding the data.
Preliminary text to nodes loading attempt seems to work so far the data isnt parsed yet just separated into a tree and element structure. This is truncatedā¦
Begin Output Display.
RootNode ThisModelFile: Depth(0) parent ThisModelFile: children[7] elements [2]
ElementUnDefined CreationTime: Depth(0) |"2019-02-16 07:43:02:000"|
ElementUnDefined Creator: Depth(0) |"Blender version 2.79 (sub 0)" D|
Node FBXHeaderExtension: Depth(1) parent ThisModelFile: children[2] elements [3]
ElementUnDefined FBXHeaderVersion: Depth(1) |1003|
Element FBXVersion: Depth(1) |6100|
ElementUnDefined Creator: Depth(1) |"FBX SDK/FBX Plugins build 20070228"|
NodeUnDefined CreationTimeStamp: Depth(2) parent FBXHeaderExtension: children[0] elements [8]
Element Version: Depth(2) |1000|
ElementUnDefined Year: Depth(2) |2019|
ElementUnDefined Month: Depth(2) |02|
ElementUnDefined Day: Depth(2) |16|
ElementUnDefined Hour: Depth(2) |07|
ElementUnDefined Minute: Depth(2) |43|
ElementUnDefined Second: Depth(2) |02|
ElementUnDefined Millisecond: Depth(2) |0|
Node OtherFlags: Depth(2) parent FBXHeaderExtension: children[0] elements [1]
ElementUnDefined FlagPLE: Depth(2) |0|
Node Definitions: Depth(1) parent ThisModelFile: children[8] elements [2]
Element Version: Depth(1) |100|
ElementUnDefined Count: Depth(1) |18|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"Model"|
ElementUnDefined Count: Depth(2) |12|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"Geometry"|
ElementUnDefined Count: Depth(2) |1|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"Material"|
ElementUnDefined Count: Depth(2) |1|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"Texture"|
ElementUnDefined Count: Depth(2) |1|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"Video"|
ElementUnDefined Count: Depth(2) |1|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"Deformer"|
ElementUnDefined Count: Depth(2) |3|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"Pose"|
ElementUnDefined Count: Depth(2) |1|
NodeUnDefined ObjectType: Depth(2) parent Definitions: children[0] elements [1]
|"GlobalSettings"|
ElementUnDefined Count: Depth(2) |1|
Node Objects: Depth(1) parent ThisModelFile: children[20] elements [0]
Node Model: Depth(2) parent Objects: children[1] elements [11]
|"Model::Camera Switcher", "CameraSwitcher"|
Element Version: Depth(2) |232|
ElementUnDefined MultiLayer: Depth(2) |0|
ElementUnDefined MultiTake: Depth(2) |1|
ElementUnDefined Hidden: Depth(2) |"True"|
ElementUnDefined Shading: Depth(2) |W|
ElementUnDefined Culling: Depth(2) |"CullingOff"|
Element Version: Depth(2) |101|
Element Name: Depth(2) |"Model::Camera Switcher"|
ElementUnDefined CameraId: Depth(2) |0|
ElementUnDefined CameraName: Depth(2) |100|
ElementUnDefined CameraIndexName: Depth(2)
NodeUnDefined Properties60: Depth(3) parent Model: children[0] elements [70]
ElementUnDefined Property: Depth(3) |"QuaternionInterpolate", "bool", "",0|
ElementUnDefined Property: Depth(3) |"Visibility", "Visibility", "A+",1|
ElementUnDefined Property: Depth(3) |"Lcl Translation", "Lcl Translation", "A+",0.000000000000000,0.000000000000000,0.000000000000000|
ElementUnDefined Property: Depth(3) |"Lcl Rotation", "Lcl Rotation", "A+",0.000000000000000,0.000000000000000,0.000000000000000|
ElementUnDefined Property: Depth(3) |"Lcl Scaling", "Lcl Scaling", "A+",1.000000000000000,1.000000000000000,1.000000000000000|
ElementUnDefined Property: Depth(3) |"RotationOffset", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"RotationPivot", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"ScalingOffset", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"ScalingPivot", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"TranslationActive", "bool", "",0|
ElementUnDefined Property: Depth(3) |"TranslationMin", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"TranslationMax", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"TranslationMinX", "bool", "",0|
ElementUnDefined Property: Depth(3) |"TranslationMinY", "bool", "",0|
ElementUnDefined Property: Depth(3) |"TranslationMinZ", "bool", "",0|
ElementUnDefined Property: Depth(3) |"TranslationMaxX", "bool", "",0|
ElementUnDefined Property: Depth(3) |"TranslationMaxY", "bool", "",0|
ElementUnDefined Property: Depth(3) |"TranslationMaxZ", "bool", "",0|
ElementUnDefined Property: Depth(3) |"RotationOrder", "enum", "",0|
ElementUnDefined Property: Depth(3) |"RotationSpaceForLimitOnly", "bool", "",0|
ElementUnDefined Property: Depth(3) |"AxisLen", "double", "",10|
ElementUnDefined Property: Depth(3) |"PreRotation", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"PostRotation", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"RotationActive", "bool", "",0|
ElementUnDefined Property: Depth(3) |"RotationMin", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"RotationMax", "Vector3D", "",0,0,0|
ElementUnDefined Property: Depth(3) |"RotationMinX", "bool", "",0|
ElementUnDefined Property: Depth(3) |"RotationMinY", "bool", "",0|
ElementUnDefined Property: Depth(3) |"RotationMinZ", "bool", "",0|
ElementUnDefined Property: Depth(3) |"RotationMaxX", "bool", "",0|
Depending on how successful i am if i can get enough data to load. Then from there i could just put it into a nice model structure and turn it into a xnb or directly spit it out as xml. I could also then take a shot at the binary.
If its just successful enough i could additionally make some modeling tools to go with it to manually rig whatever i cant read in right.
Im really doubtful ill be able to read in all the transforms right and maybe i wont need i to dunno yet. Id be happy if i can get the basics + the blend weights and bones loaded in well enough this model im using here has rigging but no actual animations to look at.
This is probably beyond me but im not stumped yet so.