Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on opening MHM in compatibility mode #245

Open
joepal1976 opened this issue Jun 2, 2024 · 5 comments
Open

Crash on opening MHM in compatibility mode #245

joepal1976 opened this issue Jun 2, 2024 · 5 comments

Comments

@joepal1976
Copy link
Contributor

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
Copy link
Contributor Author

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?

@black-punkduck
Copy link
Contributor

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).

@joepal1976
Copy link
Contributor Author

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.

@black-punkduck
Copy link
Contributor

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

@Aranuvir
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants