Digital Art Zone

 
     
Facet mesh facet and vertex count question…
Posted: 23 May 2012 12:16 PM   [ Ignore ]
New Member
Total Posts:  14
Joined  2004-11-03

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

Profile
 
 
Posted: 25 May 2012 04:31 AM   [ Ignore ]   [ # 1 ]
Member
Avatar
Rank
Total Posts:  36
Joined  2005-09-14

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

 Signature 

Eric Winemiller
Digital Carvers Guild
Plug-ins for Carrara and LightWave

Profile
 
 
Posted: 25 May 2012 11:59 AM   [ Ignore ]   [ # 2 ]
New Member
Total Posts:  14
Joined  2004-11-03

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?

Profile
 
 
Posted: 25 May 2012 03:41 PM   [ Ignore ]   [ # 3 ]
Member
Avatar
Rank
Total Posts:  36
Joined  2005-09-14

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,

 Signature 

Eric Winemiller
Digital Carvers Guild
Plug-ins for Carrara and LightWave

Profile
 
 
Posted: 26 May 2012 12:59 AM   [ Ignore ]   [ # 4 ]
New Member
Total Posts:  14
Joined  2004-11-03

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

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

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

Profile
 
 
Posted: 26 May 2012 04:04 AM   [ Ignore ]   [ # 5 ]
Member
Avatar
Rank
Total Posts:  36
Joined  2005-09-14

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.

Image Attachments
facets_sml.jpg
 Signature 

Eric Winemiller
Digital Carvers Guild
Plug-ins for Carrara and LightWave

Profile