makehuman icon indicating copy to clipboard operation
makehuman copied to clipboard

Crash on opening MHM in compatibility mode

Open joepal1976 opened this issue 1 year ago • 6 comments

This is a repost of a report on patreon: https://www.patreon.com/posts/103666360

Problems with 1.3.0 upgraded from 1.2.1 when loading old models: When I want to open old models, this exception appears.

MHM file is of version v1.2.1, attempting to load with backward compatibility

Exception during event onFileSelected
Traceback (most recent call last):
  File "/home/kurt/Programme/makehuman/./core/events3d.py", line 211, in callEvent
    method(event)
  File "/home/kurt/Programme/makehuman/./apps/gui/guiload.py", line 109, in onFileSelected
    gui3d.app.loadHumanMHM(filename)
  File "/home/kurt/Programme/makehuman/./core/mhmain.py", line 404, in loadHumanMHM
    self.selectedHuman.load(filename, True)
  File "/home/kurt/Programme/makehuman/./apps/human.py", line 1553, in load
    compat.loadMHM(version, lines, _load_property, strict)
  File "/home/kurt/Programme/makehuman/./apps/compat.py", line 338, in loadMHM
    loader = getMHMLoader(version_)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kurt/Programme/makehuman/./apps/compat.py", line 330, in getMHMLoader
    raise RuntimeError("No suitable MHM backward compatibility loader found for version %s" % (version, ))
RuntimeError: No suitable MHM backward compatibility loader found for version [1, 2, 1]

joepal1976 avatar Jun 02 '24 14:06 joepal1976

We shouldn't need any form of backwards compatibility loader for a 1.2.1 file opened by 1.3.0. Nothing has changed in the file format.

It should be as simple at sidestepping the compatibility loader if both program version and mhm version are of 1.2.0 or higher.

@black-punkduck : Your thoughts?

joepal1976 avatar Jun 02 '24 14:06 joepal1976

Oops. I was not even aware of that thing and just tried to understand what it does. One class per version which should change keywords? Since nothing has changed, what should I do? ... should I add a dummy class? Or just leave it out completely?

Btw., we have another problem. User detected last week that our bodyshape helpers are really distorted. I helped elv and corrected them all. If we add this compat change we also should update the bodyshapes (also MPFB if you use them, they are much shorter now).

black-punkduck avatar Jun 02 '24 18:06 black-punkduck

I wasn't really aware that layer existed either. Looking at the code, I'd say the easiest way would be copy-pasting lines https://github.com/makehumancommunity/makehuman/blob/master/makehuman/apps/compat.py#L313-L324 and removing the tag if line.

Anyway, it sounds as if we'll need a 1.3.1.

MPFB doesn't use the body shapes at all yet, so that's no problem.

joepal1976 avatar Jun 03 '24 04:06 joepal1976

meanwhile I figured out why I did not see the error, I loaded 1.1 files for the test, so I just wonder I did not get the error just minutes ago.

I found one saved with 1.2 ... my Monty Python Gumby :)

So I did the change and tested it. Seems to work. Unfortunately the version seems to be mentioned in some more places although there are procedures to do nothing more than to get the version.

I just detected a "Theme makehuman version 1.2.0" on the screen ...

In my new system there is one JSON file in data folder: makehuman2_version.json. This also contains all URLs etc. and can be used for packaging, installation etc. This is a lesson learnt, but I learnt it when I added the method to supply basic assets ...

when I now do a 1.3.1 I am afraid this trouble starts again

MPFB: You should replace at least the zombie target ...

female-old-minmuscle-minweight-maxcup-averagefirmness.target

or please check this change, I tested all targets for new makehuman v2 so I found at least 2 odd ones:

target correction

black-punkduck avatar Jun 03 '24 18:06 black-punkduck

Compatibility seems to work now. There was no issue loading a 1.2 Model.

Quote:

when I now do a 1.3.1 I am afraid this trouble starts again

Regarding the compatibility issue, probably not. It checks only for major and minor (not micro).

I'd suggest to close the issue as fixed.

Aranuvir avatar Jun 25 '24 15:06 Aranuvir

I'm having the same issue. Though, I'm on the 1.3.0 alpha version.

---- the file data -------

Written by MakeHuman 1.2.0 final version v1.2.0 uuid 82bf4afb-367f-48f1-90b3-3377df4d172b name tags longer_neck;lots_of_changes;no_internals camera 19.0 47.5 0.10000000000000002 0.0 0.0 1.2125000000000041 modifier head/head-age-decr|incr -0.554000 modifier head/head-fat-decr|incr -0.504000 modifier head/head-invertedtriangular 0.783000 modifier head/head-back-scale-depth-decr|incr -0.606000 modifier hip/hip-scale-horiz-decr|incr 0.020000 modifier hip/hip-trans-down|up 0.146000 modifier hip/hip-waist-down|up 0.044000 modifier buttocks/buttocks-volume-decr|incr -0.402000 modifier pelvis/pelvis-tone-decr|incr -0.172000 modifier pelvis/bulge-decr|incr -0.160000 modifier armslegs/lowerlegs-height-decr|incr 0.898000 modifier armslegs/upperlegs-height-decr|incr 0.172000 modifier breast/BreastSize 0.650000 modifier breast/BreastFirmness 0.943000 modifier breast/breast-trans-down|up 0.210000 modifier breast/breast-point-decr|incr -0.172000 modifier breast/breast-volume-vert-down|up 0.006000 modifier breast/nipple-size-decr|incr 0.020000 modifier macrodetails/Gender 0.000000 modifier macrodetails/Age 0.369000 modifier macrodetails/African 0.000000 modifier macrodetails/Asian 0.280000 modifier macrodetails/Caucasian 0.720000 modifier macrodetails-universal/Muscle 0.720000 modifier macrodetails-universal/Weight 0.000000 modifier macrodetails-height/Height 0.299000 modifier macrodetails-proportions/BodyProportions 0.822000 modifier measure/measure-neck-circ-decr|incr -0.770000 modifier measure/measure-neck-height-decr|incr -0.350000 modifier measure/measure-bust-circ-decr|incr -0.020000 modifier measure/measure-waist-circ-decr|incr -0.134000 modifier measure/measure-napetowaist-dist-decr|incr -0.146000 modifier measure/measure-waisttohip-dist-decr|incr 0.236000 modifier measure/measure-shoulder-dist-decr|incr -1.000000 modifier measure/measure-hips-circ-decr|incr 0.376000 modifier measure/measure-upperleg-height-decr|incr -0.020000 modifier measure/measure-thigh-circ-decr|incr 0.312000 modifier measure/measure-knee-circ-decr|incr -0.006000 proxy female_generic 84b1a384-1af0-4126-9030-222edb78b318 skeleton default.mhskel eyes HighPolyEyes 2c12f43b-1303-432c-b7ce-d78346baf2e6 pose tpose.bvh clothesHideFaces True skinMaterial skins/young_caucasian_female/young_caucasian_female.mhmat material HighPolyEyes 2c12f43b-1303-432c-b7ce-d78346baf2e6 eyes/materials/brown.mhmat subdivide True

-------------------- shell output -------------- PRE STARTUP SETTING: useHDPI = False PRE STARTUP SETTING: noShaders = False PRE STARTUP SETTING: noSampleBuffers = False Initialized logging VERSION: UNKNOWN:UNKNOWN SHORT VERSION: alpha LONG VERSION: 1.3.0 alpha (UNKNOWN:UNKNOWN) BASEMESH VERSION: hm08 IS BUILT (FROZEN): No IS RELEASE VERSION: No DEFAULT ENCODING: utf-8 FILESYSTEM ENCODING: utf-8 STDOUT ENCODING: utf-8 LOCALE PREFERRED ENCODING: UTF-8 ... No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate' ... ModuleNotFoundError: No module named 'imp' ... libpng warning: iCCP: known incorrect sRGB profile ...

MHM file is of version v1.2.0, attempting to load with backward compatibility Exception during event onFileSelected Traceback (most recent call last): File "/nix/store/k92frna83cv2qdndi0wjqd9asp4y0ci4-makehuman-1.3.0/opt/makehuman/core/events3d.py", line 211, in callEvent method(event) File "/nix/store/k92frna83cv2qdndi0wjqd9asp4y0ci4-makehuman-1.3.0/opt/makehuman/apps/gui/guiload.py", line 109, in onFileSelected gui3d.app.loadHumanMHM(filename) File "/nix/store/k92frna83cv2qdndi0wjqd9asp4y0ci4-makehuman-1.3.0/opt/makehuman/core/mhmain.py", line 404, in loadHumanMHM self.selectedHuman.load(filename, True) File "/nix/store/k92frna83cv2qdndi0wjqd9asp4y0ci4-makehuman-1.3.0/opt/makehuman/apps/human.py", line 1553, in load compat.loadMHM(version, lines, load_property, strict) File "/nix/store/k92frna83cv2qdndi0wjqd9asp4y0ci4-makehuman-1.3.0/opt/makehuman/apps/compat.py", line 338, in loadMHM loader = getMHMLoader(version) ^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/k92frna83cv2qdndi0wjqd9asp4y0ci4-makehuman-1.3.0/opt/makehuman/apps/compat.py", line 330, in getMHMLoader raise RuntimeError("No suitable MHM backward compatibility loader found for version %s" % (version, )) RuntimeError: No suitable MHM backward compatibility loader found for version [1, 2, 0]

NoidoDev avatar Mar 14 '25 14:03 NoidoDev