繁体   English   中英

如何在Blender Python中为ShapeKey设置值?

[英]how do I set a value for a ShapeKey in Blender Python?

我设法使用以下命令从Python插入了形状键:

ob = Scene.GetCurrent().object.active;
if(ob.activeShape == 0):
   ob.insertShapeKey()
   ob.insertShapeKey()

现在如何更改键值?

好的,这是我的做法:

#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))

就是这样。 插入的第一个ShapeKey创建“ Basis”,然后添加键,“ Key 1”是默认名称

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM