Automatically installing MHX importer: need feedback

This forum is aimed at user contributions, in the form of assets, side projects, code patches and similar.

Moderator: joepal

Automatically installing MHX importer: need feedback

Postby joepal » Fri Jan 15, 2010 4:01 pm

I've been discussing with thomas on how to automatically install the MHX blender modules if valid version of blender is installed. Given that MHX requires a specific version of blender (I think, did you change this Thomas?), I decided against doing it inside the DEB files. However, In the end I've played around with the script which starts makehuman, and extended it to the following:

Code: Select all
#!/bin/bash

if test -e /usr/share/blender/VERSION; then
  # Seems some version of blender exists
  BLENDER=`cat /usr/share/blender/VERSION`

  # Only 2.49a and 2.49b works with MHX exporter, no
  # need to do anything if none of those versions
  # are installed.
  VALID="n";

  if test $BLENDER == "2.49a"; then
    VALID="y";
  fi
  if test $BLENDER == "2.49b"; then
    VALID="y"
  fi

  if test $VALID == "y"; then
    # A valid version of blender is installed
    if test -d ~/.blender; then
      # Blender has been started once and has
      # set up local files
      if test -d ~/.blender/scripts; then
        # Scripts dir is ready to be installed in
        cd ~/.blender/scripts

        if test -e ./mhx_export.py ; then
          # Probably already installed
          echo "MHX already installed"
        else
          # install MHX as symlinks
          echo "Setting up MHX importer for blender"
          ln -sf /usr/share/makehuman/importers/mhx/blender249/mhx_export.py
          ln -sf /usr/share/makehuman/importers/mhx/blender249/mhx_import.py
          ln -sf /usr/share/makehuman/importers/mhx/blender249/mhx_lipsync.py
          ln -sf /usr/share/makehuman/importers/mhx/blender249/pydrivers.py
        fi
      fi
    fi
  fi
fi

cd /usr/share/makehuman
./makehuman


In summary, if a valid version of blender has been installed, symlinks to the MHX import/export modules will be placed in $HOME/.blender/scripts, and thus be available the next time the user starts blender.

So... Feedback on this? Is it a bad idea to automatically make the modules available to the user? Would it be better to require the users to take explicit action?
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Automatically installing MHX importer: need feedback

Postby joepal » Fri Jan 15, 2010 4:05 pm

And oh, this code exists in nightly 64-bit debs starting tomorrow, but is commented out for now. If you want to test, edit /usr/bin/makehuman and remove the comment signs.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Automatically installing MHX importer: need feedback

Postby ThomasL » Sat Jan 16, 2010 10:47 am

Hi Joel,

I tried tonights deb. It installs MH at /usr/share, but it does not appear in my Applications menu. Shouldn't it do that?

The Import mhx alternative does not show up in my import menu in Blender, presumably because mhx_import.py was not copied to /usr/share/blender/scripts.

It is not clear to me what script you are referring to. Anyway, you don't really have to check for the Blender version. Older Blenders should be able to import mhx files, although not entirely correctly. I checked with 2.49a, and the only problem is that driven constraints and shapes are driven by the armature object instead of the bones. The user does get a warning when this happens.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Automatically installing MHX importer: need feedback

Postby joepal » Sat Jan 16, 2010 11:29 am

ThomasL wrote:Hi Joel,

I tried tonights deb. It installs MH at /usr/share, but it does not appear in my Applications menu. Shouldn't it do that?

The Import mhx alternative does not show up in my import menu in Blender, presumably because mhx_import.py was not copied to /usr/share/blender/scripts.

It is not clear to me what script you are referring to. Anyway, you don't really have to check for the Blender version. Older Blenders should be able to import mhx files, although not entirely correctly. I checked with 2.49a, and the only problem is that driven constraints and shapes are driven by the armature object instead of the bones. The user does get a warning when this happens.


I haven't got that far with point 1, and for point 2, that was what was commented out. If you edit /usr/bin/makehuman, you'll see the the above code.

Fair enough for blender versions. Will it also work with 2.50?
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Automatically installing MHX importer: need feedback

Postby ThomasL » Sun Jan 17, 2010 11:58 am

No, the import script will not work with 2.50, which has a completely new python API. A separate version for 2.50 will be available later, but Blender 2.50 is too unstable and incomplete to do this at the moment.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Automatically installing MHX importer: need feedback

Postby joepal » Sun Jan 17, 2010 12:18 pm

http://code.google.com/p/makehuman/issues/detail?id=25

I've enabled the install script on 64-bit builds and not taken any heed to the possibility that the user might have 2.50. If there is any blender version installed, the import scripts will be automatically enabled.

We can do something about that later on when/if people start to use 2.50 in any larger degree.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Automatically installing MHX importer: need feedback

Postby VitalBodies » Thu Jan 28, 2010 4:47 am

Generically I would say that many people who are using Ubuntu are new to Ubuntu and the Linux way of doing things.
ANYTHING that make things easier are nice and helpful.

On the blog post I did about MakeHuman, the keyword searches suggest they are struggling with the details of getting it all going and are searching for answers.
"Ubuntu just works" is the Ubuntu motto - or pretty close to that if i quoted it not exactly.
I would go for that.
It just works...
Image
Ubuntu 10.04 (Lucid) 64-bit
http://www.vitalbodies.net/site/art-des ... anorg.html
MakeHuman 1.0Alpha4 - Blender - Inkscape - Gimp - AQSIS 1.6
VitalBodies
 
Posts: 91
Joined: Tue Jan 05, 2010 8:00 pm


Return to User contributions

Who is online

Users browsing this forum: No registered users and 1 guest