THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/06/2011 at 16:51, xxxxxxxx wrote:
Yes, I also appreciate Sebastians work greatly. I'd never blame him :)
But Maxon could give him another developer, at least, now, where the integration is official ;)
Btw. here is a script from nophoto (on the c4dnetwork) which uses the relation between the polygon and edge-indexes to create a point-selection. In this way I can also determine which point belongs to which edge.
Cheers,
maxx
import c4d
import math
def main() :
EdgeS = op.GetEdgeS() # Alle selektierten Kanten als 'c4d.BaseSelect'
maxEdgeCnt = op.GetPolygonCount()*4 # Die maximal zu erwartende Anzahl von Kanten
# Eine Liste mit den Indizes aller Selektierten Kanten erstellen
EdgeInd = []
for i in xrange(maxEdgeCnt) :
if EdgeS.IsSelected(i) : EdgeInd.append(i)
Polygons = op.GetAllPolygons()
PointS = c4d.BaseSelect()
for edge in EdgeInd:
PolyInd = int(edge/4) # Der Index des Polygons, zu welchem die Kante mit Index 'edge' geh\rt
PolyEdgeInd = edge-4*(PolyInd) # Der Index der Polygonkante
#print str(edge) + ' = Polygon #' + str(PolyInd) + ' > Polygonkante #' + str(PolyEdgeInd)
Polygon = Polygons[PolyInd]
if PolyEdgeInd is 0:
PointS.Select(Polygon.a)
PointS.Select(Polygon.b)
elif PolyEdgeInd is 1:
PointS.Select(Polygon.b)
PointS.Select(Polygon.c)
elif PolyEdgeInd is 2:
PointS.Select(Polygon.c)
PointS.Select(Polygon.d)
elif PolyEdgeInd is 3:
PointS.Select(Polygon.d)
PointS.Select(Polygon.a)
PointS.CopyTo(op.GetPointS())
if __name__=='__main__':
main()