On 19/11/2014 at 14:39, xxxxxxxx wrote:
I'm trying to create a spline that is made up of many segments.
In the first generation, it creates a simple spline. In the following generations, I was trying to perform a "Connect" command between the first spline created and the newly created ones.
It is not working. I only get a single spline :-(
Here is my code:
**
first=True
set an empty spline
old_branch_spline=c4d.BaseObject(c4d.Ospline)
old_branch_spline.ResizeObject(0)
for br in range(branches) :
# my spline calculation routine. It returns a list of vectors
spline_points=Calculate_Spline()
n_points=len(spline_points)
branch_spline=c4d.BaseObject(c4d.Ospline)
branch_spline.ResizeObject(n_points)
for i,pt in enumerate(spline_points) :
branch_spline.SetPoint(i,pt)
branch_spline.Message(c4d.MSG_UPDATE)
if first==True:
old_branch_spline=branch_spline.GetClone()
first=False
else:
result=utils.SendModelingCommand(command=c4d.MCOMMAND_JOIN,list=[branch_spline,old_branch_spline],mode=c4d.MODIFY_ALL,bc=c4d.BaseContainer())
if result is not False:
old_branch_spline=result[0]
**
What could be wrong. Any help would be great.
Rui Batista