【问题标题】:how do I set a value for a ShapeKey in Blender Python?如何在 Blender Python 中为 ShapeKey 设置值?
【发布时间】:2011-03-07 12:03:59
【问题描述】:

我已经设法从 Python 插入形状键:

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

现在如何更改键值?

【问题讨论】:

    标签: python 3d blender bpython bpy


    【解决方案1】:

    好的,我就是这样做的:

    #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 创建“基础”,然后添加键, “键 1”是默认名称

    【讨论】:

      猜你喜欢
      • 2011-03-15
      • 2016-07-07
      • 1970-01-01
      • 2010-12-24
      • 1970-01-01
      • 1970-01-01
      • 2011-03-18
      • 2014-11-04
      • 2022-12-01
      相关资源
      最近更新 更多