Select facet by id?

Hello everyone,

Assume I already know the ids of some facets, is there a way to select these facets via script, then I could use addSelectedFacetsToMaterialGroup() function to add them into a material group?
I have found that DzFacetMesh has some functions such as: selectAllFacets(), selectConnectedFacets() and selectFacets(DzFaceGroup *grp), but they don't seem to meet what I need (please correct me if I'm wrong).

Many thanks :)

Comments

  • simtenerosimtenero Posts: 383
    e-wave said:

    Hello everyone,

    Assume I already know the ids of some facets, is there a way to select these facets via script, then I could use addSelectedFacetsToMaterialGroup() function to add them into a material group?
    I have found that DzFacetMesh has some functions such as: selectAllFacets(), selectConnectedFacets() and selectFacets(DzFaceGroup *grp), but they don't seem to meet what I need (please correct me if I'm wrong).

    Many thanks :)

    This seems doable.  You would have to first clear out the current active selection with deselectAllFacets(), then get the material you want to modify with getMaterialGroup().  Next, you'd create a DzFacetGroup that contains the facets you want added, then selectFacets(yourNewFacetGroup).  Then you should be good to addSelectedFacetsToMaterialGroup().

    None of that is tested, so I could be way off, but I think thats the basic idea laugh.

  • iwaveiwave Posts: 45
    edited April 2016
    simtenero said:
    e-wave said:

    Hello everyone,

    Assume I already know the ids of some facets, is there a way to select these facets via script, then I could use addSelectedFacetsToMaterialGroup() function to add them into a material group?
    I have found that DzFacetMesh has some functions such as: selectAllFacets(), selectConnectedFacets() and selectFacets(DzFaceGroup *grp), but they don't seem to meet what I need (please correct me if I'm wrong).

    Many thanks :)

    This seems doable.  You would have to first clear out the current active selection with deselectAllFacets(), then get the material you want to modify with getMaterialGroup().  Next, you'd create a DzFacetGroup that contains the facets you want added, then selectFacets(yourNewFacetGroup).  Then you should be good to addSelectedFacetsToMaterialGroup().

    None of that is tested, so I could be way off, but I think thats the basic idea laugh.

    Thank you very much for your reply.


    Your approach is correct, the only problem is I can not create the instance of DzFacetGroup or DzFaceGroup in Daz Studio(I am still using version 4.8).
    So I used getFaceGroup() function to get an existing DzFaceGroup, then added the ids of facets into this face group.
    Then I could successfully call selectFacets() to select these facets!


    Thank you again :)

    Post edited by iwave on
Sign In or Register to comment.