Documentation for weightmaps/bone/skinbinding architecture and data-structures

robertgassrobertgass Posts: 5

The DAZ Studio Architecture Overview that comes with the SDK is very light on information about how vertices are connected to bones and how it all works together.  Is it documented with examples somewhere else?

Post edited by robertgass on

Comments

  • It would be great to see a simple example script of how to find all the vertices that would be affected by the movement of a bone.

  • robertgassrobertgass Posts: 5
    edited September 2020

    Well, I found the selection map, but I think somehow doing this with the weightmaps would be awesome.  I think the selectionmap is just used to get the bone to select based on the face clicked or something?

    Also, I don't see it clearly documented anywhere what the indices of dzFaceGroup are.  I assume they are indices of the vertices in the geometry?

    This was the little script I ended up with:

    var selmap = female.getSelectionMap();
    var dobj = female.getObject();
    if (dobj != null) {
      print("shapes ----------------------");
      for (var j = 0; j < dobj.getNumShapes(); j++) {
        print(String("---- Shape %1").arg(j));
        var dshp = dobj.getShape(j);
        var geo = dshp.getGeometry();
        for (var k = 0; k < selmap.getNumPairs(); k ++) {
          var fg = geo.findFaceGroup(selmap.getPairGroup(k));
          for (var l = 0; l < fg.count(); l++) {
            var v = geo.getVertex(fg.getIndex(l));
            print (String(" vert:%4 X:%1 Y:%2 Z:%3").arg(v.x).arg(v.y).arg(v.z).arg(k));
          }
        }
      }
    }
    Post edited by robertgass on
  • Unfortunately DzShape is not currently documented, my recollection is that you could get a list of weight-maps affecting a given vertex but it's not a feature I've used so my recollection is hazy.

Sign In or Register to comment.