Wie setze ich einen Wert für einen Shapekey in Blender Python?
Frage
Ich habe es geschafft, Formschlüsse aus Python einzufügen, indem ich:
ob = Scene.GetCurrent().object.active;
if(ob.activeShape == 0):
ob.insertShapeKey()
ob.insertShapeKey()
Wie ändere ich nun einen Schlüsselwert?
Lösung
Ok, so habe ich es gemacht:
#get the key
k = ob.getData().getKey()
#create a new Ipo
ni = Ipo.New('Key','ni')
#if there check if there already a key by that name, otherwise add key
if(k.ipo['Key 1'] == None): k.ipo.addCurve('Key 1')
#add a point to the 'Key 1' ipo curve
k.ipo['Key 1'].append(BezTriple.New(6.0,0.8,0.1))
Und das war schon. Der erste in Shapekey eingefügte erstellt "Basis", dann werden Schlüssel hinzugefügt, "Key 1" ist der Standardname
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow