Traversing the surfaces of a model.

talukdar.anirbantalukdar.anirban Posts: 0
edited December 1969 in Daz SDK Developer Discussion

Hi I am working on a plugin for daz3d. On this work I have to find the information's of the surfaces of a model. I have a DzNode object (got from the current selection). Now I want to have all the surface objects of the object. The surface selection tool of daz3d does the similar work.

Please help.

Thanks & Regards
Anirban Talukdar


  • Richard HaseltineRichard Haseltine Posts: 88,749
    edited March 2013

    In script it would be node to object, object to shape, shape to materials list. I think the route would be the same in the SDK, butt hat isn't always the case.

    Post edited by Richard Haseltine on
  • talukdar.anirbantalukdar.anirban Posts: 0
    edited December 1969

    I can have the material objects attached with that object. But how to fetch which portion of the geometry (subset of the main object) is attached with this particular material. One entity (say a human model) can be attached with multiple materials. Say hand, leg, body etc. Now for each of these materials is attached to a particular portion of the human model. Now after getting the material of the hand how can I get the geometry which constitute the hand.

  • ammon_fde0d92863ammon_fde0d92863 Posts: 119
    edited December 1969

    Geometry in Studio is divided in more than one way. The first would be by material zone. So on genesis this would be 3_SkinHand is a materia zone. The second is by selection set(this is not required) and this is more of a mapping from bone to facets. So you click on the eye(even thogh all the geometry is on the root object) the selection set tell Studio what node you meant to select.

    If material zone is what you want then something along this line, assuming you have the root of the figure selected.

    // have not compiled this, but I think you get the basic idea.
    DzNode* node = dzScene->getPrimarySelection();
    DzObject* object = node->getObject();
    DzShape* shape = object->getCurrentShape();
    DzFacetMesh* mesh = qobject_cast(shape->getGeometry());
    // should check the mesh for null first.
    for(int i = 0; i < mesh->getNumMaterialGroups(); i++)
        DzMaterialFaceGroup* materialGroup = mesh->getMaterialGroup(i);
        QString name = materialGroup->getName();
    // or take a look at DzFacetMesh::findMaterialGroup
  • talukdar.anirbantalukdar.anirban Posts: 0
    edited December 1969

    I am using version 4.0 of DAZ sdk. Though the reference of the class "DzMaterialFaceGroup" is there there is no html link above this class as happens to other class. Am I using an outdated version of sdk?

    Thanks & Regards
    Anirban Talukdar

  • dtammdtamm Posts: 126
    edited December 1969

    Yes, but 4.5 is the same. The documentation is not complete. From the header file dzfacegroup.h you can see that DzMaterialFaceGroup is a DzFaceGroup which is a DzIndexList. See DzIndexList for what you want to do.

  • talukdar.anirbantalukdar.anirban Posts: 0
    edited December 1969

    Thank you. I have run a small test. I went as expected. Let me see whether I will be able to get the final result or not.

    Thank you again.

Sign In or Register to comment.