Page 1 of 2

Blender 2.8 changes for Mhx2

PostPosted: Wed Sep 05, 2018 5:49 pm
by jcpalmer
I have been evaluating changes for other things for Blender 2.8. I have started to make known changes, and thought I would pass one on which will even keep add-onsfrom loading. That is a utility for registering sub-classes of Blender objects has been removed, see https://en.blender.org/index.php/Dev:2.8/Source/Python/UpdatingScripts. This is in __init__.py of the main directory.

I have already changed this in community plugins. I am still working on an interface with a kinect2 sensor so it cannot be commited, but the code for this is:
Code: Select all
classes =  (
    Community_Panel,
    MeshSyncOperator,
    PoseSyncOperator,
    ExpressionTransOperator,
    AmputateFingers,
    AmputateFace,
    SnapOnIkRig,
    RemoveIkRig,
    SnapOnFingerRig,
    RemoveFingerRig,
    ToKinect2,
    StartKinectRecording,
    StopKinectRecording,
    KinectAssignment,
    KinectRefresh,
    PoseRight,
    ActionTrimLeft,
    ActionTrimRight,
    ActionSmoothing,
    Animation_items
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)


There is also a requirement to set the Blender minimum version to 2.8. These are just to get the thing to load. My other add-ons die rather early when actually running. The community stuff came out almost unscathed. I am just guessing something like make walk is going to need TLC. Quaternion & matrix multiplication seem to be done differently.

Re: Blender 2.8 changes for Mhx2

PostPosted: Wed Sep 05, 2018 9:19 pm
by joepal
That's good to know.

All the blendertools addons are in a sore need of an overhaul anyway.

Re: Blender 2.8 changes for Mhx2

PostPosted: Sat Sep 08, 2018 6:45 am
by RobBaer
Very helpful. I linked back to your post on the MHX2 issues page. https://bitbucket.org/Diffeomorphic/mhx ... blender-28

Please keep sharing.

Edit: Here is a nice short video on adapting plugins:
https://blender.community/c/today/Szcbb ... ts-youtube

Re: Blender 2.8 changes for Mhx2

PostPosted: Tue Sep 11, 2018 4:35 pm
by jcpalmer
Well, it was 2 weeks from the last build, so I got the 9/11 win64 distributable. It has a change which causes most of the UI not be shown. When you create a label you now must use the named parameter of 'text'. The draw function for community does not very early, so only button still there. I only used the explicit when a second parameter like 'icon' was also used.

Prior worked:
Code: Select all
ikBox = layout.box()
ikBox.label("IK Rig:")

Now must be:
Code: Select all
ikBox = layout.box()
ikBox.label(text="IK Rig:")

I peeked at MHX2. It has a label right at the top that needs to be changed (probably others too), so nothing would show.

Re: Blender 2.8 changes for Mhx2

PostPosted: Fri Apr 19, 2019 1:03 am
by TCarp
I have come across a problem with the Mhx2 blender addon that is only a problem in blender 2.8 (works fine in 2.79). When I try importing a Moho(.dat) file I get an error message that something is wrong with the visemes python file.
The error message in blender says the issue is on lines 206 and 179. I know this is not a problem with the moho file I am using because it works for with the Mhx2 plugin in Blender 2.79.
I don't know enough about blender scripting to find the exact issue myself so please walk me through what I should change in the script if you do not post a new version of the Mhx2 download with this issue resolved where others can use it.
I am not sure what the process is for fixing bugs in this plugin for a beta version of blender and will understand if you are waiting until the stable release of blender 2.8 to solve this problem.

Re: Blender 2.8 changes for Mhx2

PostPosted: Fri Apr 19, 2019 6:09 pm
by RobBaer
Here is the URL where you can post issues related to MHX2, if that is indeed where things are going wrong for you:
https://bitbucket.org/Diffeomorphic/mhx ... tatus=open

Here is the URL for posting issues related to problems with Blender 2.80:
https://developer.blender.org/maniphest ... it/form/1/

This is unlikely an issue with core Makehuman behavior. I have only lightly looked at Visemes with make human, and without more detail about the exact error message you get, it would be difficult even to provide good advice on which of the two entities above is struggling. Perhaps you'll get lucky here, but I'm afraid your guess on being patient until Blender 2.80 is finally released is the more likely outcome.

To potentially improve your luck at getting help on this forum, maybe you could specify your error messages more completely.

Re: Blender 2.8 changes for Mhx2

PostPosted: Fri Dec 06, 2019 1:27 am
by TCarp
This problem is still present working in blender 2.80 full release with the 2.80 version of import MHX2. Here is the Blender error message: Image
I am using a rigify rig but I don't think that would make a difference.

Re: Blender 2.8 changes for Mhx2

PostPosted: Fri Dec 06, 2019 11:23 pm
by punkduck
Hi

I can check this when the code is in our own MakeHuman repository. This would hopefully happen soon. I got a similar problem in the new make clothes by applying transformations and guess it could be a similar problem, the use of "view_layer" instead of "scene" fixed my problem.

So it might be:

Code: Select all
context.view_layer.objects.active = rig


Greetings ..

Re: Blender 2.8 changes for Mhx2

PostPosted: Fri Dec 06, 2019 11:54 pm
by Aranuvir
https://github.com/makehumancommunity/mhx2-makehuman-exchange

BTW, admitting I might be stupid, but what is a moho.dat file?

Re: Blender 2.8 changes for Mhx2

PostPosted: Mon Dec 09, 2019 1:29 pm
by TCarp
Aranuvir wrote:
https://github.com/makehumancommunity/mhx2-makehuman-exchange

BTW, admitting I might be stupid, but what is a moho.dat file?

It is a text file that lists the used visems in order with their start time. It is created from an audio file in a program like: https://my.smithmicro.com/papagayo.html