[Bf-python] Blended Midi and 2.28 compatibility
jms
jmsoler at free.fr
Mon Jul 7 11:16:25 CEST 2003
John Harris wrote:
> I am working on updating the script to work with the new python, but I
> have hit a snag. The Ipo stuff is completly different and I haven't had
> any luck in my efforts to figure it out. Is there a sample of how to use
> it, or is any other project using it yet? Thanks John Harris.
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://www.blender.org/mailman/listinfo/bf-python
No problem with this script, may help:
#------------------
# repeat an IPO curve pattern
#------------------
import Blender
#objet name ['Plane',...]
objet=['Plane']
#['LocX','LocY','LocZ','dLocX','dLocY','dLocZ',...]
ipo=['LocX']
#'Vect','Free','Auto'
Vtype='Auto'
# repeat pattern n times
duplique=2
#loop on the objects names list
for o in objet:
#select objet
O=Blender.Object.Get(o)
#get IPO bloc
I=O.getIpo()
#bloc analysis
for i in ipo:
#curve traitement
for C in I.curves:
#comparison of curve name with the given list
# 'ipo'
if C.name==i:
#if the name is really in the list, get the last
# curve point
Dernier=C.bezierPoints[-1].pt[:]
Point=[]
#copy the curve pattern
for bz in C.bezierPoints:
Point.append([bz.pt[:],bz.h1[:],bz.h2[:],bz.h1t,bz.h2t])
#loop 'duplique' time
for t in range(duplique):
#add a point at the end of the curve
for bz in Point:
#...
C.addBezier((bz[0][0]+Dernier[0],bz[0][1]),Vtype)
#curve recal
Blender.Ipo.Recalc(C)
#Get pos of the last point to do it again
Dernier=C.bezierPoints[-1].pt[:]
Blender.Window.RedrawAll()
#end
Just a question: is it possible to add a SelectedPoints function in the
IPO bloc?
With regards,
jms
More information about the Bf-python
mailing list