History

Rename HFMGeometry to HFMModel and adjust related variables

sabrina-shanman committed 8 years ago

Commit cbca77b1 parent 643026a46 files · +550 −550Browse files

Showing the changes to interface/src/ModelPackager.cpp (1 of 46 files). Show all

Unified · Split

interface/src/ModelPackager.cpp+17−17
@@ -109,10 +109,10 @@ bool ModelPackager::loadModel() { · 108 unmodified lines
109109 qCDebug(interfaceapp) << "Reading FBX file : " << _fbxInfo.filePath();
110110 QByteArray fbxContents = fbx.readAll();
111111
112− _geometry.reset(readFBX(fbxContents, QVariantHash(), _fbxInfo.filePath()));
112+ _model.reset(readFBX(fbxContents, QVariantHash(), _fbxInfo.filePath()));
113113
114114 // make sure we have some basic mappings
115− populateBasicMapping(_mapping, _fbxInfo.filePath(), *_geometry);
115+ populateBasicMapping(_mapping, _fbxInfo.filePath(), *_model);
116116 } catch (const QString& error) {
117117 qCDebug(interfaceapp) << "Error reading " << _fbxInfo.filePath() << ": " << error;
118118 return false;
@@ -122,7 +122,7 @@ bool ModelPackager::loadModel() { · 3 unmodified lines
122122
123123 bool ModelPackager::editProperties() {
124124 // open the dialog to configure the rest
125− ModelPropertiesDialog properties(_modelType, _mapping, _modelFile.path(), *_geometry);
125+ ModelPropertiesDialog properties(_modelType, _mapping, _modelFile.path(), *_model);
126126 if (properties.exec() == QDialog::Rejected) {
127127 return false;
128128 }
@@ -235,18 +235,18 @@ bool ModelPackager::zipModel() { · 106 unmodified lines
235235 return true;
236236 }
237237
238−void ModelPackager::populateBasicMapping(QVariantHash& mapping, QString filename, const HFMGeometry& geometry) {
238+void ModelPackager::populateBasicMapping(QVariantHash& mapping, QString filename, const HFMModel& model) {
239239
240240 bool isBodyType = _modelType == FSTReader::BODY_ONLY_MODEL || _modelType == FSTReader::HEAD_AND_BODY_MODEL;
241241
242242 // mixamo files - in the event that a mixamo file was edited by some other tool, it's likely the applicationName will
243243 // be rewritten, so we detect the existence of several different blendshapes which indicate we're likely a mixamo file
244− bool likelyMixamoFile = geometry.applicationName == "mixamo.com" ||
245− (geometry.blendshapeChannelNames.contains("BrowsDown_Right") &&
246− geometry.blendshapeChannelNames.contains("MouthOpen") &&
247− geometry.blendshapeChannelNames.contains("Blink_Left") &&
248− geometry.blendshapeChannelNames.contains("Blink_Right") &&
249− geometry.blendshapeChannelNames.contains("Squint_Right"));
244+ bool likelyMixamoFile = model.applicationName == "mixamo.com" ||
245+ (model.blendshapeChannelNames.contains("BrowsDown_Right") &&
246+ model.blendshapeChannelNames.contains("MouthOpen") &&
247+ model.blendshapeChannelNames.contains("Blink_Left") &&
248+ model.blendshapeChannelNames.contains("Blink_Right") &&
249+ model.blendshapeChannelNames.contains("Squint_Right"));
250250
251251 if (!mapping.contains(NAME_FIELD)) {
252252 mapping.insert(NAME_FIELD, QFileInfo(filename).baseName());
@@ -268,15 +268,15 @@ void ModelPackager::populateBasicMapping(QVariantHash& mapping, QString filename · 15 unmodified lines
268268 }
269269 QVariantHash joints = mapping.value(JOINT_FIELD).toHash();
270270 if (!joints.contains("jointEyeLeft")) {
271− joints.insert("jointEyeLeft", geometry.jointIndices.contains("jointEyeLeft") ? "jointEyeLeft" :
272− (geometry.jointIndices.contains("EyeLeft") ? "EyeLeft" : "LeftEye"));
271+ joints.insert("jointEyeLeft", model.jointIndices.contains("jointEyeLeft") ? "jointEyeLeft" :
272+ (model.jointIndices.contains("EyeLeft") ? "EyeLeft" : "LeftEye"));
273273 }
274274 if (!joints.contains("jointEyeRight")) {
275− joints.insert("jointEyeRight", geometry.jointIndices.contains("jointEyeRight") ? "jointEyeRight" :
276− geometry.jointIndices.contains("EyeRight") ? "EyeRight" : "RightEye");
275+ joints.insert("jointEyeRight", model.jointIndices.contains("jointEyeRight") ? "jointEyeRight" :
276+ model.jointIndices.contains("EyeRight") ? "EyeRight" : "RightEye");
277277 }
278278 if (!joints.contains("jointNeck")) {
279− joints.insert("jointNeck", geometry.jointIndices.contains("jointNeck") ? "jointNeck" : "Neck");
279+ joints.insert("jointNeck", model.jointIndices.contains("jointNeck") ? "jointNeck" : "Neck");
280280 }
281281
282282 if (isBodyType) {
@@ -296,7 +296,7 @@ void ModelPackager::populateBasicMapping(QVariantHash& mapping, QString filename · 13 unmodified lines
296296
297297 if (!joints.contains("jointHead")) {
298298 const char* topName = likelyMixamoFile ? "HeadTop_End" : "HeadEnd";
299− joints.insert("jointHead", geometry.jointIndices.contains(topName) ? topName : "Head");
299+ joints.insert("jointHead", model.jointIndices.contains(topName) ? topName : "Head");
300300 }
301301
302302 mapping.insert(JOINT_FIELD, joints);
@@ -370,7 +370,7 @@ void ModelPackager::populateBasicMapping(QVariantHash& mapping, QString filename · 67 unmodified lines
370370
371371 void ModelPackager::listTextures() {
372372 _textures.clear();
373− foreach (const HFMMaterial mat, _geometry->materials) {
373+ foreach (const HFMMaterial mat, _model->materials) {
374374 if (!mat.albedoTexture.filename.isEmpty() && mat.albedoTexture.content.isEmpty() &&
375375 !_textures.contains(mat.albedoTexture.filename)) {
376376 _textures << mat.albedoTexture.filename;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t