Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hello,
I'm trying to get access to the result of a spline that has been deformed by a Bend. I've attached a scene file with a cloner mimicking the behavior I want to achieve, but I haven't been able to do it yet.
Using GetCache().GetDeformCache() isn't returning just the four points of the circle and I'm not sure another way to get a deformed spline. This seems like it would be rather simple but I'm not sure where to proceed.
Deformed Circle.c4d
Johan
Hi Johan, thanks for reaching out us.
With regard to your request, I warmly suggest to have a look at:
A first attempt to make it work should look like this:
import c4d def DoRecursion(op, index): tp = op.GetDeformCache() if tp is not None: DoRecursion(tp, index) else: tp = op.GetCache() if tp is not None: DoRecursion(tp, index) else: if not op.GetBit(c4d.BIT_CONTROLOBJECT): if op.IsInstanceOf(c4d.Opoint): for i in index: print "\t\t", op.GetAllPoints()[i] tp = op.GetDown() while tp is not None: DoRecursion(tp, index) tp = tp.GetNext() # Main function def main(): # get the real spline representation realSpline = op.GetRealSpline() if realSpline is None: return # allocate a SplineHelp instance and init it with the real spline splineH = c4d.utils.SplineHelp() splineH.InitSplineWith(realSpline) # get the spline points and store its length splinePnts = realSpline.GetAllPoints() splinePntsCnt = len(splinePnts) # allocate a list to store the correspondance between the spline points and the one belonging to its line representation pntIndxInLine = [] for i in xrange(splinePntsCnt): pntIndxInLine.append(splineH.GetPointIndex(i, 0)/splinePntsCnt) # recurse over the geometry to look for its cache DoRecursion(op, pntIndxInLine) # free the SplineHelp instance splineH.FreeSpline() # Execute main() if __name__=='__main__': main()
Best, Riccardo
Thanks for the reply, it really helped me out.
John