mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:24:07 +02:00
Actually, don't support 3d vectors for Maya uv scale/offset
This commit is contained in:
parent
f02d6433e3
commit
df17614fc3
1 changed files with 17 additions and 31 deletions
|
@ -977,6 +977,8 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr
|
|||
static const QVariant MAYA_USE_AO_MAP = QByteArray("Maya|use_ao_map");
|
||||
static const QVariant MAYA_UV_SCALE = QByteArray("Maya|uv_scale");
|
||||
static const QVariant MAYA_UV_OFFSET = QByteArray("Maya|uv_offset");
|
||||
static const int MAYA_UV_OFFSET_PROPERTY_LENGTH = 6;
|
||||
static const int MAYA_UV_SCALE_PROPERTY_LENGTH = 6;
|
||||
|
||||
|
||||
|
||||
|
@ -1066,42 +1068,26 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr
|
|||
material.useOcclusionMap = (bool)property.properties.at(index).value<double>();
|
||||
|
||||
} else if (property.properties.at(0) == MAYA_UV_SCALE) {
|
||||
static const int MAYA_UV_SCALE_PROPERTY_LENGTH_2D = 6;
|
||||
static const int MAYA_UV_SCALE_PROPERTY_LENGTH_3D = 7;
|
||||
glm::vec3 scale;
|
||||
if (property.properties.size() == MAYA_UV_SCALE_PROPERTY_LENGTH_2D) { // Vector2D
|
||||
if (property.properties.size() == MAYA_UV_SCALE_PROPERTY_LENGTH) {
|
||||
// properties: { "Maya|uv_scale", "Vector2D", "Vector2", nothing, double, double }
|
||||
scale = glm::vec3(property.properties.at(4).value<double>(), property.properties.at(5).value<double>(), 1.0);
|
||||
} else if (property.properties.size() == MAYA_UV_SCALE_PROPERTY_LENGTH_3D) { // Vector (3d)
|
||||
// properties: { "Maya|uv_scale", "Vector3D", "Vector", nothing, double, double, double }
|
||||
// (in principle, given how Vector3D is used for other Maya properties in the same area)
|
||||
scale = glm::vec3(property.properties.at(4).value<double>(), property.properties.at(5).value<double>(), property.properties.at(6).value<double>());
|
||||
} else {
|
||||
scale = glm::vec3(1.0, 1.0, 1.0);
|
||||
glm::vec3 scale = glm::vec3(property.properties.at(4).value<double>(), property.properties.at(5).value<double>(), 1.0);
|
||||
if (scale.x == 0.0f) {
|
||||
scale.x = 1.0f;
|
||||
}
|
||||
if (scale.y == 0.0f) {
|
||||
scale.y = 1.0f;
|
||||
}
|
||||
if (scale.z == 0.0f) {
|
||||
scale.z = 1.0f;
|
||||
}
|
||||
materialParam.scaling *= scale;
|
||||
}
|
||||
if (scale.x == 0.0f) {
|
||||
scale.x = 1.0f;
|
||||
}
|
||||
if (scale.y == 0.0f) {
|
||||
scale.y = 1.0f;
|
||||
}
|
||||
if (scale.z == 0.0f) {
|
||||
scale.z = 1.0f;
|
||||
}
|
||||
materialParam.scaling *= scale;
|
||||
} else if (property.properties.at(0) == MAYA_UV_OFFSET) {
|
||||
static const int MAYA_UV_OFFSET_PROPERTY_LENGTH_2D = 6;
|
||||
static const int MAYA_UV_OFFSET_PROPERTY_LENGTH_3D = 7;
|
||||
glm::vec3 translation;
|
||||
if (property.properties.size() == MAYA_UV_OFFSET_PROPERTY_LENGTH_2D) { // Vector2
|
||||
if (property.properties.size() == MAYA_UV_OFFSET_PROPERTY_LENGTH) {
|
||||
// properties: { "Maya|uv_offset", "Vector2D", "Vector2", nothing, double, double }
|
||||
translation = glm::vec3(property.properties.at(4).value<double>(), property.properties.at(5).value<double>(), 1.0);
|
||||
} else if (property.properties.size() == MAYA_UV_OFFSET_PROPERTY_LENGTH_3D) { // Vector (3d)
|
||||
// properties: { "Maya|uv_offset", "Vector3D", "Vector", nothing, double, double, double }
|
||||
// (in principle, given how Vector3D is used for other Maya properties in the same area)
|
||||
translation = glm::vec3(property.properties.at(4).value<double>(), property.properties.at(5).value<double>(), property.properties.at(6).value<double>());
|
||||
glm::vec3 translation = glm::vec3(property.properties.at(4).value<double>(), property.properties.at(5).value<double>(), 1.0);
|
||||
materialParam.translation += translation;
|
||||
}
|
||||
materialParam.translation += translation;
|
||||
} else {
|
||||
const QString propname = property.properties.at(0).toString();
|
||||
unknowns.push_back(propname.toStdString());
|
||||
|
|
Loading…
Reference in a new issue