- fbx: add support for reading Null node attributes.
parent
4921114c7d
commit
eed3cebc18
|
@ -149,6 +149,9 @@ const Object* LazyObject::Get(bool dieOnError)
|
||||||
else if (!strcmp(classtag.c_str(),"Light")) {
|
else if (!strcmp(classtag.c_str(),"Light")) {
|
||||||
object.reset(new Light(id,element,doc,name));
|
object.reset(new Light(id,element,doc,name));
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(classtag.c_str(),"Null")) {
|
||||||
|
object.reset(new Null(id,element,doc,name));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!strncmp(obtype,"Deformer",length)) {
|
else if (!strncmp(obtype,"Deformer",length)) {
|
||||||
if (!strcmp(classtag.c_str(),"Cluster")) {
|
if (!strcmp(classtag.c_str(),"Cluster")) {
|
||||||
|
|
|
@ -261,6 +261,16 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** DOM base class for FBX null markers attached to a node */
|
||||||
|
class Null : public NodeAttribute
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
Null(uint64_t id, const Element& element, const Document& doc, const std::string& name);
|
||||||
|
~Null();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/** DOM base class for FBX lights attached to a node */
|
/** DOM base class for FBX lights attached to a node */
|
||||||
class Light : public NodeAttribute
|
class Light : public NodeAttribute
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,12 @@ NodeAttribute::NodeAttribute(uint64_t id, const Element& element, const Document
|
||||||
const Scope& sc = GetRequiredScope(element);
|
const Scope& sc = GetRequiredScope(element);
|
||||||
|
|
||||||
const std::string& classname = ParseTokenAsString(GetRequiredToken(element,2));
|
const std::string& classname = ParseTokenAsString(GetRequiredToken(element,2));
|
||||||
props = GetPropertyTable(doc,"NodeAttribute.Fbx" + classname,element,sc);
|
|
||||||
|
// hack on the deriving type but Null attributes are the only case in which
|
||||||
|
// the property table is by design absent and no warning should be generated
|
||||||
|
// for it.
|
||||||
|
const bool is_null = !strcmp(classname.c_str(), "Null");
|
||||||
|
props = GetPropertyTable(doc,"NodeAttribute.Fbx" + classname,element,sc, is_null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,6 +137,21 @@ Light::~Light()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Null::Null(uint64_t id, const Element& element, const Document& doc, const std::string& name)
|
||||||
|
: NodeAttribute(id,element,doc,name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Null::~Null()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue