Commit Graph

140 Commits

Author SHA1 Message Date
Mitchell Stokes
ee5284faf6 BGE: Dynamically-allocated action layers
This patch removes the limitations on the number of action layers in the BGE.

BL_ActionManager currently uses a fixed array to keep track of the action layers. This patch replaces the fixed array with a map which allows for dynamic allocation of action layers. Layers (map items) are automatically removed on BL_ActionManager's update function. The maximum number of layers is roughly the value of a short. Backwards functionality is maintained and there are no changes to the Python API.

Task Discussion:
https://developer.blender.org/T39572

Author: Kevin Ednalino

Reviewers: moguri

Differential Revision: https://developer.blender.org/D491
2014-05-07 20:32:50 -07:00
Mitchell Stokes
d8282da545 Correction to last commit 2014-04-28 16:33:26 -07:00
Mitchell Stokes
3448822b2f Fix T39614: Ping Pong Action doesn't work correctly 2014-04-28 16:24:40 -07:00
Mitchell Stokes
fe05f97841 BGE: Multi-threading animation updates and skinning.
This required BL_ArmatureObject to have tighter control over armatures and poses.
Also, (Blender) armature objects are now copied instead of shared between
BL_ArmatureObjects to avoid race conditions. Also, due to the armature copy,
shape key drivers need a bit of extra fiddling to get the correct armature copy.

Initially OpenMP was used for threading, but then BLI_task was used due to being
less compiler dependent.

This commit also places time spent on skinning updates in the Animation
profiler category (was previously under the Rasterizer category).
2014-04-06 16:30:59 -07:00
Mitchell Stokes
196d30e004 BGE: The Action Actuator can now make use of additive blending. 2013-08-14 23:32:00 +00:00
Mitchell Stokes
76ee6d3fc5 BGE: Applying patch [#35416] "Missing python properties on ActionActuator: layer, layerWeight" from Florian Bantner (scheintodx). 2013-05-19 03:15:50 +00:00
Campbell Barton
64d161de87 style cleanup:
also rename mesh_getVertexCos() --> BKE_mesh_vertexCos_get() to match curve function.
2013-03-26 07:29:01 +00:00
Campbell Barton
e1a54214bb code cleanup:
- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style
2013-03-25 02:41:30 +00:00
Campbell Barton
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
Campbell Barton
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
Campbell Barton
2fb8292005 style cleanup 2012-09-16 04:58:18 +00:00
Mitchell Stokes
9d900fdd11 Fix for [#32213] "Action actuator doesn't finish playing if frame rate drops" reported by Alex Fraser (z0r). The action actuator was calling StopAction when it's time ran out. Now I'm just letting BL_Action handle stopping. Hopefully this doesn't break something else now.... 2012-07-29 06:28:50 +00:00
Mitchell Stokes
8f1666ee56 BGE: A better fix for using the Action Actuator with the Actuator Sensor. This one still allows frame properties to be updated after receiving a negative pulse. This also fixes bug [#32179] "Action Actuator in Loop End stops updating the Frame Property after no longer receives positive signal" reported by Dalai. 2012-07-25 04:29:48 +00:00
Mitchell Stokes
4f6cc9a9aa BGE: The Action Actuator now returns correct values to work with the Actuator Sensor. 2012-07-16 03:43:57 +00:00
Mitchell Stokes
ecc15e53bd Removing channel manipulation from the Action Actuator Python API since this has been broken since the animation changes from Pepper. BL_ArmatureObject.channels should be used instead. For more information see bug #28843 for more info:
http://projects.blender.org/tracker/index.php?func=detail&aid=28843&group_id=9&atid=306
2012-06-28 06:22:47 +00:00
Campbell Barton
1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
Campbell Barton
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
Campbell Barton
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
Campbell Barton
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
Campbell Barton
3fc2fbc333 style cleanup, use { on newline after function definition.
spelling 'impliment' -> 'implement'
2012-02-25 16:49:59 +00:00
Mitchell Stokes
62963525ce Fix for "[#29911] Crash on reading BL_ActionActuator.channelNames"
The crash occurred when an action actuator was attached to a non-armature object because objects that aren't armatures do not have pose data. A NotImplementedError is now raised if someone tries to access any of the following with an action actuator attached to a non-armature object:

BL_ActionActuator.channelNames
BL_ActionActuator.getChannel()
BL_ActionActuator.setChannel()
2012-01-22 23:15:35 +00:00
Campbell Barton
fb4ad50cee use defines for property name lenghths in the BGE, were using 31,32,64,100. 2012-01-16 05:27:11 +00:00
Campbell Barton
6d965f4493 style edits for function declarations 2011-12-30 07:55:15 +00:00
Mitchell Stokes
f94614d791 BGE Animations: Getting the Action Actuator to behave better with pulse mode (on the sensor) and continuous enabled. 2011-11-23 23:29:36 +00:00
Campbell Barton
ec3b0c6a96 misc macro --> bli math lib functions 2011-11-06 15:17:43 +00:00
Campbell Barton
665f602f15 python string conversion
- use _PyUnicode_AsStringAndSize where possible
- use %R for PyErr_Format(...) rather then running repr on the object explicitly 
- use const char
2011-11-03 14:09:18 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Mitchell Stokes
58a74bc87f BGE Animations: Fixing various Action Actuator compatibility issues reported by Dalai in issue #28723. 2011-09-25 07:03:20 +00:00
Mitchell Stokes
103b06d4df BGE animations: fixing initialization order issues for BL_ActionActuator and BL_ArmatureObject. Thanks to z0r for pointing them out and providing a fix. 2011-09-04 01:42:47 +00:00
Mitchell Stokes
8295480bbe BGE animations: Fixing a crash that would happen if the property for a property mode action actuator was invalid. 2011-09-03 19:33:07 +00:00
Mitchell Stokes
99d5fa70de BGE animations: This is an attempt to help smooth out some more compatibility issues with the new action actuator. It now has a similar pulse behavior to the old actuator. This has worked well in most of my tests, but YoFrankie still has problems, and it appears to have gotten a little worse. 2011-09-01 21:47:46 +00:00
Mitchell Stokes
296cc41b03 BGE Animations: Various changes to make code reviewers happy:
* Naming/style changes
  * Taking advantage of switch statements
  * Removing unneeded NULL checks
  * etc
2011-08-29 06:19:55 +00:00
Mitchell Stokes
17e88915fd BGE Animations: Updating BL_ActionActuator.frame to work with the new actuator. 2011-08-11 03:27:47 +00:00
Mitchell Stokes
7707140fd1 BGE Animations: Always update the localtime used for continuous animations. Previously this was only done on a positive or negative pulse, which could lead to some issues with a continuous flipper animation. 2011-08-10 20:05:30 +00:00
Mitchell Stokes
88786f6fca BGE Animations: Fixing the Continue option when using the Flipper play type. Also removing a couple of debug prints. 2011-08-09 03:06:22 +00:00
Mitchell Stokes
8883702f8a BGE Animations: Various compatibility fixes:
* Blendin for Loop End works even after a negative pulse. Flipper could still use some work in this area.
  * Continuous works a lot better.
  * BL_Action::SetFrame() should work a little smoother.
2011-08-08 04:28:30 +00:00
Mitchell Stokes
7e0049d27a BGE Animations: Making the ping pong mode for action actuators behave more like trunk. The behavior is a lot closer, but there are still differences when interrupting a ping pong action. I'm still trying to decide if these are acceptable differences as they don't look all that simple to fix. 2011-08-06 00:35:16 +00:00
Mitchell Stokes
0eacdc94ba BGE Animations: Removing unused code and adding some more comments. 2011-07-07 03:53:24 +00:00
Mitchell Stokes
ceabc6d119 BGE Animations: Various fixes and bits of cleanup to get the action actuator to behave more like it did in trunk. The Pepper version is still more sensitive to pulses than the trunk version, but this is more accurate. I might try to address this, but I'm not sure. 2011-07-05 05:22:02 +00:00
Mitchell Stokes
46d12b480e BGE Animations: Making the action actuator's loop end play mode work better. 2011-07-03 02:57:50 +00:00
Mitchell Stokes
5d7921691b BGE Animations: Reimplementing support for the "Flipper" play mode of the action actuator. 2011-07-03 02:51:14 +00:00
Mitchell Stokes
5f4f75c51a BGE Animations: Adding in layer weights to allow for layer blending. 2011-07-03 01:59:17 +00:00
Mitchell Stokes
b4b26b735c BGE Animations: Fixing a bug where an action actuator could update a frame property when it wasn't active. 2011-06-30 20:08:05 +00:00
Mitchell Stokes
d122f24c1a BGE Animations: Fixing a bug with priority and non continuous animations. 2011-06-29 01:53:17 +00:00
Mitchell Stokes
f1a2d46aa0 BGE Animations: Adding the concept of priority back. Priority is handled on a per layer basis. 2011-06-23 22:12:49 +00:00
Mitchell Stokes
0fbca841ef BGE Animations: Making the play modes for the Acton Actuator behave more like they have in the past. The only one that still needs work now is Flipper. Property, Loop End, Loop Stop, Play, and Ping Pong should all now be behaving as they used to. 2011-06-23 22:00:54 +00:00
Joerg Mueller
207911bdb3 Merge with trunk r37677 2011-06-20 22:55:18 +00:00
Mitchell Stokes
65af1dcecd BGE Animations: Making sure the Action Actuator has a valid action before attempting to play. 2011-06-16 01:59:50 +00:00
Mitchell Stokes
c02006bc2b BGE Animations: Adding the ipo flag options to the action actuator. This still needs more testing. 2011-06-16 01:18:52 +00:00
Campbell Barton
08c155845d remove unused arguments 2011-06-15 14:06:25 +00:00