Writeable edge array [SOLVED]

On 30/06/2015 at 06:03, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R16 
Platform:      Mac OSX  ; 
Language(s) :     C++  ;

---------
Hi,

Got a short question:

How does one get the writeable edge array?
It seems like the answer will be a lot longer than my question 😛

It's easy to store the writeable points array in a vector, with GetPointW(), but for edges, there seems to be no such function.

Should I convert my selection from edge to point, and work on my points? And if so, how should I do that?

Thanks in advance for your help and time!!

Greetings,
Casimir Smets

On 30/06/2015 at 06:59, xxxxxxxx wrote:

You are on the correct path.  Edges are inferred by the relationship of vertices in polygons and do not exist outright as a thing.  It would be best to get your edges and you will be updating their corresponding vertex pairs.  Note that edges sharing a vertex will need to be considered.  If you update a vertex for one edge and then update the same vertex for another common edge, you will get twice the effect.

On 30/06/2015 at 07:06, xxxxxxxx wrote:

Hi Robert,

Thanks for your answer!
And, I allready had in mind that it could give weird problems with common vertices in edges, but I change all my edges at once, so that shouldn't be a problem.

With kind regards,
Casimir Smets

On 01/07/2015 at 01:23, xxxxxxxx wrote:

Hello,

as pointed out by Kuroyume there is no explicit data structure for edges. To handle edges you can use the Neighbor class; an example of its usage can be found in the Atom Object example.

Best wishes,
Sebastian

On 01/07/2015 at 02:17, xxxxxxxx wrote:

Hi Sebastian,

I can't see how this would help me :s
I need to get the vertices attached to the selected edges, but, if I have one edge selected, I can't get that points with the Neighbor class, right?
The Neighbor class only gives me access to polygons, doesn't it?

Thanks for your help and time!

Greetings,
Casimir Smets

On 02/07/2015 at 01:29, xxxxxxxx wrote:

Hello,

using the Neighbor class you can loop through all edges, check if they are selected and then handle the vertices that define a given edge. See the example in PolyInfo Struct Reference.

Best wishes,
Sebastian

On 02/07/2015 at 08:12, xxxxxxxx wrote:

Hi,

So, if I had multiple edges sharing the same point, this could give me a huge problem, right?
Isn't it easier then to convert the selection with a modelingCommand? This would also allow me to do that on ALL my objects, instead for each object.

With kind regards,
Casimir Smets

On 03/07/2015 at 07:24, xxxxxxxx wrote:

Hi,

It seems like the easiest way to do this was with a selectionChanger, the solution can be found here:
https://plugincafe.maxon.net/topic/8891/11767_selectionchanger-example-solved

Another way around was temporarily converting the edge-selection to a point-selection, then adjust the points, and convert the selection back. That solution can be found here:
https://plugincafe.maxon.net/topic/8898/11786_mcommandconvertselection-solved

I won't look any further into the Neighbor class right now, because my problem is fixed.

You can mark this thread as solved!

Greetings,
Casimir Smets