Jump to content


Photo

MakeHuman plugins for TDM

makehuman character assets rig blender

  • Please log in to reply
9 replies to this topic

#1 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 673 posts

Posted 16 September 2017 - 04:31 PM

I'll start with some background on what brought up this idea; As some users may know, I've been working on a large mod for TDM, which aims to introduce cyberpunk assets for futuristic worlds... it's called The Dark Module and is currently being discussed in this thread. One of the many types of assets I'll need in order to complete this project are new player models; I've already ported the character set from Xonotic, but will be needing more models in order to create civilians. I've thought of the most efficient way to achieve this: MakeHuman!

 

For those who haven't heard of it, MakeHuman is a tool that can be used to easily create human characters; You choose from a selection of geometries / materials / rigs, adjust several parameters defining the shape and size of your character, then export to one of many formats. Its default assets are also licensed under CC0 / Public Domain.

 

http://www.makehuman.org

 

So why I am bringing this up here? Well I've already used Makehuman to create characters for Blender animations. Likewise I've also exported many characters from Blender to TheDarkMod so far, and know how the skeleton and mesh need to be defined. The problem is that setting up a TDM character in Blender is very time consuming, especially the rigging part... Makehuman on the other hand can automate the process if given the right data to work with; You may create plugins for custom rigs, as well as custom exporters for a multitude of formats! Since I'll want to create a lot of civilian characters for my mod, I could definitely use the convenience of having MakeHuman export the final md5mesh instead of me having to go through Blender with each one. What I'm basically looking for is two things:

  1. A md5 exporter for MakeHuman. It needs to be capable of exporting to md5mesh format, have proper material definitions, as well as generate the low-poly shadow mesh.
  2. A custom rig compatible with TheDarkMod's animations. The rig simply needs to contain the bones and vertex weights used by TDM so the model animates properly out-of-the-box.

Apparently there were people working on such, however I can't find anything up to date let alone a download. I was only able to find this video as far as an exporter goes:

 

 

If both of those things can be made, it would be a huge advantage for many mod and mission creators; People will have the ability to create custom characters for TDM in a matter of minutes, something that normally takes days to do! However I have zero idea how to build a md5 exporter, and also don't know if I can use Blender to create a custom MakeHuman rig preset. Would anyone be willing to help at least on a MakeHuman rig for the TDM joints?



#2 freyk

freyk

    Advanced Member

  • Member
  • PipPipPip
  • 520 posts

Posted 17 September 2017 - 03:38 AM

>> art assets.

#3 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 673 posts

Posted 17 September 2017 - 07:41 AM

>> art assets.

 

Ah yes, that section would have been better... too late to move the thread now though.

 

Anyway I managed to find a supposed md5 exporter for MakeHuman on Github. I haven't tested it so no idea if it still works with the latest version of the program. Someone would also need to patch it so that it generates the low-poly shadow mesh we're using, otherwise you still have to edit the output in Blender which defeats the purpose. On the bright side, the code is rather short and simple!

 

https://github.com/d...s/mh2/mh2md5.py

#!/usr/bin/python
# -*- coding: utf-8 -*-

""" 
Export to id Software's MD5 format.

**Project Name:**      MakeHuman

**Product Home Page:** http://www.makehuman.org/

**Code Home Page:**    http://code.google.com/p/makehuman/

**Authors:**           Marc Flerackers

**Copyright(c):**      MakeHuman Team 2001-2013

**Licensing:**         AGPL3 (see also http://www.makehuman.org/node/318)

**Coding Standards:**  See http://www.makehuman.org/node/165

Abstract
--------

This module implements a plugin to export MakeHuman mesh and skeleton data to id Software's MD5 format.
See http://www.modwiki.net/wiki/MD5MESH_(file_format) for information on the format.

Requires:

- base modules

"""

__docformat__ = 'restructuredtext'

from os.path import basename
from skeleton import Skeleton

groupWeights = (
    ('head-back-skull', 'joint-head', 1.0),
    ('head-brow', 'joint-head', 1.0),
    ('head-tongue', 'joint-head', 1.0),
    ('head-upper-skull', 'joint-head', 1.0),
    ('hip-navel', 'joint-spine2', 1.0),
    ('inner-mouth', 'joint-mouth', 1.0),
    ('jaw-chin', 'joint-head', 1.0),
    ('jaw-lower-chin', 'joint-head', 1.0),
    ('l-ear-helix', 'joint-head', 1.0),
    ('l-ear-inner', 'joint-head', 1.0),
    ('l-ear-lobe', 'joint-head', 1.0),
    ('l-ear-tubercle', 'joint-head', 1.0),
    ('l-eye-ball', 'joint-l-eye', 1.0),
    ('l-eye-inner-brow-ridge', 'joint-head', 1.0),
    ('l-eye-lower-inner-lid', 'joint-head', 1.0),
    ('l-eye-lower-middle-lid', 'joint-head', 1.0),
    ('l-eye-lower-middle-orbital', 'joint-head', 1.0),
    ('l-eye-lower-outer-lid', 'joint-head', 1.0),
    ('l-eye-lower-outer-orbital', 'joint-head', 1.0),
    ('l-eye-middle-brow-ridge', 'joint-head', 1.0),
    ('l-eye-outer-brow-ridge', 'joint-head', 1.0),
    ('l-eye-upper-inner-lid', 'joint-head', 1.0),
    ('l-eye-upper-inner-orbital', 'joint-head', 1.0),
    ('l-eye-upper-middle-lid', 'joint-head', 1.0),
    ('l-eye-upper-middle-orbital', 'joint-head', 1.0),
    ('l-eye-upper-outer-lid', 'joint-head', 1.0),
    ('l-eye-upper-outer-orbital', 'joint-head', 1.0),
    ('l-foot-ankle', 'joint-l-ankle', 1.0),
    ('l-foot-core', 'joint-l-ankle', 1.0),
    ('l-foot-heel', 'joint-l-ankle', 1.0),
    ('l-foot-nail1', 'joint-l-toe-1-2', 1.0),
    ('l-foot-nail2', 'joint-l-toe-2-3', 1.0),
    ('l-foot-nail3', 'joint-l-toe-3-3', 1.0),
    ('l-foot-nail4', 'joint-l-toe-4-3', 1.0),
    ('l-foot-nail5', 'joint-l-toe-5-3', 1.0),
    ('l-foot-toe-1-1', 'joint-l-toe-1-1', 1.0),
    ('l-foot-toe-1-2', 'joint-l-toe-1-2', 1.0),
    ('l-foot-toe-2-1', 'joint-l-toe-2-1', 1.0),
    ('l-foot-toe-2-2', 'joint-l-toe-2-2', 1.0),
    ('l-foot-toe-2-3', 'joint-l-toe-2-3', 1.0),
    ('l-foot-toe-3-1', 'joint-l-toe-3-1', 1.0),
    ('l-foot-toe-3-2', 'joint-l-toe-3-2', 1.0),
    ('l-foot-toe-3-3', 'joint-l-toe-3-3', 1.0),
    ('l-foot-toe-4-1', 'joint-l-toe-4-1', 1.0),
    ('l-foot-toe-4-2', 'joint-l-toe-4-2', 1.0),
    ('l-foot-toe-4-3', 'joint-l-toe-4-3', 1.0),
    ('l-foot-toe-5-1', 'joint-l-toe-5-1', 1.0),
    ('l-foot-toe-5-2', 'joint-l-toe-5-2', 1.0),
    ('l-foot-toe-5-3', 'joint-l-toe-5-3', 1.0),
    ('l-hand-finger-1-1', 'joint-l-finger-1-1', 1.0),
    ('l-hand-finger-1-2', 'joint-l-finger-1-2', 1.0),
    ('l-hand-finger-1-3', 'joint-l-finger-1-3', 1.0),
    ('l-hand-finger-2-1', 'joint-l-finger-2-1', 1.0),
    ('l-hand-finger-2-2', 'joint-l-finger-2-2', 1.0),
    ('l-hand-finger-2-3', 'joint-l-finger-2-3', 1.0),
    ('l-hand-finger-3-1', 'joint-l-finger-3-1', 1.0),
    ('l-hand-finger-3-2', 'joint-l-finger-3-2', 1.0),
    ('l-hand-finger-3-3', 'joint-l-finger-3-3', 1.0),
    ('l-hand-finger-4-1', 'joint-l-finger-4-1', 1.0),
    ('l-hand-finger-4-2', 'joint-l-finger-4-2', 1.0),
    ('l-hand-finger-4-3', 'joint-l-finger-4-3', 1.0),
    ('l-hand-finger-5-1', 'joint-l-finger-5-1', 1.0),
    ('l-hand-finger-5-2', 'joint-l-finger-5-2', 1.0),
    ('l-hand-finger-5-3', 'joint-l-finger-5-3', 1.0),
    ('l-hand-nail1', 'joint-l-finger-1-3', 1.0),
    ('l-hand-nail2', 'joint-l-finger-2-3', 1.0),
    ('l-hand-nail3', 'joint-l-finger-3-3', 1.0),
    ('l-hand-nail4', 'joint-l-finger-4-3', 1.0),
    ('l-hand-nail5', 'joint-l-finger-5-3', 1.0),
    ('l-hand-palm', 'joint-r-hand', 1.0),
    ('l-head-cheek', 'joint-head', 1.0),
    ('l-head-cheek-arc', 'joint-head', 1.0),
    ('l-head-lower-inner-orbital', 'joint-head', 1.0),
    ('l-head-maxilla', 'joint-head', 1.0),
    ('l-head-outer-chin', 'joint-head', 1.0),
    ('l-head-temple', 'joint-head', 1.0),
    ('l-head-zygoma', 'joint-head', 1.0),
    ('l-hip', '', 1.0),
    ('l-hip-lower-abdomen', '', 1.0),
    ('l-hip-middle-abdomen', '', 1.0),
    ('l-hip-upper-abdomen', '', 1.0),
    ('l-jaw', 'joint-head', 1.0),
    ('l-lowerarm', 'joint-l-elbow', 1.0),
    ('l-lowerleg', 'joint-l-knee', 1.0),
    ('l-lowerleg-calf', 'joint-l-knee', 1.0),
    ('l-mouth-lower', 'joint-mouth', 1.0),
    ('l-mouth-lower-lip', 'joint-mouth', 1.0),
    ('l-mouth-upper-lip', 'joint-mouth', 1.0),
    ('l-nose-nostril', 'joint-head', 1.0),
    ('l-pelvis-gluteus', '', 1.0),
    ('l-teeth-low-cent-incisor', 'joint-head', 1.0),
    ('l-teeth-low-cuspid', 'joint-head', 1.0),
    ('l-teeth-low-first-bicuspid', 'joint-head', 1.0),
    ('l-teeth-low-first-molar', 'joint-head', 1.0),
    ('l-teeth-low-lat-incisor', 'joint-head', 1.0),
    ('l-teeth-low-sec-bicuspid', 'joint-head', 1.0),
    ('l-teeth-low-sec-molar', 'joint-head', 1.0),
    ('l-teeth-low-third-molar', 'joint-head', 1.0),
    ('l-teeth-up-cent-incisor', 'joint-head', 1.0),
    ('l-teeth-up-cuspid', 'joint-head', 1.0),
    ('l-teeth-up-first-bicuspid', 'joint-head', 1.0),
    ('l-teeth-up-first-molar', 'joint-head', 1.0),
    ('l-teeth-up-lat-incisor', 'joint-head', 1.0),
    ('l-teeth-up-sec-bicuspid', 'joint-head', 1.0),
    ('l-teeth-up-sec-molar', 'joint-head', 1.0),
    ('l-teeth-up-third-molar', 'joint-head', 1.0),
    ('l-torso-axilla', '', 1.0),
    ('l-torso-back-scapula', '', 1.0),
    ('l-torso-back-shoulder', '', 1.0),
    ('l-torso-clavicle', '', 1.0),
    ('l-torso-front-shoulder', '', 1.0),
    ('l-torso-inner-pectoralis', '', 1.0),
    ('l-torso-lower-back', '', 1.0),
    ('l-torso-lower-pectoralis', '', 1.0),
    ('l-torso-middle-pectoralis', '', 1.0),
    ('l-torso-nipple', '', 1.0),
    ('l-torso-outer-pectoralis', '', 1.0),
    ('l-torso-ribs', '', 1.0),
    ('l-torso-trapezius', '', 1.0),
    ('l-torso-upper-middle-back', '', 1.0),
    ('l-torso-upper-pectoralis', '', 1.0),
    ('l-torso-upper-shoulder', '', 1.0),
    ('l-upperarm-biceps', 'joint-l-shoulder', 1.0),
    ('l-upperarm-triceps', 'joint-l-shoulder', 1.0),
    ('l-upperleg-frontal-thigh', 'joint-l-upper-leg', 1.0),
    ('l-upperleg-knee', 'joint-l-upper-leg', 1.0),
    ('l-upperleg-thigh-back', 'joint-l-upper-leg', 1.0),
    ('mouth-lower-middle-lip', 'joint-mouth', 1.0),
    ('mouth-upper-middle-lip', 'joint-mouth', 1.0),
    ('neck', 'joint-neck', 1.0),
    ('neck-adam-apple', 'joint-neck', 1.0),
    ('neck-upper', 'joint-neck', 1.0),
    ('nose-bridge', 'joint-head', 1.0),
    ('nose-glabella', 'joint-head', 1.0),
    ('nose-philtrum', 'joint-head', 1.0),
    ('nose-sellion', 'joint-head', 1.0),
    ('nose-tip', 'joint-head', 1.0),
    ('pelvis-genital-area', '', 1.0),
    ('r-ear-helix', 'joint-head', 1.0),
    ('r-ear-inner', 'joint-head', 1.0),
    ('r-ear-lobe', 'joint-head', 1.0),
    ('r-ear-tubercle', 'joint-head', 1.0),
    ('r-eye-ball', 'joint-head', 1.0),
    ('r-eye-inner-brow-ridge', 'joint-head', 1.0),
    ('r-eye-lower-inner-lid', 'joint-head', 1.0),
    ('r-eye-lower-middle-lid', 'joint-head', 1.0),
    ('r-eye-lower-middle-orbital', 'joint-head', 1.0),
    ('r-eye-lower-outer-lid', 'joint-head', 1.0),
    ('r-eye-lower-outer-orbital', 'joint-head', 1.0),
    ('r-eye-middle-brow-ridge', 'joint-head', 1.0),
    ('r-eye-outer-brow-ridge', 'joint-head', 1.0),
    ('r-eye-upper-inner-lid', 'joint-head', 1.0),
    ('r-eye-upper-inner-orbital', 'joint-head', 1.0),
    ('r-eye-upper-middle-lid', 'joint-head', 1.0),
    ('r-eye-upper-middle-orbital', 'joint-head', 1.0),
    ('r-eye-upper-outer-lid', 'joint-head', 1.0),
    ('r-eye-upper-outer-orbital', 'joint-head', 1.0),
    ('r-foot-ankle', 'joint-r-ankle', 1.0),
    ('r-foot-core', 'joint-r-ankle', 1.0),
    ('r-foot-heel', 'joint-r-ankle', 1.0),
    ('r-foot-nail1', 'joint-r-toe-1-2', 1.0),
    ('r-foot-nail2', 'joint-r-toe-2-3', 1.0),
    ('r-foot-nail3', 'joint-r-toe-3-3', 1.0),
    ('r-foot-nail4', 'joint-r-toe-4-3', 1.0),
    ('r-foot-nail5', 'joint-r-toe-5-3', 1.0),
    ('r-foot-toe-1-1', 'joint-r-toe-1-1', 1.0),
    ('r-foot-toe-1-2', 'joint-r-toe-1-2', 1.0),
    ('r-foot-toe-2-1', 'joint-r-toe-2-1', 1.0),
    ('r-foot-toe-2-2', 'joint-r-toe-2-2', 1.0),
    ('r-foot-toe-2-3', 'joint-r-toe-2-3', 1.0),
    ('r-foot-toe-3-1', 'joint-r-toe-3-1', 1.0),
    ('r-foot-toe-3-2', 'joint-r-toe-3-2', 1.0),
    ('r-foot-toe-3-3', 'joint-r-toe-3-3', 1.0),
    ('r-foot-toe-4-1', 'joint-r-toe-4-1', 1.0),
    ('r-foot-toe-4-2', 'joint-r-toe-4-2', 1.0),
    ('r-foot-toe-4-3', 'joint-r-toe-4-3', 1.0),
    ('r-foot-toe-5-1', 'joint-r-toe-5-1', 1.0),
    ('r-foot-toe-5-2', 'joint-r-toe-5-2', 1.0),
    ('r-foot-toe-5-3', 'joint-r-toe-5-3', 1.0),
    ('r-hand-finger-1-1', 'joint-r-finger-1-1', 1.0),
    ('r-hand-finger-1-2', 'joint-r-finger-1-2', 1.0),
    ('r-hand-finger-1-3', 'joint-r-finger-1-3', 1.0),
    ('r-hand-finger-2-1', 'joint-r-finger-2-1', 1.0),
    ('r-hand-finger-2-2', 'joint-r-finger-2-2', 1.0),
    ('r-hand-finger-2-3', 'joint-r-finger-2-3', 1.0),
    ('r-hand-finger-3-1', 'joint-r-finger-3-1', 1.0),
    ('r-hand-finger-3-2', 'joint-r-finger-3-2', 1.0),
    ('r-hand-finger-3-3', 'joint-r-finger-3-3', 1.0),
    ('r-hand-finger-4-1', 'joint-r-finger-4-1', 1.0),
    ('r-hand-finger-4-2', 'joint-r-finger-4-2', 1.0),
    ('r-hand-finger-4-3', 'joint-r-finger-4-3', 1.0),
    ('r-hand-finger-5-1', 'joint-r-finger-5-1', 1.0),
    ('r-hand-finger-5-2', 'joint-r-finger-5-2', 1.0),
    ('r-hand-finger-5-3', 'joint-r-finger-5-3', 1.0),
    ('r-hand-nail1', 'joint-r-finger-1-3', 1.0),
    ('r-hand-nail2', 'joint-r-finger-2-3', 1.0),
    ('r-hand-nail3', 'joint-r-finger-3-3', 1.0),
    ('r-hand-nail4', 'joint-r-finger-4-3', 1.0),
    ('r-hand-nail5', 'joint-r-finger-5-3', 1.0),
    ('r-hand-palm', 'joint-r-hand', 1.0),
    ('r-head-cheek', 'joint-head', 1.0),
    ('r-head-cheek-arc', 'joint-head', 1.0),
    ('r-head-lower-inner-orbital', '', 1.0),
    ('r-head-maxilla', 'joint-head', 1.0),
    ('r-head-outer-chin', 'joint-head', 1.0),
    ('r-head-temple', 'joint-head', 1.0),
    ('r-head-zygoma', 'joint-head', 1.0),
    ('r-hip', '', 1.0),
    ('r-hip-lower-abdomen', '', 1.0),
    ('r-hip-middle-abdomen', '', 1.0),
    ('r-hip-upper-abdomen', '', 1.0),
    ('r-jaw', 'joint-head', 1.0),
    ('r-lowerarm', 'joint-r-elbow', 1.0),
    ('r-lowerleg', 'joint-l-knee', 1.0),
    ('r-lowerleg-calf', 'joint-l-knee', 1.0),
    ('r-mouth-lower', 'joint-mouth', 1.0),
    ('r-mouth-lower-lip', 'joint-mouth', 1.0),
    ('r-mouth-upper-lip', 'joint-mouth', 1.0),
    ('r-nose-nostril', 'joint-head', 1.0),
    ('r-pelvis-gluteus', '', 1.0),
    ('r-teeth-low-cent-incisor', 'joint-head', 1.0),
    ('r-teeth-low-cuspid', 'joint-head', 1.0),
    ('r-teeth-low-first-bicuspid', 'joint-head', 1.0),
    ('r-teeth-low-first-molar', 'joint-head', 1.0),
    ('r-teeth-low-lat-incisor', 'joint-head', 1.0),
    ('r-teeth-low-sec-bicuspid', 'joint-head', 1.0),
    ('r-teeth-low-sec-molar', 'joint-head', 1.0),
    ('r-teeth-low-third-molar', 'joint-head', 1.0),
    ('r-teeth-up-cent-incisor', 'joint-head', 1.0),
    ('r-teeth-up-cuspid', 'joint-head', 1.0),
    ('r-teeth-up-first-bicuspid', 'joint-head', 1.0),
    ('r-teeth-up-first-molar', 'joint-head', 1.0),
    ('r-teeth-up-lat-incisor', 'joint-head', 1.0),
    ('r-teeth-up-sec-bicuspid', 'joint-head', 1.0),
    ('r-teeth-up-sec-molar', 'joint-head', 1.0),
    ('r-teeth-up-third-molar', 'joint-head', 1.0),
    ('r-torso-axilla', '', 1.0),
    ('r-torso-back-scapula', '', 1.0),
    ('r-torso-back-shoulder', '', 1.0),
    ('r-torso-clavicle', '', 1.0),
    ('r-torso-front-shoulder', '', 1.0),
    ('r-torso-inner-pectoralis', '', 1.0),
    ('r-torso-lower-back', '', 1.0),
    ('r-torso-lower-pectoralis', '', 1.0),
    ('r-torso-middle-pectoralis', '', 1.0),
    ('r-torso-nipple', '', 1.0),
    ('r-torso-outer-pectoralis', '', 1.0),
    ('r-torso-ribs', '', 1.0),
    ('r-torso-trapezius', '', 1.0),
    ('r-torso-upper-middle-back', '', 1.0),
    ('r-torso-upper-pectoralis', '', 1.0),
    ('r-torso-upper-shoulder', '', 1.0),
    ('r-upperarm-biceps', 'joint-r-shoulder', 1.0),
    ('r-upperarm-triceps', 'joint-r-shoulder', 1.0),
    ('r-upperleg-frontal-thigh', 'joint-l-upper-leg', 1.0),
    ('r-upperleg-knee', 'joint-l-upper-leg', 1.0),
    ('r-upperleg-thigh-back', 'joint-l-upper-leg', 1.0),
    ('torso-spine', '', 1.0),
    ('l-eye-cornea', 'joint-head', 1.0),
    ('r-eye-cornea', 'joint-head', 1.0),
    ('r-eye-eyebrown', 'joint-head', 1.0),
    ('l-eye-eyebrown', 'joint-head', 1.0),
    ('l-eye-lower-lash', 'joint-head', 1.0),
    ('l-eye-upper-lash', 'joint-head', 1.0),
    ('r-eye-lower-lash', 'joint-head', 1.0),
    ('r-eye-upper-lash', 'joint-head', 1.0))

def exportMd5(obj, filename):
    """
    This function exports MakeHuman mesh and skeleton data to id Software's MD5 format. 
    
    Parameters
    ----------
   
    obj:     
      *Object3D*.  The object whose information is to be used for the export.
    filename:     
      *string*.  The filename of the file to export the object to.
    """

    skeleton = Skeleton()
    skeleton.update(obj)

    f = open(filename, 'w')
    f.write('MD5Version 10\n')
    f.write('commandline ""\n\n')
    f.write('numJoints %d\n' % (skeleton.joints+1)) # Amount of joints + the hardcoded origin below
    f.write('numMeshes %d\n\n' % (1)) # TODO: 2 in case of hair
    f.write('joints {\n')
    f.write('\t"%s" %d ( %f %f %f ) ( %f %f %f )\n' % ('origin', -1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
    writeJoint(f, skeleton.root)
    f.write('}\n\n')
    f.write('mesh {\n')
    f.write('\tshader "%s"\n' % (basename(obj.texture))) # TODO: create the shader file
    f.write('\n\tnumverts %d\n' % (len(obj.verts)))
    for vert in obj.verts:
        if obj.has_uv:
            face = vert.sharedFaces[0]
            u, v = obj.texco[face.uv[face.verts.index(vert)]]
        else:
            u, v = 0, 0
        # vert [vertIndex] ( [texU] [texV] ) [weightIndex] [weightElem]
        f.write('\tvert %d ( %f %f ) %d %d\n' % (vert.idx, u, 1.0-v, vert.idx, 1))
    f.write('\n\tnumtris %d\n' % (len(obj.faces) * 2))
    for face in obj.faces:
        # tri [triIndex] [vertIndex1] [vertIndex2] [vertIndex3]
        f.write('\ttri %d %d %d %d\n' % (face.idx*2, face.verts[2].idx, face.verts[1].idx, face.verts[0].idx))
        f.write('\ttri %d %d %d %d\n' % (face.idx*2+1, face.verts[0].idx, face.verts[3].idx, face.verts[2].idx))
    f.write('\n\tnumweights %d\n' % (len(obj.verts)))
    for vert in obj.verts:
        # TODO: We attach all vertices to the root with weight 1.0, this should become
        # real weights to the correct bones
        # weight [weightIndex] [jointIndex] [weightValue] ( [xPos] [yPos] [zPos] )
        f.write('\tweight %d %d %f ( %f %f %f )\n' % (vert.idx, 0, 1.0, vert.co[0], -vert.co[2], vert.co[1]))
    f.write('}\n\n')
    f.close()

def writeJoint(f, joint):
    """
  This function writes out information describing one joint in MD5 format. 
  
  Parameters
  ----------
  
  f:     
    *file handle*.  The handle of the file being written to.
  joint:     
    *Joint object*.  The joint object to be processed by this function call.
  ident:     
    *integer*.  The joint identifier.
  """
    if joint.parent:
        parentIndex = joint.parent.index
    else:
        parentIndex = 0
    # "[boneName]"   [parentIndex] ( [xPos] [yPos] [zPos] ) ( [xOrient] [yOrient] [zOrient] )
    f.write('\t"%s" %d ( %f %f %f ) ( %f %f %f )\n' % (joint.name, parentIndex,
        joint.position[0], joint.position[1], joint.position[2],
        joint.direction[0], joint.direction[1], joint.direction[2]))

    for joint in joint.children:
        writeJoint(f, joint)


#4 Sotha

Sotha

    Vertical Contest Winner

  • Active Developer
  • PipPipPipPipPip
  • 5600 posts

Posted 17 September 2017 - 01:00 PM

Sounds amazing, but what about heads?

 

Heads are separate entities in TDM so one would beed to (manually) separate the heads from the makehuman bodies. right?

 

I guess a decapitation script would be in order? :angry: :D


Clipper
-The mapper's best friend.

#5 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 673 posts

Posted 17 September 2017 - 03:22 PM

Sounds amazing, but what about heads?

 

Heads are separate entities in TDM so one would beed to (manually) separate the heads from the makehuman bodies. right?

 

I guess a decapitation script would be in order? :angry: :D

 

Ah... that's true as well, forgot that part. One of the models I made has the head connecting seamlessly to the body (mesh wise), but of course the head had to be exported as its own model and entity... thankfully I got it to sit almost seamlessly in-game (unless you zoom in and look very close where you can notice a tiny seam). The obvious solution would be for the script to put the body and head on their own md5mesh each, and hopefully calculate the head origin offset needed to achieve minimal gap.


Edited by MirceaKitsune, 17 September 2017 - 03:23 PM.


#6 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5338 posts

Posted 18 September 2017 - 02:58 AM

Sounds amazing, but what about heads?

 

Heads are separate entities in TDM so one would beed to (manually) separate the heads from the makehuman bodies. right?

 

I guess a decapitation script would be in order? :angry: :D

Not all ai is setup like that (for example zombies, horses or the werebeast). So in theory it could also work if the head cannot be seperated.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#7 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 673 posts

Posted 18 September 2017 - 05:04 AM

Not all ai is setup like that (for example zombies, horses or the werebeast). So in theory it could also work if the head cannot be seperated.

 

A seam between the head and body would actually not be visible either way; Since no one's likely to be exporting naked humans for TDM, the head mesh can be separated behind the clothing. Makehuman offers an option to hide faces on the body mesh when exporting with cloth models, which we would obviously be using for optimal polygon count.

 

A separate head entity is the most ideal setup though; It offers way more customization options than a whole mesh. I'm actually thinking of creating bodies and heads separately, though I'll probably export full characters and just leave them swappable between bodies that make sense (same gender / skin color / class).



#8 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1429 posts

Posted 19 September 2017 - 06:13 PM

I think chances are much higher for you to be able to setup your own mod rigs with new unique animations than to automate a process where you export from makehumans with detached heads, models scaled to TDMs rig and with a rigged low poly version inside. That sounds simply impossible. Im no expert, but it just seems to me more attainable to simply create a new rig separate from TDMs and use your civilians models there. I know it sounds bad, but think about it: most oTDMs animations are not really useful in a cyberpunk scenario. Things like carrying a torch, swinging swords, etc. Yes, many would still be valuable, stuff like walking, running, etc. But you would need so much more stuff, animations for interacting with computers, all new combat animations like firing guns, getting hit by rapidfire bullets, hiding behind cover, stuff like that, you would only get those if you find an animator or learn to animate yourself, in which case, you would be better off just creating your own rig from scratch . You dont really need to swap heads, if you can get enough complete models in the game to account for the variation needed. Its only done in TDM because you have only a handful of bodies, that need to be shared by all the characters.



#9 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1429 posts

Posted 19 September 2017 - 06:19 PM

Not to be a drag but all of what we are discussing here can only be achieved by a group of people. You cannot hope to create all that would be needed by yourself. Its not only that its impossible to master all the different stages single handedly, its also that the amount of work becomes so high after a point, that it would actually be traumatizing to have to go through all of it, if you were to achieve the goal nonetheless. It just wouldnt be fun. There needs to be a collaborative environment. Thats the (only) fun way of doing it. Ive been working on a animated AI character these past few months, having to go through all the roablocks one at a time, its simply too time consuming, and thats a single AI model. I havent reached half the way yet. After months of (little) free time invested. What I would suggest is for you to reach out in the Idtech4 and bfg community because there are still loads of people with experience and interest in working on a scifi setting, because of doom. If you could get a group together, that would be brilliant.


Edited by RPGista, 19 September 2017 - 06:24 PM.

  • CarltonTroisi likes this

#10 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 673 posts

Posted 19 September 2017 - 07:53 PM

As far as my cyberpunk conversion goes, I believe I can handle most of the basics. Mainly since I'm using existing freely licensed stuff, not creating new assets on my own as much... it's all about finding an easy way to convert and adapt stuff, ideally automating as much of it as possible. I've already ported all of the Xonotic characters to TheDarkMod, as well as two texture packages. The existing animations work fine for humans, at least for now till we get around to making new ones... they will be using the same rig in any case, for compatibility with both old and new anims. Once I get enough done to prove the potential of the idea, I'm hopeful more developers will join in.

 

As far as MakeHuman goes, I realize that fully exporting to md5mesh might be too much to hope for. I do however at least hope for a MakeHuman version of the TDM rig, so that I don't have to arrange every bone for each character in Blender. That part is a lot more doable, as MH joint templates can be defined in a way that lets them scale with the property settings of the character. I'm curious if anyone might be willing to look into that... if not I might myself eventually, but I really don't know how this works and if I have the tools to do it.







Also tagged with one or more of these keywords: makehuman, character, assets, rig, blender

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users