Does anyone else sleep on algorithms?
I know what I gotta do next, with this C/Python integration, but it feels like I gotta let it sit for a little while?
I know what I gotta do next, with this C/Python integration, but it feels like I gotta let it sit for a little while?
I’d gladly share what I’ve learned, if anyone’s interested.
This is surely hell.
Computers v. Developers
I didn’t know I had access to curses! Shit!
I can build Blender. I am your god.
#ifdef __cplusplus
#include <map>
#include <vector>
struct BL_FramePropertyPair {
CValue* property;
} BL_FramePropertyPair;
class BL_ActionGameLogic {
public:
BL_ActionGameLogic();
void wilma(int);
void apply_properties(int frame, KX_GameObject* go);
private:
std::map<int, std::vector<BL_FramePropertyPair>> frame;
};
#else
typedef
struct BL_ActionGameLogic
Fred;
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__STDC__) || defined(__cplusplus)
extern void c_function(BL_ActionGameLogic*); /* ANSI C prototypes */
extern Fred* cplusplus_callback_function(BL_ActionGameLogic*);
extern void add_property(BL_ActionGameLogic* agl);
extern void remove_property(BL_ActionGameLogic* agl);
#else
extern void c_function(); /* K&R style */
extern Fred* cplusplus_callback_function();
#endif
#ifdef __cplusplus
}
#endif
I’m looking at bAction, and it appears to be the object I want:
/* Action - reusable F-Curve 'bag' (act)
*
* This contains F-Curves that may affect settings from more than one ID blocktype and/or
* datablock (i.e. sub-data linked/used directly to the ID block that the animation data is linked to),
* but with the restriction that the other unrelated data (i.e. data that is not directly used or linked to
* by the source ID block).
*
* It serves as a 'unit' of reusable animation information (i.e. keyframes/motion data), that
* affects a group of related settings (as defined by the user).
*/
typedef struct bAction {
ID id; /* ID-serialisation for relinking */
ListBase curves; /* function-curves (FCurve) */
ListBase chanbase; /* legacy data - Action Channels (bActionChannel) in pre-2.5 animation system */
ListBase groups; /* groups of function-curves (bActionGroup) */
ListBase markers; /* markers local to the Action (used to provide Pose-Libraries) */
int flag; /* settings for this action */
int active_marker; /* index of the active marker */
int idroot; /* type of ID-blocks that action can be assigned to (if 0, will be set to whatever ID first evaluates it) */
int pad;
} bAction;
Unlike every other animation-object I’ve found, it doesn’t reference anything complex. ListBase is just an abstraction for vectors and such, since bAction is just C, as far as I can tell.
What’s intriguing is that Action Actuators hold a pointer to a bAction object, and that referenced object is used as a defining component of the actuator’s update-method. Now look at the following snippet of the Action Actuator’s method, Update():
// Handle a frame property if it's defined
if ((m_flag & ACT_FLAG_ACTIVE) && m_framepropname[0] != 0)
{
CValue* oldprop = obj->GetProperty(m_framepropname);
CValue* newval = new CFloatValue(obj->GetActionFrame(m_layer));
if (oldprop)
oldprop->SetValue(newval);
else
obj->SetProperty(m_framepropname, newval);
newval->Release();
}
What this shows is that the actuator can pretty easily modify a property in the object to which it is attached. Combining everything so far, there’s a very simple I shouldn’t watch videos while typing articles. Data stored within an action meant solely for game logic can reasonably be accessed and applied as a keyframe is reached without causing any interference to the established system of animation.
That’s what I was getting at.
There are still a few questions, however:
It’s not a mountain of inquiries by any stretch, but hey. Anyway, I’m gonna lie down for a while. I think I caught another cold.
Waha! I think I found the keyframe object! It’s 4 in the morning! I’m going the fuck to sleep!
Need help making games? websites? mafia hits? I'll help you do it more simply. There's a lot of nonsense out there in development, and I've got as little patience for it as you. My focus is, right now:
On this site, you'll find a mix of detailed tutorials and quick tips to keep from losing nights to stupid hiccups. Along the way, I will spam fanart and digressions regarding modern survivalism, personal projects, and tales of my antagonizing the animal kingdom.
WARNING: the author of this blog has an unhealthy interest in women, and it is periodically reflected in the content shared. Most of the sick displays will be safe for work.
loading tweets…