|
@@ -130,7 +130,7 @@ private:
|
|
};
|
|
};
|
|
|
|
|
|
/** Base class for in-memory (DOM) representations of FBX objects */
|
|
/** Base class for in-memory (DOM) representations of FBX objects */
|
|
-class Object {
|
|
|
|
|
|
+class Object : public PropertyTable {
|
|
public:
|
|
public:
|
|
Object(uint64_t id, const ElementPtr element, const std::string &name);
|
|
Object(uint64_t id, const ElementPtr element, const std::string &name);
|
|
|
|
|
|
@@ -149,9 +149,9 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
protected:
|
|
protected:
|
|
- const ElementPtr element;
|
|
|
|
|
|
+ const ElementPtr element = nullptr;
|
|
const std::string name;
|
|
const std::string name;
|
|
- const uint64_t id = 0;
|
|
|
|
|
|
+ const uint64_t id;
|
|
};
|
|
};
|
|
|
|
|
|
/** DOM class for generic FBX NoteAttribute blocks. NoteAttribute's just hold a property table,
|
|
/** DOM class for generic FBX NoteAttribute blocks. NoteAttribute's just hold a property table,
|
|
@@ -159,22 +159,13 @@ protected:
|
|
class NodeAttribute : public Object {
|
|
class NodeAttribute : public Object {
|
|
public:
|
|
public:
|
|
NodeAttribute(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
NodeAttribute(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
-
|
|
|
|
virtual ~NodeAttribute();
|
|
virtual ~NodeAttribute();
|
|
-
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-private:
|
|
|
|
- const PropertyTable *props;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
/** DOM base class for FBX camera settings attached to a node */
|
|
/** DOM base class for FBX camera settings attached to a node */
|
|
class CameraSwitcher : public NodeAttribute {
|
|
class CameraSwitcher : public NodeAttribute {
|
|
public:
|
|
public:
|
|
CameraSwitcher(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
CameraSwitcher(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
-
|
|
|
|
virtual ~CameraSwitcher();
|
|
virtual ~CameraSwitcher();
|
|
|
|
|
|
int CameraID() const {
|
|
int CameraID() const {
|
|
@@ -190,26 +181,26 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
private:
|
|
private:
|
|
- int cameraId;
|
|
|
|
|
|
+ int cameraId = 0;
|
|
std::string cameraName;
|
|
std::string cameraName;
|
|
std::string cameraIndexName;
|
|
std::string cameraIndexName;
|
|
};
|
|
};
|
|
|
|
|
|
#define fbx_stringize(a) #a
|
|
#define fbx_stringize(a) #a
|
|
|
|
|
|
-#define fbx_simple_property(name, type, default_value) \
|
|
|
|
- type name() const { \
|
|
|
|
- return PropertyGet<type>(Props(), fbx_stringize(name), (default_value)); \
|
|
|
|
|
|
+#define fbx_simple_property(name, type, default_value) \
|
|
|
|
+ type name() const { \
|
|
|
|
+ return PropertyGet<type>(this, fbx_stringize(name), (default_value)); \
|
|
}
|
|
}
|
|
|
|
|
|
// XXX improve logging
|
|
// XXX improve logging
|
|
-#define fbx_simple_enum_property(name, type, default_value) \
|
|
|
|
- type name() const { \
|
|
|
|
- const int ival = PropertyGet<int>(Props(), fbx_stringize(name), static_cast<int>(default_value)); \
|
|
|
|
- if (ival < 0 || ival >= AI_CONCAT(type, _MAX)) { \
|
|
|
|
- return static_cast<type>(default_value); \
|
|
|
|
- } \
|
|
|
|
- return static_cast<type>(ival); \
|
|
|
|
|
|
+#define fbx_simple_enum_property(name, type, default_value) \
|
|
|
|
+ type name() const { \
|
|
|
|
+ const int ival = PropertyGet<int>(this, fbx_stringize(name), static_cast<int>(default_value)); \
|
|
|
|
+ if (ival < 0 || ival >= AI_CONCAT(type, _MAX)) { \
|
|
|
|
+ return static_cast<type>(default_value); \
|
|
|
|
+ } \
|
|
|
|
+ return static_cast<type>(ival); \
|
|
}
|
|
}
|
|
|
|
|
|
class FbxPoseNode;
|
|
class FbxPoseNode;
|
|
@@ -256,7 +247,7 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
private:
|
|
private:
|
|
- uint64_t target_id;
|
|
|
|
|
|
+ uint64_t target_id = 0;
|
|
Transform transform;
|
|
Transform transform;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -264,7 +255,6 @@ private:
|
|
class Camera : public NodeAttribute {
|
|
class Camera : public NodeAttribute {
|
|
public:
|
|
public:
|
|
Camera(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
Camera(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
-
|
|
|
|
virtual ~Camera();
|
|
virtual ~Camera();
|
|
|
|
|
|
fbx_simple_property(Position, Vector3, Vector3(0, 0, 0));
|
|
fbx_simple_property(Position, Vector3, Vector3(0, 0, 0));
|
|
@@ -380,7 +370,6 @@ public:
|
|
};
|
|
};
|
|
|
|
|
|
Model(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
Model(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
-
|
|
|
|
virtual ~Model();
|
|
virtual ~Model();
|
|
|
|
|
|
fbx_simple_property(QuaternionInterpolate, int, 0);
|
|
fbx_simple_property(QuaternionInterpolate, int, 0);
|
|
@@ -466,10 +455,6 @@ public:
|
|
return culling;
|
|
return culling;
|
|
}
|
|
}
|
|
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/** Get material links */
|
|
/** Get material links */
|
|
const std::vector<const Material *> &GetMaterials() const {
|
|
const std::vector<const Material *> &GetMaterials() const {
|
|
return materials;
|
|
return materials;
|
|
@@ -498,13 +483,11 @@ private:
|
|
|
|
|
|
std::string shading;
|
|
std::string shading;
|
|
std::string culling;
|
|
std::string culling;
|
|
- const PropertyTable *props = nullptr;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
class ModelLimbNode : public Model {
|
|
class ModelLimbNode : public Model {
|
|
public:
|
|
public:
|
|
ModelLimbNode(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
ModelLimbNode(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
-
|
|
|
|
virtual ~ModelLimbNode();
|
|
virtual ~ModelLimbNode();
|
|
};
|
|
};
|
|
|
|
|
|
@@ -512,7 +495,6 @@ public:
|
|
class Texture : public Object {
|
|
class Texture : public Object {
|
|
public:
|
|
public:
|
|
Texture(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
Texture(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
-
|
|
|
|
virtual ~Texture();
|
|
virtual ~Texture();
|
|
|
|
|
|
const std::string &Type() const {
|
|
const std::string &Type() const {
|
|
@@ -539,10 +521,6 @@ public:
|
|
return uvScaling;
|
|
return uvScaling;
|
|
}
|
|
}
|
|
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// return a 4-tuple
|
|
// return a 4-tuple
|
|
const unsigned int *Crop() const {
|
|
const unsigned int *Crop() const {
|
|
return crop;
|
|
return crop;
|
|
@@ -560,10 +538,8 @@ private:
|
|
std::string relativeFileName;
|
|
std::string relativeFileName;
|
|
std::string fileName;
|
|
std::string fileName;
|
|
std::string alphaSource;
|
|
std::string alphaSource;
|
|
- const PropertyTable *props = nullptr;
|
|
|
|
|
|
|
|
unsigned int crop[4] = { 0 };
|
|
unsigned int crop[4] = { 0 };
|
|
-
|
|
|
|
const Video *media = nullptr;
|
|
const Video *media = nullptr;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -626,8 +602,8 @@ public:
|
|
|
|
|
|
private:
|
|
private:
|
|
std::vector<const Texture *> textures;
|
|
std::vector<const Texture *> textures;
|
|
- BlendMode blendMode;
|
|
|
|
- float alpha;
|
|
|
|
|
|
+ BlendMode blendMode = BlendMode::BlendMode_Additive;
|
|
|
|
+ float alpha = 0;
|
|
};
|
|
};
|
|
|
|
|
|
typedef std::map<std::string, const Texture *> TextureMap;
|
|
typedef std::map<std::string, const Texture *> TextureMap;
|
|
@@ -656,10 +632,6 @@ public:
|
|
return relativeFileName;
|
|
return relativeFileName;
|
|
}
|
|
}
|
|
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
const uint8_t *Content() const {
|
|
const uint8_t *Content() const {
|
|
return content;
|
|
return content;
|
|
}
|
|
}
|
|
@@ -687,7 +659,6 @@ private:
|
|
std::string type;
|
|
std::string type;
|
|
std::string relativeFileName;
|
|
std::string relativeFileName;
|
|
std::string fileName;
|
|
std::string fileName;
|
|
- const PropertyTable *props = nullptr;
|
|
|
|
|
|
|
|
uint64_t contentLength = 0;
|
|
uint64_t contentLength = 0;
|
|
uint8_t *content = nullptr;
|
|
uint8_t *content = nullptr;
|
|
@@ -708,10 +679,6 @@ public:
|
|
return multilayer;
|
|
return multilayer;
|
|
}
|
|
}
|
|
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
const TextureMap &Textures() const {
|
|
const TextureMap &Textures() const {
|
|
return textures;
|
|
return textures;
|
|
}
|
|
}
|
|
@@ -722,8 +689,7 @@ public:
|
|
|
|
|
|
private:
|
|
private:
|
|
std::string shading;
|
|
std::string shading;
|
|
- bool multilayer;
|
|
|
|
- const PropertyTable *props;
|
|
|
|
|
|
+ bool multilayer = false;
|
|
|
|
|
|
TextureMap textures;
|
|
TextureMap textures;
|
|
LayeredTextureMap layeredTextures;
|
|
LayeredTextureMap layeredTextures;
|
|
@@ -791,10 +757,6 @@ public:
|
|
|
|
|
|
virtual ~AnimationCurveNode();
|
|
virtual ~AnimationCurveNode();
|
|
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
const AnimationMap &Curves() const;
|
|
const AnimationMap &Curves() const;
|
|
|
|
|
|
/** Object the curve is assigned to, this can be NULL if the
|
|
/** Object the curve is assigned to, this can be NULL if the
|
|
@@ -819,7 +781,6 @@ public:
|
|
|
|
|
|
private:
|
|
private:
|
|
Object *target = nullptr;
|
|
Object *target = nullptr;
|
|
- const PropertyTable *props;
|
|
|
|
mutable AnimationMap curves;
|
|
mutable AnimationMap curves;
|
|
std::string prop;
|
|
std::string prop;
|
|
const Document &doc;
|
|
const Document &doc;
|
|
@@ -837,18 +798,12 @@ public:
|
|
AnimationLayer(uint64_t id, const ElementPtr element, const std::string &name, const Document &doc);
|
|
AnimationLayer(uint64_t id, const ElementPtr element, const std::string &name, const Document &doc);
|
|
virtual ~AnimationLayer();
|
|
virtual ~AnimationLayer();
|
|
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- //ai_assert(props.get());
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/* the optional white list specifies a list of property names for which the caller
|
|
/* the optional white list specifies a list of property names for which the caller
|
|
wants animations for. Curves not matching this list will not be added to the
|
|
wants animations for. Curves not matching this list will not be added to the
|
|
animation layer. */
|
|
animation layer. */
|
|
const AnimationCurveNodeList Nodes(const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0) const;
|
|
const AnimationCurveNodeList Nodes(const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0) const;
|
|
|
|
|
|
private:
|
|
private:
|
|
- const PropertyTable *props;
|
|
|
|
const Document &doc;
|
|
const Document &doc;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -863,16 +818,11 @@ public:
|
|
fbx_simple_property(ReferenceStart, int64_t, 0L);
|
|
fbx_simple_property(ReferenceStart, int64_t, 0L);
|
|
fbx_simple_property(ReferenceStop, int64_t, 0L);
|
|
fbx_simple_property(ReferenceStop, int64_t, 0L);
|
|
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
const AnimationLayerList &Layers() const {
|
|
const AnimationLayerList &Layers() const {
|
|
return layers;
|
|
return layers;
|
|
}
|
|
}
|
|
|
|
|
|
private:
|
|
private:
|
|
- const PropertyTable *props = nullptr;
|
|
|
|
AnimationLayerList layers;
|
|
AnimationLayerList layers;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -881,14 +831,6 @@ class Deformer : public Object {
|
|
public:
|
|
public:
|
|
Deformer(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
Deformer(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
virtual ~Deformer();
|
|
virtual ~Deformer();
|
|
-
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- //ai_assert(props.get());
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-private:
|
|
|
|
- const PropertyTable *props;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
/** Constraints are from Maya they can help us with BoneAttachments :) **/
|
|
/** Constraints are from Maya they can help us with BoneAttachments :) **/
|
|
@@ -896,9 +838,6 @@ class Constraint : public Object {
|
|
public:
|
|
public:
|
|
Constraint(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
Constraint(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name);
|
|
virtual ~Constraint();
|
|
virtual ~Constraint();
|
|
-
|
|
|
|
-private:
|
|
|
|
- const PropertyTable *props;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
typedef std::vector<float> WeightArray;
|
|
typedef std::vector<float> WeightArray;
|
|
@@ -924,7 +863,7 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
private:
|
|
private:
|
|
- float percent;
|
|
|
|
|
|
+ float percent = 0;
|
|
WeightArray fullWeights;
|
|
WeightArray fullWeights;
|
|
std::vector<const ShapeGeometry *> shapeGeometries;
|
|
std::vector<const ShapeGeometry *> shapeGeometries;
|
|
};
|
|
};
|
|
@@ -1006,7 +945,7 @@ private:
|
|
Transform transformLink;
|
|
Transform transformLink;
|
|
Transform transformAssociateModel;
|
|
Transform transformAssociateModel;
|
|
SkinLinkMode link_mode;
|
|
SkinLinkMode link_mode;
|
|
- bool valid_transformAssociateModel;
|
|
|
|
|
|
+ bool valid_transformAssociateModel = false;
|
|
const Model *node = nullptr;
|
|
const Model *node = nullptr;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1037,8 +976,8 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
private:
|
|
private:
|
|
- float accuracy;
|
|
|
|
- SkinType skinType;
|
|
|
|
|
|
+ float accuracy = 0;
|
|
|
|
+ SkinType skinType = SkinType::Skin_Linear;
|
|
std::vector<const Cluster *> clusters;
|
|
std::vector<const Cluster *> clusters;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1087,10 +1026,10 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
public:
|
|
public:
|
|
- uint64_t insertionOrder;
|
|
|
|
|
|
+ uint64_t insertionOrder = 0;
|
|
const std::string prop;
|
|
const std::string prop;
|
|
|
|
|
|
- uint64_t src, dest;
|
|
|
|
|
|
+ uint64_t src = 0, dest = 0;
|
|
const Document &doc;
|
|
const Document &doc;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1105,15 +1044,10 @@ typedef std::multimap<uint64_t, const Connection *> ConnectionMap;
|
|
|
|
|
|
/** DOM class for global document settings, a single instance per document can
|
|
/** DOM class for global document settings, a single instance per document can
|
|
* be accessed via Document.Globals(). */
|
|
* be accessed via Document.Globals(). */
|
|
-class FileGlobalSettings {
|
|
|
|
|
|
+class FileGlobalSettings : public PropertyTable {
|
|
public:
|
|
public:
|
|
- FileGlobalSettings(const Document &doc, const PropertyTable *props);
|
|
|
|
-
|
|
|
|
- ~FileGlobalSettings();
|
|
|
|
-
|
|
|
|
- const PropertyTable *Props() const {
|
|
|
|
- return props;
|
|
|
|
- }
|
|
|
|
|
|
+ FileGlobalSettings(const Document &doc);
|
|
|
|
+ virtual ~FileGlobalSettings();
|
|
|
|
|
|
const Document &GetDocument() const {
|
|
const Document &GetDocument() const {
|
|
return doc;
|
|
return doc;
|
|
@@ -1158,7 +1092,6 @@ public:
|
|
fbx_simple_property(CustomFrameRate, float, -1.0f);
|
|
fbx_simple_property(CustomFrameRate, float, -1.0f);
|
|
|
|
|
|
private:
|
|
private:
|
|
- const PropertyTable *props = nullptr;
|
|
|
|
const Document &doc;
|
|
const Document &doc;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1196,7 +1129,7 @@ public:
|
|
return globals.get();
|
|
return globals.get();
|
|
}
|
|
}
|
|
|
|
|
|
- const PropertyTable *GetMetadataProperties() const {
|
|
|
|
|
|
+ const PropertyTable &GetMetadataProperties() const {
|
|
return metadata_properties;
|
|
return metadata_properties;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1293,7 +1226,7 @@ private:
|
|
std::vector<uint64_t> materials;
|
|
std::vector<uint64_t> materials;
|
|
std::vector<uint64_t> skins;
|
|
std::vector<uint64_t> skins;
|
|
mutable std::vector<const AnimationStack *> animationStacksResolved;
|
|
mutable std::vector<const AnimationStack *> animationStacksResolved;
|
|
- PropertyTable *metadata_properties = nullptr;
|
|
|
|
|
|
+ PropertyTable metadata_properties;
|
|
std::shared_ptr<FileGlobalSettings> globals = nullptr;
|
|
std::shared_ptr<FileGlobalSettings> globals = nullptr;
|
|
};
|
|
};
|
|
} // namespace FBXDocParser
|
|
} // namespace FBXDocParser
|