Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NLA.py « doc « api2_2x « python « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1de1cdad57762bb32c61c6842ba603281f59793d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Blender.Armature.NLA module and the Action PyType object

"""
The Blender.Armature.NLA submodule.

NLA
===

This module provides access to B{Action} objects in Blender.  Actions are a series of keyframes/Ipo curves
that define the movement of a bone. Actions are linked to objects of type armature.

Example::
  import Blender
  from Blender import *
  from Blender.Armature import *
  from Blender.Armature.Bone import *

  armObj = Object.New('Armature', "Armature_obj")
  armData = Armature.New()

  bn1=Blender.Armature.Bone.New("bone1")
  bn1.setHead(0.0,0.0,0.0)
  bn1.setTail(2.0,1.0,0.0)

  bn2=Blender.Armature.Bone.New("bone2")
  bn2.setHead(3.0,2.0,1.0)
  bn2.setTail(4.0,4.0,1.0)
  bn2.setRoll(.5)
  bn2.setParent(bn1)

  armData.addBone(bn1)
  armData.addBone(bn2)

  armObj.link(armData)
  scn = Blender.Scene.getCurrent()
  scn.link(armObj)

  armObj.makeDisplayList()
  Blender.Window.RedrawAll()

  action = Blender.Armature.NLA.NewAction()
  action.setActive(armObj)
  
  bn2.setPose([ROT,LOC,SIZE])  
  
  context = scn.getRenderingContext()
  context.currentFrame(2)

  quat = Blender.Mathutils.Quaternion([1,2,3,4])
  bn2.setQuat(quat)
  bn2.setLoc([3,4,5])
  
  bn2.setPose([ROT,LOC,SIZE])

  print action.name
  action2 = Blender.Armature.NLA.CopyAction(action)
  action2.name = "Copy"
"""

def NewAction  (name = 'DefaultAction'):
  """
  Create a new Action object.
  @type name: string
  @param name: The Action name.
  @rtype: PyAction
  """
  
def CopyAction (action):
  """
  Copy an action and it's keyframes
  @type action: PyAction
  @param action: The action to be copied.
  @rtype: PyAction
  @return: A copied action
  """

def GetActions ():
  """
  Get all actions and return them as a Key : Value Dictionary.
  @rtype: Dictionary of PyActions
  @return: All the actions in blender
  """
  
class Action:
  """
  The Action object
  =================
    This object gives access to Action-specific data in Blender.
  """

  def getName():
    """
    Get the name of this Action.
    @rtype: string
    """
    
  def setName(name):
    """
    Set the name of this Action.
    @type name: string
    @param name: The new name
    """
    
  def setActive(object):
    """
    Set this action as the current action for an object.
    @type object: PyObject 
    @param object: The object whose action is to be set
    """
    
  def getChannelIpo(channel):
    """
    Get the Ipo for the named channel in this action
    @type channel: string
    @param channel: The name of a channel in this action
    @rtype: PyIpo
    @return: the Ipo for the channel
    """
    
  def removeChannel(channel):
    """
    Remove a named channel from this action
    @type channel: string
    @param channel: The name of a channel in this action to be removed
    """
    
  def getAllChannelIpos():
    """
    Get the all the Ipos for this action
    @rtype: Dictionary [channel : PyIpo]
    @return: the Ipos for all the channels in the action
    """