On 19/02/2017 at 07:17, xxxxxxxx wrote:
Hello,
I've been thinking of trying to make my own version of UberTracer, using a Python Generator object, since that plugin no longer works with the new versions of C4D.
I recently saw this tutorial on generating spline connections http://www.entagma.com/creating-geometry-with-python-in-c4d/
However, I wanted to understand this further, in the tutorial, the point data is put into an array which is then set via SetAllPoints(array)
This seems to work fine since P Pass AB is sorting out the distance and point order, I assume avoiding duplicate/overlapping connections.
My question is, what if you wanted to work with just one spline object, how do you create a path between two points, close it and start a new path? especially if you have multiple paths originating from the same point.
One way I think would be to use the approach used in the tutorial, but add an additional command to connect and delete after creation, but this seems like an inefficient approach, esp if you want to work with animated point positions. Can anyone help, give any tips on what commands could help with this?
I made a bit of progress, I assume I will need to use "SplineObject.ResizeObject(pcnt[, scnt=-1])"
I assume this function would be able to define multiple separate connected segments in one spline object. Not considered yet how it would decide to which points the segments are allocated, also assuming segment does mean a sequence of connected points.
My immediate problem is that I have no idea why there is a comma next to an open square bracket.
I'm going to assume that's a typo, but why are there square brackets there at all? I've been googling hard.. at the moment I'm just trying to see if I can generate a spline at all, sometimes it works, then it breaks without me having changed anything, giving the following error:
ReferenceError: the object 'c4d.SplineObject' is not alive
my script: https://www.dropbox.com/s/gqwsl636ouv2i9c/tracem8_v001.c4d?dl=0
once I can get this working (generating the spline without the not alive error), then I have a plan of action for iterating through the points to do distance based connection, but that's all pointless (heh heh) if I can't figure out these basic issues..