Facet mesh facet and vertex count question...

Titanic401Titanic401 Posts: 0
edited December 1969 in Carrara SDK Developer Discussion

Hi all,

I'm working on my exporter writing the code to send the vertice and facet data to the file, when I noticed that according to the facet count for a cube primitive it has 24 facets, shouldn't it be only 12? Is this counting double-sided facets?

Just curious.
TIA

Comments

  • Eric WinemillerEric Winemiller Posts: 84
    edited December 1969

    Sounds like something else is going on. I didn't check it in code, but if I bring up the Counter dialog with a cube primitive or a vertex cube, I get 1 object, 12 facets.

    Regards

  • Titanic401Titanic401 Posts: 0
    edited December 1969

    I did that too, I checked the counter and it reported 12 facets, then I tried converting the cube to the vertex modeler where selected all and got 12 facets, I reran my plugin in debug mode this time using the converted vertex cube and got 24 facets from FacetMesh. Then I tried again, this time using a native cube from the vertex modeler - same results.

    I don't know what's going on, but this is seriously confusing me. Could it be an issue with C7 possibly?

  • Eric WinemillerEric Winemiller Posts: 84
    edited May 2012

    I just ran Anything Goos under the debugger. It reports 12 facets for a cube primitive. This was on Carrara 7.

    Some things I'd look at.

    1. Are you sure you're looking at the facet count, not vertices or normals?
    2. If you look at it immediately after GetRenderingFacetMesh or GetFMesh is it correct? I tried both and got the same answer.
    3. Are you maybe calling SetFacetsCount somewhere along the line?

    Good luck,

    Post edited by Eric Winemiller on
  • Titanic401Titanic401 Posts: 0
    edited December 1969

    This is the code I'm using, it's just the original code from the DXF sample:

    TMCCountedPtr object;
    instance->GetDeformed3DObject( &object; );
    TMCCountedPtr prim;
    object->QueryInterface(IID_I3DShPrimitive, (void**) &prim;);
    if( prim )
    {
    TMCCountedPtr fMesh;
    prim->GetFMesh( 0.0, &fMesh;);
    ...
    ...
    }

    I didn't even write this code, DAZ did so it should be working...right?

  • Eric WinemillerEric Winemiller Posts: 84
    edited May 2012

    I'm completely baffled then. I use the same code in Anything Grows and get 12. Attached is a screen shot. There's a few other things interleaved in there, but essentially it's

    1. Get the tree.
    2. Get the instance
    3. Get the deformed object
    4. Get the mesh

    You can see from the watch window, the mesh has only 12 facets.

    edited by mod for image size.

    facets_sml.jpg
    800 x 511 - 122K
    Post edited by adamr001 on
Sign In or Register to comment.