我在MakeHuman中创建了一个扩展名为.mhm
的文件。在windows中,我可以用写字板打开文件,我可以看到以下内容:
# Written by MakeHuman 1.1.1
version v1.1.1
tags 001_Final
camera 8.0 1.0 0.021307010478 0.846332182106 0.541236909817 1.1625
modifier nose/nose-flaring-decr|incr -0.080000
modifier mouth/mouth-dimples-in|out 0.460000
modifier breast/breast-trans-down|up 1.000000
modifier nose/nose-trans-backward|forward 0.206000
modifier macrodetails-universal/Muscle 0.500000
modifier mouth/mouth-scale-horiz-decr|incr -0.080000
modifier macrodetails/African 0.460000
modifier neck/neck-trans-down|up -0.174000
modifier macrodetails-proportions/BodyProportions 0.786000
modifier mouth/mouth-laugh-lines-in|out 0.080000
modifier torso/torso-scale-horiz-decr|incr -0.048000
modifier neck/neck-scale-depth-decr|incr 0.158000
modifier torso/torso-trans-backward|forward 0.032000
modifier neck/neck-scale-horiz-decr|incr -0.620000
modifier nose/nose-trans-down|up 0.096000
modifier head/head-scale-depth-decr|incr -0.222000
modifier eyes/r-eye-bag-decr|incr -0.222000
modifier mouth/mouth-lowerlip-ext-down|up -0.206000
modifier macrodetails/Gender 0.000000
modifier torso/torso-scale-vert-decr|incr -0.064000
modifier head/head-angle-in|out -0.126000
modifier nose/nose-point-width-decr|incr 0.190000
modifier macrodetails-height/Height 0.690000
modifier breast/BreastSize 0.738000
modifier mouth/mouth-scale-vert-decr|incr -0.350000
modifier mouth/mouth-lowerlip-middle-down|up -0.666000
modifier head/head-invertedtriangular 0.937000
modifier nose/nose-hump-decr|incr -0.112000
modifier nose/nose-septumangle-decr|incr 0.048000
modifier nose/nose-base-down|up -0.064000
modifier torso/torso-trans-down|up 0.080000
modifier nose/nose-nostrils-width-decr|incr -0.968000
modifier mouth/mouth-trans-down|up -0.016000
modifier macrodetails/Age 0.500000
modifier mouth/mouth-angles-down|up 0.476000
modifier neck/neck-double-decr|incr -0.080000
modifier breast/BreastFirmness 1.000000
modifier macrodetails/Asian 0.000000
modifier eyebrows/eyebrows-angle-down|up -0.032000
modifier breast/breast-point-decr|incr -0.842000
modifier nose/nose-scale-depth-decr|incr 0.286000
modifier head/head-oval 0.040000
modifier forehead/forehead-temple-decr|incr 0.302000
modifier mouth/mouth-trans-in|out -0.080000
modifier head/head-fat-decr|incr 0.112000
modifier head/head-age-decr|incr -0.254000
modifier macrodetails/Caucasian 0.540000
modifier nose/nose-trans-in|out 0.016000
modifier nose/nose-curve-concave|convex -0.016000
modifier head/head-trans-in|out 0.016000
modifier head/head-square 0.357000
modifier eyes/r-eye-bag-in|out -0.238000
modifier mouth/mouth-upperlip-volume-decr|incr -1.000000
modifier head/head-scale-horiz-decr|incr 0.080000
modifier chin/chin-prognathism-decr|incr -0.032000
modifier nose/nose-scale-vert-decr|incr -0.048000
modifier head/head-round 0.151000
modifier nose/nose-nostrils-angle-down|up -0.206000
modifier nose/nose-compression-compress|uncompress -0.142000
modifier head/head-rectangular 0.286000
modifier mouth/mouth-cupidsbow-decr|incr -0.048000
modifier head/head-back-scale-depth-decr|incr -0.334000
modifier breast/breast-dist-decr|incr -0.270000
modifier eyebrows/eyebrows-trans-backward|forward -0.286000
modifier nose/nose-point-down|up 0.270000
modifier nose/nose-scale-horiz-decr|incr -0.476000
modifier mouth/mouth-upperlip-width-decr|incr 0.714000
modifier torso/torso-trans-in|out 0.080000
modifier neck/neck-scale-vert-decr|incr 0.334000
modifier chin/chin-bones-decr|incr -1.000000
modifier macrodetails-universal/Weight 0.500000
modifier mouth/mouth-trans-backward|forward -0.588000
modifier neck/neck-trans-in|out -0.080000
modifier nose/nose-greek-decr|incr -0.206000
modifier mouth/mouth-scale-depth-decr|incr 0.096000
modifier mouth/mouth-cupidsbow-width-decr|incr -0.080000
modifier mouth/mouth-lowerlip-volume-decr|incr -1.000000
hair Braid01 eead6f99-d6c6-4f6b-b6c2-210459d7a62e
eyebrows eyebrow008 79ea307f-a942-40dd-bf50-bbaa41f02034
eyes HighPolyEyes 2c12f43b-1303-432c-b7ce-d78346baf2e6
pose tpose.bvh
clothes female_casualsuit02 9896f4a4-a718-4bdd-8482-52e1855160f6
clothesHideFaces True
skinMaterial skins/default.mhmat
material Braid01 eead6f99-d6c6-4f6b-b6c2-210459d7a62e braid01.mhmat
material HighPolyEyes 2c12f43b-1303-432c-b7ce-d78346baf2e6 eyes/materials/brownlight.mhmat
subdivide False
我需要在matlab中导入这个文件,做一些更改,然后再次将其导出为.mhm
。在做任何事情之前,我想确保我确实可以用这种格式保存文件,但我在这样做时遇到了问题。首先,我现在只使用GUI将其加载为表。
然后我试着用储蓄
save('Final.mhm', 'Final')
文件被保存了,但当我试图打开它时,它只打开了一系列看似胡言乱语的字符。然后我尝试了:
writetable(Final, 'ProvaFinal.txt')
这是有效的。我可以保存为.txt,然后手动将扩展名更改为.mhm
然而,我想在Matlab中以编程方式完成所有工作(我还必须为数百个文件这样做(。
我试过了:
writetable(Final, 'ProvaFinal.mhm')
不出所料,它没有起作用。我可以将Matlab文件保存为.mhm吗
这是文件的副本https://drive.google.com/file/d/1RcS_S3dJVBdrXEc6ibB9KTcm1eU4W-xt/view?usp=sharing
文件扩展名其实并不重要。然而,在这种情况下,.txt
扩展隐式地告诉Matlab您想要编写一个空间受限的文件。
来自文件:
可写表(T,filename(写入文件名和扩展名由filename指定的文件
writetable根据指定的扩展名确定文件格式。扩展必须是以下之一:
- .txt、.dat或.csv(用于分隔文本文件(
- Excel®电子表格文件的.xls、.xlsm或.xlsx
- .xlsb,用于安装Excel for Windows®的系统上支持的Excel电子表格文件
因此,您应该能够将其写入.txt
文件,然后从MATLAB中重命名该文件。
writetable(Final, 'ProvaFinal.txt');
movefile('ProvaFinal.txt', 'ProvaFinal.mhm');