| Methods: |
| getAction |
setBlendin |
| getBlendin |
setBlendtime |
| getContinue |
setChannel |
| getEnd |
setContinue |
| getFrame |
setEnd |
| getFrameProperty |
setFrame |
| getPriority |
setFrameProperty |
| getProperty |
setPriority |
| getStart |
setProperty |
| getType |
setStart |
| setAction |
setType |
|
Inherited
Methods: |
| getExecutePriority |
isA |
| getOwner |
setExecutePriority |
| getName |
---------- |
|
|
getAction
getAction()
Returns the
name of the action.
Return type: string
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the
actuator named Walk
act = controller.getActuator("Walk")
# get the
name of the action
action = act.getAction()
getBlendin
getBlendin()
Returns the
number of frames to be used when blending this action with
another.
Return type: float number
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the
actuator named Walk
act = controller.getActuator("Walk")
# get
number of frames used for the blendin
frames = act.getBlendin()
getContinue
getContinue()
Returns the status of the Action Actuator Continue button.
Return type:
Bool
1 = True:
Continue playing the the Action from the frame it was playing when the
actuator was turned off (State System).
0 = False:
Restart the
Action. Play it from the beginning.
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the
actuator named Walk
act = controller.getActuator("Walk")
#
Continue from last frame played or restart?
continue_action = act.getContinue()
getEnd
getEnd()
Returns the
number of the last frame of the action.
Return type: float number
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# get number of the last frame
endFrame = act.getEnd()
getFrame
getFrame()
Returns the
current frame number.
Return type: float number
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# get number of the current frame
frame = act.getFrame()
getFrameProperty
getFrameProperty()
Returns the name of the Frame Property.
(The Frame Property is the object property that holds the current frame
number of the action being played.)
Return type: string
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the
actuator named Walk
act = controller.getActuator("Walk")
# get the
name the current frame property
name = act.getFrameProperty()
getPriority
getPriority()
Returns the
priority for this action
Return type: integer
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# get the priority
priority = act.getPriority()
getProperty
getProperty()
Returns the
name of the property.
If there isn't a property, getProperty() will return an empty string.
Return type: string
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# get name of the property
name = act.getProperty()
getStart
getStart()
Returns the starting frame of the action.
Return type: float number.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# get number of starting frame
startFrame = act.getStart()
getType
getType()
Returns the action playback type
Return type: integer
0 =
KX_ACTIONACT_PLAY
1 =
2 = KX_ACTIONACT_FLIPPER
3 = KX_ACTIONACT_LOOPSTOP
4 = KX_ACTIONACT_LOOPEND
5 =
6 = KX_ACTIONACT_PROPERTY
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
actuator = controller.getActuator("Walk")
# get playback type
actionType = actuator.getType()
setAction
setAction(action, reset = True)
Sets the name of the action.
action:
Type:
string
reset:
Type: bool
True or 1 resets the blend timer.
False or 0 leaves it unchanged.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set action
act.setAction("WalkCycle", True)
# use it
GameLogic.addActiveActuator(act, True)
Example Blend
setBlendin
setBlendin(blendin)
Sets the number of frames to be used when blending this action with
another.
blendin:
Type:
float number
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set blendin frames
act.setBlendin(5.0)
setBlendtime
setBlendtime(blendtime)
Sets the internal frame timer.
blendtime:
Type:
float number.
Range is 0.0 to 1.0
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set Blendtime
act.setBlendtime(0.5)
setChannel
setChannel(channel, matrix, mode = False)
Sets the bone channel.
channel:
Type:
string.
Name of the bone channel
matrix:
Type: 4x4
matrix. (float values)
mode:
Type: bool.
True
or 1= armature/world space.
False or 0 = bone space
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set the channel
act.setChannel("channel", matrix, False)
setContinue
setContinue(set)
Sets the action actuator Continue button.
set:
Type:
Bool
1 or True:
0 or False:
True = Continue
playing the the Action from the frame it was playing when the actuator
was turned off (State System).
False = Restart the Action. Play it from the beginning.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# Set it to Continue from last frame played
act.setContinue(True)
setEnd
setEnd(end)
Sets the end frame of the action
end:
Type:
float number.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set the end
act.setEnd(15.0)
setFrame
setFrame(frame)
Sets the current frame for the action.
frame:
Type:
float number.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set the frame
act.setFrame(12.0)
setFrameProperty
setFrameProperty(propName)
Sets the name of the Frame Property.
(The Frame Property
is the object property that holds the current frame number of the
action being played.)
Type: string
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set the name of the frame property
act.setFrameProperty()
setPriority
setPriority(priority)
Sets the priority for this action.
priority:
Type:
integer.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set priority
act.setPriority(1)
setProperty
setProperty(prop)
Sets the name of the property to be used when Property is the Action
Playback Type.
prop:
Type:
string
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set name of the property
act.setProperty("prop")
setStart
setStart(start)
Sets the starting frame
start:
Type:
float number.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set start frame
act.setStart(10.0)
setType
setType(operationmode)
Sets the action playback type.
operationmode:
Type:
integer
0 = KX_ACTIONACT_PLAY
1 =
2 = KX_ACTIONACT_FLIPPER
3 = KX_ACTIONACT_LOOPSTOP
4 = KX_ACTIONACT_LOOPEND
5 =
6 = KX_ACTIONACT_PROPERTY
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named Walk
act = controller.getActuator("Walk")
# set playback type
act.setType(0)
getExecutePriority
getExecutePriority()
Gets the execute priority of the logic brick
Return Type: integer
Doesn't
work:
Crashes Blender
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named act
act = controller.getActuator("act")
# get brick priority
priority = act.getExecutePriority()
getOwner
getOwner()
Gets the game object that owns the logic brick.
Return Type: KX_GameObject
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named act
act = controller.getActuator("act")
# get brick owner
owner = act.getOwner()
setExecutePriority
setExecutePriority(priority)
Sets the execution priority of the logic brick.
priority:
Type: integer
0 is first
1 is second
etc.
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator named act
act = controller.getActuator("act")
# set brick priority to be first
act.setExecutePriority(0)
isA
isA(Type)
Checks the Object type.
(KX_GameObject,
SCA_ILogicBrick, KX_Scene, etc.)
Type: String
Return Type: Bool
1 = True
0 = False
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get the object controller attached to
owner = controller.getOwner()
# is owner a GameObject?
gameObject = owner.isA("KX_GameObject")
getName
getName()
Returns the name of actuator
Return Type: string
Sample Code
# get the controller
controller = GameLogic.getCurrentController()
# get a list of the attached actuators
actList = controller.getActuators()
# loop through the list of actuators
for act in actList:
# look for an
actuator named "RocketMotion"
if act.getName() ==
"RocketMotion":
# use it
GameLogic.addActiveActuator(act,
True)
# Done.
Break out of loop
break
|