Digital Art Zone

 
     
Traversing the surfaces of a model.
Posted: 23 March 2013 05:00 AM   [ Ignore ]
New Member
Total Posts:  5
Joined  2013-02-08

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

Profile
 
 
Posted: 23 March 2013 05:44 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  14719
Joined  2003-10-09

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.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 23 March 2013 06:42 AM   [ Ignore ]   [ # 2 ]
New Member
Total Posts:  5
Joined  2013-02-08

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.

Profile
 
 
Posted: 26 March 2013 09:13 AM   [ Ignore ]   [ # 3 ]
Member
Rank
Total Posts:  114
Joined  2008-04-10

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.

DzNodenode dzScene->getPrimarySelection();
DzObjectobject node->getObject();
DzShapeshape object->getCurrentShape();
DzFacetMeshmesh qobject_cast<DzFacetMesh*>(shape->getGeometry());

// should check the mesh for null first.

for(int i 0mesh->getNumMaterialGroups(); i++)
{
    DzMaterialFaceGroup
materialGroup mesh->getMaterialGroup(i);
    
QString name materialGroup->getName();
    
}

// or take a look at DzFacetMesh::findMaterialGroup 
Profile
 
 
Posted: 26 March 2013 09:43 AM   [ Ignore ]   [ # 4 ]
New Member
Total Posts:  5
Joined  2013-02-08

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

Profile
 
 
Posted: 26 March 2013 01:37 PM   [ Ignore ]   [ # 5 ]
Member
Rank
Total Posts:  103
Joined  2010-12-31

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.

Profile
 
 
Posted: 26 March 2013 07:39 PM   [ Ignore ]   [ # 6 ]
New Member
Total Posts:  5
Joined  2013-02-08

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.

Profile