THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/02/2004 at 10:55, xxxxxxxx wrote:
Cinema 4D Version: 8.500
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
am I right that there is a MCOMMAND_SELECTPOLYTOPOINT but not a matching MCOMMAND_SELECTPOLYTOEDGE ?
I would like to convert a polygon selection to an edge selection, and then I would like to deselect all "non border" edges. Could somebody give a roughly outline how to acieve this?
If I'm ready with 3, I would also like to set the Hypernurbs value of these edges and make them phong breaking edges. any clue how to do that?
Generally the SDK is imho *very* short on edge handling, and an example about handling and manipulation the different kind of selections would certainly be a big bonus here.
Thanks for any insight
On 08/02/2004 at 01:38, xxxxxxxx wrote:
Ok, so here's what I think I've figured out so far:
Use PolygonObject GetPolygonS() to get the polygon selection
Use BaseSelect GetSegments() ro get the number of segments, and GetRange(LONG seg, LONG* a, LONG* b) to access the polygons of each selection. Ok, now I have the polygon indices, and can access the single faces after retrieving the polygon array with GetPolygon().
Next I create a Neighbor Object and initialize it using Init(LONG pcnt, Polygon* vadr, LONG vcnt, BaseSelect* bs).
GetEdgePolys(LONG a, LONG b, LONG* first, LONG* second) delivers me the Polygons attached to the edge a-b. Do I get a NULL for the first or second Poly, provided the edge in question is an "outer edge" of the selection?
So, and now I'm stuck. I think I should create a BaseSelect and stuff the edges in it to use PolygonObject's SetSelected Edges(...) with EDGES_PHONG to break the edges the lines.
And, much more important: How can I retrieve the edge indices?
BTW: Do I have to repeat that call with EDGES_SELECTION or can I combine these selection types?
I also don't understand how to set edge weightings in the HNData, as this has only polyweight and pointweight, yet no edgeweight afathe SDK shows.
Thanks for any corrections, further info and helpful advice!
On 08/02/2004 at 07:31, xxxxxxxx wrote:
1./2. Correct. Use
MCOMMAND_CONVERTSELECTION and then set the MDATA ids according to the dialog in Cinema 4d.
3. Afaik the edge HN weightings ain´t nothing else but weightings of the corresponding points of the edge. Phong Breaks can be retrieved with GetPhongBreaks() which returns a normal BaseSelect and can be modified like one (direct access).
There (in the docs) you can also see how to retrieve the edge index:
**"The edges are indexed by [CODE]4 * polygon + edge
is the polygon index and
is the edge index between 0 and 3. "** [/CODE]
As you already correctly did, you can use the Neighbor class to go through all edges and then apply your selection algorithm to them. (see the documentation or the "Atom.cpp" SDK example for more information on edges)
Hope that helps (these are thoughts, I haven´t checked them)