Cleanup: Anim: convert cstyle-casts
Using clang-tidy "cppcoreguidelines-pro-type-cstyle-cast" to find them. This PR touches `bf_animrig` & `bf_editor_animation` & `bf_editor_armature` NOTE: Also some case where untouched (not straightforward) same as expanded macros (e.g. `LISTBASE` or `GS`) NOTE: a couple of cases of "inconsistent-declaration-parameter" as well Pull Request: https://projects.blender.org/blender/blender/pulls/136044
This commit is contained in:
committed by
Philipp Oeser
parent
e93c6e5f74
commit
e22ff684f3
@@ -1177,7 +1177,7 @@ class Channelbag : public ::ActionChannelbag {
|
||||
*
|
||||
* \see fcurve_detach
|
||||
*/
|
||||
void fcurve_detach_by_index(int64_t fcurve_array_index);
|
||||
void fcurve_detach_by_index(int64_t fcurve_index);
|
||||
|
||||
/**
|
||||
* Move the given fcurve to position `to_fcurve_index` in the fcurve array.
|
||||
|
||||
@@ -868,7 +868,7 @@ static float2 get_frame_range_of_fcurves(Span<const FCurve *> fcurves,
|
||||
switch (fcm->type) {
|
||||
case FMODIFIER_TYPE_LIMITS: /* Limits F-Modifier */
|
||||
{
|
||||
FMod_Limits *fmd = (FMod_Limits *)fcm->data;
|
||||
FMod_Limits *fmd = static_cast<FMod_Limits *>(fcm->data);
|
||||
|
||||
if (fmd->flag & FCM_LIMIT_XMIN) {
|
||||
min = min_ff(min, fmd->rect.xmin);
|
||||
@@ -880,7 +880,7 @@ static float2 get_frame_range_of_fcurves(Span<const FCurve *> fcurves,
|
||||
}
|
||||
case FMODIFIER_TYPE_CYCLES: /* Cycles F-Modifier */
|
||||
{
|
||||
FMod_Cycles *fmd = (FMod_Cycles *)fcm->data;
|
||||
FMod_Cycles *fmd = static_cast<FMod_Cycles *>(fcm->data);
|
||||
|
||||
if (fmd->before_mode != FCM_EXTRAPOLATE_NONE) {
|
||||
min = MINAFRAMEF;
|
||||
|
||||
@@ -50,7 +50,7 @@ static void add_object_data_users(const Main &bmain, const ID &id, Vector<ID *>
|
||||
Object *ob;
|
||||
ID *object_id;
|
||||
FOREACH_MAIN_LISTBASE_ID_BEGIN (&bmain.objects, object_id) {
|
||||
ob = (Object *)object_id;
|
||||
ob = reinterpret_cast<Object *>(object_id);
|
||||
if (ob->data != &id) {
|
||||
continue;
|
||||
}
|
||||
@@ -84,11 +84,11 @@ Vector<ID *> find_related_ids(Main &bmain, ID &id)
|
||||
/* No action found on current ID, add related IDs to the ID Vector. */
|
||||
switch (GS(related_id->name)) {
|
||||
case ID_OB: {
|
||||
Object *ob = (Object *)related_id;
|
||||
Object *ob = reinterpret_cast<Object *>(related_id);
|
||||
if (!ob->data) {
|
||||
break;
|
||||
}
|
||||
ID *data = (ID *)ob->data;
|
||||
ID *data = static_cast<ID *>(ob->data);
|
||||
if (ID_REAL_USERS(data) == 1) {
|
||||
related_ids.append_non_duplicates(data);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ Vector<ID *> find_related_ids(Main &bmain, ID &id)
|
||||
|
||||
case ID_KE: {
|
||||
/* Shape-keys. */
|
||||
Key *key = (Key *)related_id;
|
||||
Key *key = reinterpret_cast<Key *>(related_id);
|
||||
/* Shape-keys are not embedded but there is currently no way to reuse them. */
|
||||
BLI_assert(ID_REAL_USERS(related_id) == 1);
|
||||
related_ids.append_non_duplicates(key->from);
|
||||
@@ -115,7 +115,7 @@ Vector<ID *> find_related_ids(Main &bmain, ID &id)
|
||||
|
||||
case ID_MA: {
|
||||
/* Explicitly not relating materials and material users. */
|
||||
Material *mat = (Material *)related_id;
|
||||
Material *mat = reinterpret_cast<Material *>(related_id);
|
||||
if (mat->nodetree && ID_REAL_USERS(&mat->nodetree->id) == 1) {
|
||||
related_ids.append_non_duplicates(&mat->nodetree->id);
|
||||
}
|
||||
@@ -130,7 +130,7 @@ Vector<ID *> find_related_ids(Main &bmain, ID &id)
|
||||
ID *object_id;
|
||||
/* Find users of this particle setting. */
|
||||
FOREACH_MAIN_LISTBASE_ID_BEGIN (&bmain.objects, object_id) {
|
||||
ob = (Object *)object_id;
|
||||
ob = reinterpret_cast<Object *>(object_id);
|
||||
bool object_uses_particle_settings = false;
|
||||
LISTBASE_FOREACH (ParticleSystem *, particle_system, &ob->particlesystem) {
|
||||
if (!particle_system->part) {
|
||||
@@ -216,7 +216,7 @@ bAction *id_action_ensure(Main *bmain, ID *id)
|
||||
SNPRINTF(actname, DATA_("%sAction"), owner_id->name + 2);
|
||||
}
|
||||
else if (GS(id->name) == ID_KE) {
|
||||
Key *key = (Key *)id;
|
||||
Key *key = reinterpret_cast<Key *>(id);
|
||||
SNPRINTF(actname, DATA_("%sAction"), key->from->name + 2);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -160,10 +160,10 @@ static void bonecoll_insert_at_index(bArmature *armature, BoneCollection *bcoll,
|
||||
{
|
||||
BLI_assert(index <= armature->collection_array_num);
|
||||
|
||||
armature->collection_array = (BoneCollection **)MEM_reallocN_id(
|
||||
armature->collection_array,
|
||||
sizeof(BoneCollection *) * (armature->collection_array_num + 1),
|
||||
__func__);
|
||||
armature->collection_array = reinterpret_cast<BoneCollection **>(
|
||||
MEM_reallocN_id(armature->collection_array,
|
||||
sizeof(BoneCollection *) * (armature->collection_array_num + 1),
|
||||
__func__));
|
||||
|
||||
/* To keep the memory consistent, insert the new element at the end of the
|
||||
* now-grown array, then rotate it into place. */
|
||||
|
||||
@@ -394,7 +394,8 @@ static float2 remap_cyclic_keyframe_location(const FCurve &fcu,
|
||||
|
||||
if (type == FCU_CYCLE_OFFSET) {
|
||||
/* Nasty check to handle the case when the modes are different better. */
|
||||
FMod_Cycles *data = static_cast<FMod_Cycles *>(((FModifier *)fcu.modifiers.first)->data);
|
||||
FMod_Cycles *data = static_cast<FMod_Cycles *>(
|
||||
static_cast<FModifier *>(fcu.modifiers.first)->data);
|
||||
short mode = (step >= 0) ? data->after_mode : data->before_mode;
|
||||
|
||||
if (mode == FCM_EXTRAPOLATE_CYCLIC_OFFSET) {
|
||||
|
||||
@@ -388,7 +388,7 @@ static int insert_key_to_keying_set_path(bContext *C,
|
||||
switch (GS(keyingset_path->id->name)) {
|
||||
case ID_OB: /* Object (or Object-Related) Keyframes */
|
||||
{
|
||||
Object *ob = (Object *)keyingset_path->id;
|
||||
Object *ob = reinterpret_cast<Object *>(keyingset_path->id);
|
||||
|
||||
/* XXX: only object transforms? */
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
|
||||
|
||||
@@ -67,7 +67,7 @@ void pose_apply(Object *ob,
|
||||
return;
|
||||
}
|
||||
|
||||
const bArmature *armature = (bArmature *)ob->data;
|
||||
const bArmature *armature = static_cast<bArmature *>(ob->data);
|
||||
const blender::bke::BoneNameSet selected_bone_names =
|
||||
blender::bke::BKE_armature_find_selected_bone_names(armature);
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
|
||||
|
||||
/* nodetree animdata */
|
||||
if (GS(ale->id->name) == ID_NT) {
|
||||
offset += acf_nodetree_rootType_offset((bNodeTree *)ale->id);
|
||||
offset += acf_nodetree_rootType_offset(reinterpret_cast<bNodeTree *>(ale->id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
|
||||
/* name for ID block entries */
|
||||
static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
ID *id = (ID *)ale->data; /* data pointed to should be an ID block */
|
||||
ID *id = static_cast<ID *>(ale->data); /* data pointed to should be an ID block */
|
||||
|
||||
/* just copy the name... */
|
||||
if (id && name) {
|
||||
@@ -484,12 +484,12 @@ static void *acf_summary_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
bAnimContext *ac = (bAnimContext *)ale->data;
|
||||
bAnimContext *ac = static_cast<bAnimContext *>(ale->data);
|
||||
|
||||
/* If data is valid, return pointer to active dope-sheet's relevant flag
|
||||
* - this is restricted to DopeSheet/Action Editor only. */
|
||||
if ((ac->sl) && (ac->spacetype == SPACE_ACTION) && (setting == ACHANNEL_SETTING_EXPAND)) {
|
||||
SpaceAction *saction = (SpaceAction *)ac->sl;
|
||||
SpaceAction *saction = reinterpret_cast<SpaceAction *>(ac->sl);
|
||||
bDopeSheet *ads = &saction->ads;
|
||||
|
||||
/* return pointer to DopeSheet's flag */
|
||||
@@ -590,7 +590,7 @@ static void *acf_scene_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Scene *scene = (Scene *)ale->data;
|
||||
Scene *scene = static_cast<Scene *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -639,7 +639,7 @@ static bAnimChannelType ACF_SCENE = {
|
||||
|
||||
static int acf_object_icon(bAnimListElem *ale)
|
||||
{
|
||||
Base *base = (Base *)ale->data;
|
||||
Base *base = static_cast<Base *>(ale->data);
|
||||
Object *ob = base->object;
|
||||
|
||||
/* icon depends on object-type */
|
||||
@@ -684,7 +684,7 @@ static int acf_object_icon(bAnimListElem *ale)
|
||||
/* name for object */
|
||||
static void acf_object_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
Base *base = (Base *)ale->data;
|
||||
Base *base = static_cast<Base *>(ale->data);
|
||||
Object *ob = base->object;
|
||||
|
||||
/* just copy the name... */
|
||||
@@ -707,7 +707,7 @@ static bool acf_object_setting_valid(bAnimContext *ac,
|
||||
bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting)
|
||||
{
|
||||
Base *base = (Base *)ale->data;
|
||||
Base *base = static_cast<Base *>(ale->data);
|
||||
Object *ob = base->object;
|
||||
|
||||
switch (setting) {
|
||||
@@ -768,7 +768,7 @@ static void *acf_object_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Base *base = (Base *)ale->data;
|
||||
Base *base = static_cast<Base *>(ale->data);
|
||||
Object *ob = base->object;
|
||||
|
||||
/* Clear extra return data first. */
|
||||
@@ -854,7 +854,7 @@ static void acf_group_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc
|
||||
/* name for group entries */
|
||||
static void acf_group_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
|
||||
/* just copy the name... */
|
||||
if (agrp && name) {
|
||||
@@ -943,7 +943,7 @@ static void *acf_group_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
|
||||
/* all flags are just in agrp->flag for now... */
|
||||
return GET_ACF_FLAG_PTR(agrp->flag, r_type);
|
||||
@@ -1058,7 +1058,7 @@ static void acf_fcurve_name(bAnimListElem *ale, char *name)
|
||||
/* "name" property for fcurve entries */
|
||||
static bool acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
/* Ctrl-Click Usability Convenience Hack:
|
||||
* For disabled F-Curves, allow access to the RNA Path
|
||||
@@ -1135,7 +1135,7 @@ static void *acf_fcurve_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
/* all flags are just in agrp->flag for now... */
|
||||
return GET_ACF_FLAG_PTR(fcu->flag, r_type);
|
||||
@@ -1254,7 +1254,7 @@ static void *acf_nla_controls_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
AnimData *adt = (AnimData *)ale->data;
|
||||
AnimData *adt = static_cast<AnimData *>(ale->data);
|
||||
|
||||
/* all flags are just in adt->flag for now... */
|
||||
return GET_ACF_FLAG_PTR(adt->flag, r_type);
|
||||
@@ -1570,7 +1570,7 @@ static void *acf_fillactd_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
bAction *act = (bAction *)ale->data;
|
||||
bAction *act = static_cast<bAction *>(ale->data);
|
||||
AnimData *adt = ale->adt;
|
||||
|
||||
/* Clear extra return data first. */
|
||||
@@ -1664,7 +1664,7 @@ static void *acf_filldrivers_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
AnimData *adt = (AnimData *)ale->data;
|
||||
AnimData *adt = static_cast<AnimData *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -1739,7 +1739,7 @@ static void *acf_dsmat_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Material *ma = (Material *)ale->data;
|
||||
Material *ma = static_cast<Material *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -1822,7 +1822,7 @@ static void *acf_dslight_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Light *la = (Light *)ale->data;
|
||||
Light *la = static_cast<Light *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -1912,7 +1912,7 @@ static void *acf_dstex_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Tex *tex = (Tex *)ale->data;
|
||||
Tex *tex = static_cast<Tex *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -1998,7 +1998,7 @@ static void *acf_dscachefile_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
CacheFile *cache_file = (CacheFile *)ale->data;
|
||||
CacheFile *cache_file = static_cast<CacheFile *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2085,7 +2085,7 @@ static void *acf_dscam_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Camera *ca = (Camera *)ale->data;
|
||||
Camera *ca = static_cast<Camera *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2134,7 +2134,7 @@ static bAnimChannelType ACF_DSCAM = {
|
||||
/* TODO: just get this from RNA? */
|
||||
static int acf_dscur_icon(bAnimListElem *ale)
|
||||
{
|
||||
Curve *cu = (Curve *)ale->data;
|
||||
Curve *cu = static_cast<Curve *>(ale->data);
|
||||
short obtype = BKE_curve_type_get(cu);
|
||||
|
||||
switch (obtype) {
|
||||
@@ -2179,7 +2179,7 @@ static void *acf_dscur_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Curve *cu = (Curve *)ale->data;
|
||||
Curve *cu = static_cast<Curve *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2281,7 +2281,7 @@ static void *acf_dsskey_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Key *key = (Key *)ale->data;
|
||||
Key *key = static_cast<Key *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2364,7 +2364,7 @@ static void *acf_dswor_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
World *wo = (World *)ale->data;
|
||||
World *wo = static_cast<World *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2447,7 +2447,7 @@ static void *acf_dspart_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
ParticleSettings *part = (ParticleSettings *)ale->data;
|
||||
ParticleSettings *part = static_cast<ParticleSettings *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2530,7 +2530,7 @@ static void *acf_dsmball_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
MetaBall *mb = (MetaBall *)ale->data;
|
||||
MetaBall *mb = static_cast<MetaBall *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2613,7 +2613,7 @@ static void *acf_dsarm_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
bArmature *arm = (bArmature *)ale->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2667,7 +2667,7 @@ static int acf_dsntree_icon(bAnimListElem * /*ale*/)
|
||||
/* offset for nodetree expanders */
|
||||
static short acf_dsntree_offset(bAnimContext *ac, bAnimListElem *ale)
|
||||
{
|
||||
bNodeTree *ntree = (bNodeTree *)ale->data;
|
||||
bNodeTree *ntree = static_cast<bNodeTree *>(ale->data);
|
||||
short offset = acf_generic_basic_offset(ac, ale);
|
||||
|
||||
offset += acf_nodetree_rootType_offset(ntree);
|
||||
@@ -2707,7 +2707,7 @@ static void *acf_dsntree_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
bNodeTree *ntree = (bNodeTree *)ale->data;
|
||||
bNodeTree *ntree = static_cast<bNodeTree *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2790,7 +2790,7 @@ static void *acf_dslinestyle_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ale->data;
|
||||
FreestyleLineStyle *linestyle = static_cast<FreestyleLineStyle *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2873,7 +2873,7 @@ static void *acf_dsmesh_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Mesh *mesh = (Mesh *)ale->data;
|
||||
Mesh *mesh = static_cast<Mesh *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -2957,7 +2957,7 @@ static void *acf_dslat_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Lattice *lt = (Lattice *)ale->data;
|
||||
Lattice *lt = static_cast<Lattice *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3041,7 +3041,7 @@ static void *acf_dsspk_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Speaker *spk = (Speaker *)ale->data;
|
||||
Speaker *spk = static_cast<Speaker *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3124,7 +3124,7 @@ static void *acf_dscurves_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Curves *curves = (Curves *)ale->data;
|
||||
Curves *curves = static_cast<Curves *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3207,7 +3207,7 @@ static void *acf_dspointcloud_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
PointCloud *pointcloud = (PointCloud *)ale->data;
|
||||
PointCloud *pointcloud = static_cast<PointCloud *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3290,7 +3290,7 @@ static void *acf_dsvolume_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
Volume *volume = (Volume *)ale->data;
|
||||
Volume *volume = static_cast<Volume *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3373,7 +3373,7 @@ static void *acf_dsgpencil_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
bGPdata *gpd = (bGPdata *)ale->data;
|
||||
bGPdata *gpd = static_cast<bGPdata *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3456,7 +3456,7 @@ static void *acf_dsmclip_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
MovieClip *clip = (MovieClip *)ale->data;
|
||||
MovieClip *clip = static_cast<MovieClip *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3504,7 +3504,7 @@ static bAnimChannelType ACF_DSMCLIP = {
|
||||
/* name for ShapeKey */
|
||||
static void acf_shapekey_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
KeyBlock *kb = (KeyBlock *)ale->data;
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(ale->data);
|
||||
|
||||
/* just copy the name... */
|
||||
if (kb && name) {
|
||||
@@ -3521,7 +3521,7 @@ static void acf_shapekey_name(bAnimListElem *ale, char *name)
|
||||
/* name property for ShapeKey entries */
|
||||
static bool acf_shapekey_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
KeyBlock *kb = (KeyBlock *)ale->data;
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(ale->data);
|
||||
|
||||
/* if the KeyBlock had a name, use it, otherwise use the index */
|
||||
if (kb && kb->name[0]) {
|
||||
@@ -3579,7 +3579,7 @@ static void *acf_shapekey_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting,
|
||||
short *r_type)
|
||||
{
|
||||
KeyBlock *kb = (KeyBlock *)ale->data;
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(ale->data);
|
||||
|
||||
/* Clear extra return data first. */
|
||||
*r_type = 0;
|
||||
@@ -3645,7 +3645,7 @@ static bool acf_gpd_setting_valid(bAnimContext * /*ac*/,
|
||||
/* name for grease pencil layer entries */
|
||||
static void acf_gpl_name_legacy(bAnimListElem *ale, char *name)
|
||||
{
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
if (gpl && name) {
|
||||
BLI_strncpy(name, gpl->info, ANIM_CHAN_NAME_SIZE);
|
||||
@@ -3723,7 +3723,7 @@ static void *acf_gpl_setting_ptr_legacy(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
/* all flags are just in gpl->flag for now... */
|
||||
return GET_ACF_FLAG_PTR(gpl->flag, r_type);
|
||||
@@ -3809,7 +3809,7 @@ static short layer_offset(bAnimContext *ac, bAnimListElem *ale)
|
||||
/* Name for grease pencil layer entries. */
|
||||
static void layer_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
GreasePencilLayer *layer = (GreasePencilLayer *)ale->data;
|
||||
GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ale->data);
|
||||
|
||||
if (layer && name) {
|
||||
BLI_strncpy(name, layer->wrap().name().c_str(), ANIM_CHAN_NAME_SIZE);
|
||||
@@ -3881,7 +3881,7 @@ static void *layer_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
GreasePencilLayer *layer = (GreasePencilLayer *)ale->data;
|
||||
GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ale->data);
|
||||
return GET_ACF_FLAG_PTR(layer->base.flag, r_type);
|
||||
}
|
||||
|
||||
@@ -4067,7 +4067,7 @@ static void *acf_mask_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
Mask *mask = (Mask *)ale->data;
|
||||
Mask *mask = static_cast<Mask *>(ale->data);
|
||||
|
||||
/* all flags are just in mask->flag for now... */
|
||||
return GET_ACF_FLAG_PTR(mask->flag, r_type);
|
||||
@@ -4099,7 +4099,7 @@ static bAnimChannelType ACF_MASKDATA = {
|
||||
/* name for grease pencil layer entries */
|
||||
static void acf_masklay_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
MaskLayer *masklay = (MaskLayer *)ale->data;
|
||||
MaskLayer *masklay = static_cast<MaskLayer *>(ale->data);
|
||||
|
||||
if (masklay && name) {
|
||||
BLI_strncpy(name, masklay->name, ANIM_CHAN_NAME_SIZE);
|
||||
@@ -4165,7 +4165,7 @@ static void *acf_masklay_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
MaskLayer *masklay = (MaskLayer *)ale->data;
|
||||
MaskLayer *masklay = static_cast<MaskLayer *>(ale->data);
|
||||
|
||||
/* all flags are just in masklay->flag for now... */
|
||||
return GET_ACF_FLAG_PTR(masklay->flag, r_type);
|
||||
@@ -4197,7 +4197,7 @@ static bAnimChannelType ACF_MASKLAYER = {
|
||||
/* get backdrop color for nla track channels */
|
||||
static void acf_nlatrack_color(bAnimContext * /*ac*/, bAnimListElem *ale, float r_color[3])
|
||||
{
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
AnimData *adt = ale->adt;
|
||||
bool nonSolo = false;
|
||||
|
||||
@@ -4216,7 +4216,7 @@ static void acf_nlatrack_color(bAnimContext * /*ac*/, bAnimListElem *ale, float
|
||||
/* name for nla track entries */
|
||||
static void acf_nlatrack_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
|
||||
if (nlt && name) {
|
||||
BLI_strncpy(name, nlt->name, ANIM_CHAN_NAME_SIZE);
|
||||
@@ -4241,7 +4241,7 @@ static bool acf_nlatrack_setting_valid(bAnimContext * /*ac*/,
|
||||
bAnimListElem *ale,
|
||||
eAnimChannel_Settings setting)
|
||||
{
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
AnimData *adt = ale->adt;
|
||||
|
||||
/* visibility of settings depends on various states... */
|
||||
@@ -4309,7 +4309,7 @@ static void *acf_nlatrack_setting_ptr(bAnimListElem *ale,
|
||||
eAnimChannel_Settings /*setting*/,
|
||||
short *r_type)
|
||||
{
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
return GET_ACF_FLAG_PTR(nlt->flag, r_type);
|
||||
}
|
||||
|
||||
@@ -4384,7 +4384,7 @@ static void acf_nlaaction_color(bAnimContext * /*ac*/, bAnimListElem *ale, float
|
||||
* strips backgrounds but here we're doing track list backgrounds instead
|
||||
* so we ignore that and use our own when needed
|
||||
*/
|
||||
nla_action_get_color(ale->adt, (bAction *)ale->data, color);
|
||||
nla_action_get_color(ale->adt, static_cast<bAction *>(ale->data), color);
|
||||
|
||||
/* NOTE: since the return types only allow rgb, we cannot do the alpha-blending we'd
|
||||
* like for the solo-drawing case. Hence, this method isn't actually used for drawing
|
||||
@@ -4435,7 +4435,7 @@ static void acf_nlaaction_backdrop(bAnimContext *ac, bAnimListElem *ale, float y
|
||||
/* name for nla action entries */
|
||||
static void acf_nlaaction_name(bAnimListElem *ale, char *name)
|
||||
{
|
||||
bAction *act = (bAction *)ale->data;
|
||||
bAction *act = static_cast<bAction *>(ale->data);
|
||||
|
||||
if (name) {
|
||||
if (act) {
|
||||
@@ -4676,14 +4676,14 @@ void ANIM_channel_debug_print_info(bAnimListElem *ale, short indent_level)
|
||||
bAction *ANIM_channel_action_get(const bAnimListElem *ale)
|
||||
{
|
||||
if (ale->datatype == ALE_ACT) {
|
||||
return (bAction *)ale->key_data;
|
||||
return static_cast<bAction *>(ale->key_data);
|
||||
}
|
||||
|
||||
if (ELEM(ale->type, ANIMTYPE_GROUP, ANIMTYPE_FCURVE)) {
|
||||
ID *owner = ale->fcurve_owner_id;
|
||||
|
||||
if (owner && GS(owner->name) == ID_AC) {
|
||||
return (bAction *)owner;
|
||||
return reinterpret_cast<bAction *>(owner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5040,7 +5040,7 @@ void ANIM_channel_draw(
|
||||
{
|
||||
/* for F-Curves, draw color-preview of curve left to the visibility icon */
|
||||
if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
uint pos = GPU_vertformat_attr_add(
|
||||
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||
|
||||
@@ -5156,12 +5156,12 @@ void ANIM_channel_draw(
|
||||
if ((ac->sl) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH)) {
|
||||
switch (ac->spacetype) {
|
||||
case SPACE_ACTION: {
|
||||
SpaceAction *saction = (SpaceAction *)ac->sl;
|
||||
SpaceAction *saction = reinterpret_cast<SpaceAction *>(ac->sl);
|
||||
draw_sliders = (saction->flag & SACTION_SLIDERS);
|
||||
break;
|
||||
}
|
||||
case SPACE_GRAPH: {
|
||||
SpaceGraph *sipo = (SpaceGraph *)ac->sl;
|
||||
SpaceGraph *sipo = reinterpret_cast<SpaceGraph *>(ac->sl);
|
||||
draw_sliders = (sipo->flag & SIPO_SLIDERS);
|
||||
break;
|
||||
}
|
||||
@@ -5292,7 +5292,7 @@ static void achannel_setting_widget_cb(bContext *C, void *ale_npoin, void *setti
|
||||
/* callback for widget settings that need flushing */
|
||||
static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void *setting_wrap)
|
||||
{
|
||||
bAnimListElem *ale_setting = (bAnimListElem *)ale_npoin;
|
||||
bAnimListElem *ale_setting = static_cast<bAnimListElem *>(ale_npoin);
|
||||
bAnimContext ac;
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
int filter;
|
||||
@@ -5313,7 +5313,7 @@ static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void
|
||||
if (ale_setting->type == ANIMTYPE_GPLAYER) {
|
||||
/* draw cache updates for settings that affect the visible strokes */
|
||||
if (setting == ACHANNEL_SETTING_VISIBLE) {
|
||||
bGPdata *gpd = (bGPdata *)ale_setting->id;
|
||||
bGPdata *gpd = reinterpret_cast<bGPdata *>(ale_setting->id);
|
||||
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
|
||||
}
|
||||
|
||||
@@ -5387,9 +5387,9 @@ static void achannel_nlatrack_solo_widget_cb(bContext *C, void *ale_poin, void *
|
||||
/* callback for widget sliders - insert keyframes */
|
||||
static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin)
|
||||
{
|
||||
ID *id = (ID *)id_poin;
|
||||
ID *id = static_cast<ID *>(id_poin);
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
FCurve *fcu = (FCurve *)fcu_poin;
|
||||
FCurve *fcu = static_cast<FCurve *>(fcu_poin);
|
||||
|
||||
ReportList *reports = CTX_wm_reports(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
@@ -5455,9 +5455,9 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
|
||||
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
|
||||
depsgraph, float(scene->r.cfra));
|
||||
|
||||
Key *key = (Key *)key_poin;
|
||||
KeyBlock *kb = (KeyBlock *)kb_poin;
|
||||
PointerRNA id_ptr = RNA_id_pointer_create((ID *)key);
|
||||
Key *key = static_cast<Key *>(key_poin);
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(kb_poin);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(reinterpret_cast<ID *>(key));
|
||||
std::optional<std::string> rna_path = BKE_keyblock_curval_rnapath_get(key, kb);
|
||||
|
||||
/* Since this is only ever called from moving a slider for an existing
|
||||
@@ -5485,7 +5485,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
|
||||
static void achannel_setting_slider_nla_curve_cb(bContext *C, void * /*id_poin*/, void *fcu_poin)
|
||||
{
|
||||
// ID *id = (ID *)id_poin;
|
||||
FCurve *fcu = (FCurve *)fcu_poin;
|
||||
FCurve *fcu = static_cast<FCurve *>(fcu_poin);
|
||||
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
@@ -6003,12 +6003,12 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
||||
if ((ac->sl) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH)) {
|
||||
switch (ac->spacetype) {
|
||||
case SPACE_ACTION: {
|
||||
SpaceAction *saction = (SpaceAction *)ac->sl;
|
||||
SpaceAction *saction = reinterpret_cast<SpaceAction *>(ac->sl);
|
||||
draw_sliders = (saction->flag & SACTION_SLIDERS);
|
||||
break;
|
||||
}
|
||||
case SPACE_GRAPH: {
|
||||
SpaceGraph *sipo = (SpaceGraph *)ac->sl;
|
||||
SpaceGraph *sipo = reinterpret_cast<SpaceGraph *>(ac->sl);
|
||||
draw_sliders = (sipo->flag & SIPO_SLIDERS);
|
||||
break;
|
||||
}
|
||||
@@ -6163,8 +6163,8 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
||||
|
||||
if (ale->owner) { /* Slider using custom RNA Access ---------- */
|
||||
if (ale->type == ANIMTYPE_NLACURVE) {
|
||||
NlaStrip *strip = (NlaStrip *)ale->owner;
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
NlaStrip *strip = static_cast<NlaStrip *>(ale->owner);
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* create RNA pointers */
|
||||
@@ -6199,25 +6199,25 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
||||
|
||||
/* get destination info */
|
||||
if (ale->type == ANIMTYPE_FCURVE) {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
rna_path = fcu->rna_path;
|
||||
array_index = fcu->array_index;
|
||||
}
|
||||
else if (ale->type == ANIMTYPE_SHAPEKEY) {
|
||||
KeyBlock *kb = (KeyBlock *)ale->data;
|
||||
Key *key = (Key *)ale->id;
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(ale->data);
|
||||
Key *key = reinterpret_cast<Key *>(ale->id);
|
||||
|
||||
rna_path = BKE_keyblock_curval_rnapath_get(key, kb);
|
||||
}
|
||||
/* Special for Grease Pencil Layer. */
|
||||
else if (ale->type == ANIMTYPE_GPLAYER) {
|
||||
bGPdata *gpd = (bGPdata *)ale->id;
|
||||
bGPdata *gpd = reinterpret_cast<bGPdata *>(ale->id);
|
||||
if ((gpd->flag & GP_DATA_ANNOTATIONS) == 0) {
|
||||
/* Reset slider offset, in order to add special gp icons. */
|
||||
offset += SLIDER_WIDTH;
|
||||
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
/* Create the RNA pointers. */
|
||||
ptr = RNA_pointer_create_discrete(ale->id, &RNA_GPencilLayer, ale->data);
|
||||
|
||||
@@ -177,7 +177,7 @@ static bool get_channel_bounds(bAnimContext *ac,
|
||||
bool found_bounds = false;
|
||||
switch (ale->datatype) {
|
||||
case ALE_GPFRAME: {
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
found_bounds = get_gpencil_bounds(gpl, range, r_bounds);
|
||||
break;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ static bool get_channel_bounds(bAnimContext *ac,
|
||||
break;
|
||||
|
||||
case ALE_FCURVE: {
|
||||
FCurve *fcu = (FCurve *)ale->key_data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->key_data);
|
||||
found_bounds = get_normalized_fcurve_bounds(
|
||||
fcu, ac->sl, ac->scene, ale->id, include_handles, range, r_bounds);
|
||||
if (found_bounds) {
|
||||
@@ -260,20 +260,20 @@ void ANIM_set_active_channel(bAnimContext *ac,
|
||||
/* flag to set depends on type */
|
||||
switch (ale->type) {
|
||||
case ANIMTYPE_GROUP: {
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(agrp, ACHANNEL_SETFLAG_CLEAR, AGRP_ACTIVE);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_FCURVE:
|
||||
case ANIMTYPE_NLACURVE: {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(fcu, ACHANNEL_SETFLAG_CLEAR, FCURVE_ACTIVE);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_NLATRACK: {
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(nlt, ACHANNEL_SETFLAG_CLEAR, NLATRACK_ACTIVE);
|
||||
break;
|
||||
@@ -308,7 +308,7 @@ void ANIM_set_active_channel(bAnimContext *ac,
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_GPLAYER: {
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(gpl, ACHANNEL_SETFLAG_CLEAR, GP_LAYER_ACTIVE);
|
||||
break;
|
||||
@@ -339,18 +339,18 @@ void ANIM_set_active_channel(bAnimContext *ac,
|
||||
if (channel_data) {
|
||||
switch (channel_type) {
|
||||
case ANIMTYPE_GROUP: {
|
||||
bActionGroup *agrp = (bActionGroup *)channel_data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(channel_data);
|
||||
agrp->flag |= AGRP_ACTIVE;
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_FCURVE:
|
||||
case ANIMTYPE_NLACURVE: {
|
||||
FCurve *fcu = (FCurve *)channel_data;
|
||||
FCurve *fcu = static_cast<FCurve *>(channel_data);
|
||||
fcu->flag |= FCURVE_ACTIVE;
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_NLATRACK: {
|
||||
NlaTrack *nlt = (NlaTrack *)channel_data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(channel_data);
|
||||
nlt->flag |= NLATRACK_ACTIVE;
|
||||
break;
|
||||
}
|
||||
@@ -391,7 +391,7 @@ void ANIM_set_active_channel(bAnimContext *ac,
|
||||
}
|
||||
|
||||
case ANIMTYPE_GPLAYER: {
|
||||
bGPDlayer *gpl = (bGPDlayer *)channel_data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(channel_data);
|
||||
gpl->flag |= GP_LAYER_ACTIVE;
|
||||
break;
|
||||
}
|
||||
@@ -442,16 +442,16 @@ bool ANIM_is_active_channel(bAnimListElem *ale)
|
||||
return ale->adt && (ale->adt->flag & ADT_UI_ACTIVE);
|
||||
}
|
||||
case ANIMTYPE_GROUP: {
|
||||
bActionGroup *argp = (bActionGroup *)ale->data;
|
||||
bActionGroup *argp = static_cast<bActionGroup *>(ale->data);
|
||||
return argp->flag & AGRP_ACTIVE;
|
||||
}
|
||||
case ANIMTYPE_FCURVE:
|
||||
case ANIMTYPE_NLACURVE: {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
return fcu->flag & FCURVE_ACTIVE;
|
||||
}
|
||||
case ANIMTYPE_GPLAYER: {
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
return gpl->flag & GP_LAYER_ACTIVE;
|
||||
}
|
||||
case ANIMTYPE_GREASE_PENCIL_LAYER: {
|
||||
@@ -497,7 +497,7 @@ static void select_pchan_for_action_group(bAnimContext *ac,
|
||||
*/
|
||||
if ((ac->ads->filterflag & ADS_FILTER_ONLYSEL) == 0) {
|
||||
if ((ale->id) && (GS(ale->id->name) == ID_OB)) {
|
||||
Object *ob = (Object *)ale->id;
|
||||
Object *ob = reinterpret_cast<Object *>(ale->id);
|
||||
if (ob->type == OB_ARMATURE) {
|
||||
/* Assume for now that any group with corresponding name is what we want
|
||||
* (i.e. for an armature whose location is animated, things would break
|
||||
@@ -686,7 +686,7 @@ static void anim_channels_select_set(bAnimContext *ac,
|
||||
if (change_active) {
|
||||
break;
|
||||
}
|
||||
Scene *scene = (Scene *)ale->data;
|
||||
Scene *scene = static_cast<Scene *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(scene, sel, SCE_DS_SELECTED);
|
||||
|
||||
@@ -710,7 +710,7 @@ static void anim_channels_select_set(bAnimContext *ac,
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_GROUP: {
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
ACHANNEL_SET_FLAG(agrp, sel, AGRP_SELECTED);
|
||||
select_pchan_for_action_group(ac, agrp, ale, change_active);
|
||||
if (change_active) {
|
||||
@@ -720,7 +720,7 @@ static void anim_channels_select_set(bAnimContext *ac,
|
||||
}
|
||||
case ANIMTYPE_FCURVE:
|
||||
case ANIMTYPE_NLACURVE: {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(fcu, sel, FCURVE_SELECTED);
|
||||
if (!(fcu->flag & FCURVE_SELECTED) && change_active) {
|
||||
@@ -731,13 +731,13 @@ static void anim_channels_select_set(bAnimContext *ac,
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_SHAPEKEY: {
|
||||
KeyBlock *kb = (KeyBlock *)ale->data;
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(kb, sel, KEYBLOCK_SEL);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_NLATRACK: {
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(nlt, sel, NLATRACK_SELECTED);
|
||||
nlt->flag &= ~NLATRACK_ACTIVE;
|
||||
@@ -788,13 +788,13 @@ static void anim_channels_select_set(bAnimContext *ac,
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_GPLAYER: {
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(gpl, sel, GP_LAYER_SELECT);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_MASKLAYER: {
|
||||
MaskLayer *masklay = (MaskLayer *)ale->data;
|
||||
MaskLayer *masklay = static_cast<MaskLayer *>(ale->data);
|
||||
|
||||
ACHANNEL_SET_FLAG(masklay, sel, MASK_LAYERFLAG_SELECT);
|
||||
break;
|
||||
@@ -1308,7 +1308,7 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands,
|
||||
/* get flags - selected and untouchable from the channel */
|
||||
switch (type) {
|
||||
case ANIMTYPE_GROUP: {
|
||||
bActionGroup *agrp = (bActionGroup *)channel;
|
||||
bActionGroup *agrp = reinterpret_cast<bActionGroup *>(channel);
|
||||
|
||||
is_sel = SEL_AGRP(agrp);
|
||||
is_untouchable = (agrp->flag & AGRP_TEMP) != 0;
|
||||
@@ -1316,19 +1316,19 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands,
|
||||
}
|
||||
case ANIMTYPE_FCURVE:
|
||||
case ANIMTYPE_NLACURVE: {
|
||||
FCurve *fcu = (FCurve *)channel;
|
||||
FCurve *fcu = reinterpret_cast<FCurve *>(channel);
|
||||
|
||||
is_sel = SEL_FCU(fcu);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_NLATRACK: {
|
||||
NlaTrack *nlt = (NlaTrack *)channel;
|
||||
NlaTrack *nlt = reinterpret_cast<NlaTrack *>(channel);
|
||||
|
||||
is_sel = SEL_NLT(nlt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_GPLAYER: {
|
||||
bGPDlayer *gpl = (bGPDlayer *)channel;
|
||||
bGPDlayer *gpl = reinterpret_cast<bGPDlayer *>(channel);
|
||||
|
||||
is_sel = SEL_GPL(gpl);
|
||||
break;
|
||||
@@ -1414,7 +1414,7 @@ static void rearrange_animchannels_filter_visible(
|
||||
}
|
||||
|
||||
if (type == ANIMTYPE_NLATRACK) {
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
|
||||
if (BKE_nlatrack_is_nonlocal_in_liboverride(ale->id, nlt)) {
|
||||
/* No re-arrangement of non-local tracks of override data. */
|
||||
@@ -1539,9 +1539,9 @@ static void rearrange_nla_tracks(bAnimContext *ac, AnimData *adt, eRearrangeAnim
|
||||
/* Add back non-local NLA tracks at the beginning of the animation data's list. */
|
||||
if (!BLI_listbase_is_empty(&extracted_nonlocal_nla_tracks)) {
|
||||
BLI_assert(is_liboverride);
|
||||
((NlaTrack *)extracted_nonlocal_nla_tracks.last)->next = static_cast<NlaTrack *>(
|
||||
static_cast<NlaTrack *>(extracted_nonlocal_nla_tracks.last)->next = static_cast<NlaTrack *>(
|
||||
adt->nla_tracks.first);
|
||||
((NlaTrack *)adt->nla_tracks.first)->prev = static_cast<NlaTrack *>(
|
||||
static_cast<NlaTrack *>(adt->nla_tracks.first)->prev = static_cast<NlaTrack *>(
|
||||
extracted_nonlocal_nla_tracks.last);
|
||||
adt->nla_tracks.first = extracted_nonlocal_nla_tracks.first;
|
||||
}
|
||||
@@ -1828,7 +1828,7 @@ static void rearrange_layered_action_channel_groups(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_UP: {
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_GROUP);
|
||||
bActionGroup *group = (bActionGroup *)ale->data;
|
||||
bActionGroup *group = static_cast<bActionGroup *>(ale->data);
|
||||
if (!SEL_AGRP(group)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1853,7 +1853,7 @@ static void rearrange_layered_action_channel_groups(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_TOP: {
|
||||
LISTBASE_FOREACH_BACKWARD (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_GROUP);
|
||||
bActionGroup *group = (bActionGroup *)ale->data;
|
||||
bActionGroup *group = static_cast<bActionGroup *>(ale->data);
|
||||
if (!SEL_AGRP(group)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1866,7 +1866,7 @@ static void rearrange_layered_action_channel_groups(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_DOWN: {
|
||||
LISTBASE_FOREACH_BACKWARD (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_GROUP);
|
||||
bActionGroup *group = (bActionGroup *)ale->data;
|
||||
bActionGroup *group = static_cast<bActionGroup *>(ale->data);
|
||||
if (!SEL_AGRP(group)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1891,7 +1891,7 @@ static void rearrange_layered_action_channel_groups(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_BOTTOM: {
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_GROUP);
|
||||
bActionGroup *group = (bActionGroup *)ale->data;
|
||||
bActionGroup *group = static_cast<bActionGroup *>(ale->data);
|
||||
if (!SEL_AGRP(group)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1943,7 +1943,7 @@ static void rearrange_layered_action_fcurves(bAnimContext *ac,
|
||||
* NOTE: this returns a *copy* of the group, rather a pointer or reference, to
|
||||
* make it possible to return a fake group when needed. */
|
||||
auto get_group_or_make_fake = [&action](bAnimListElem *fcurve_ale) -> bActionGroup {
|
||||
FCurve *fcurve = (FCurve *)fcurve_ale->data;
|
||||
FCurve *fcurve = static_cast<FCurve *>(fcurve_ale->data);
|
||||
if (fcurve->grp) {
|
||||
return *fcurve->grp;
|
||||
}
|
||||
@@ -1977,7 +1977,7 @@ static void rearrange_layered_action_fcurves(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_UP: {
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_FCURVE);
|
||||
FCurve *fcurve = (FCurve *)ale->data;
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->data);
|
||||
bActionGroup group = get_group_or_make_fake(ale);
|
||||
|
||||
if (should_skip(*fcurve, group)) {
|
||||
@@ -2004,7 +2004,7 @@ static void rearrange_layered_action_fcurves(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_TOP: {
|
||||
LISTBASE_FOREACH_BACKWARD (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_FCURVE);
|
||||
FCurve *fcurve = (FCurve *)ale->data;
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->data);
|
||||
bActionGroup group = get_group_or_make_fake(ale);
|
||||
|
||||
if (should_skip(*fcurve, group)) {
|
||||
@@ -2020,7 +2020,7 @@ static void rearrange_layered_action_fcurves(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_DOWN: {
|
||||
LISTBASE_FOREACH_BACKWARD (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_FCURVE);
|
||||
FCurve *fcurve = (FCurve *)ale->data;
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->data);
|
||||
bActionGroup group = get_group_or_make_fake(ale);
|
||||
|
||||
if (should_skip(*fcurve, group)) {
|
||||
@@ -2049,7 +2049,7 @@ static void rearrange_layered_action_fcurves(bAnimContext *ac,
|
||||
case REARRANGE_ANIMCHAN_BOTTOM: {
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data_visible) {
|
||||
BLI_assert(ale->type == ANIMTYPE_FCURVE);
|
||||
FCurve *fcurve = (FCurve *)ale->data;
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->data);
|
||||
bActionGroup group = get_group_or_make_fake(ale);
|
||||
|
||||
if (should_skip(*fcurve, group)) {
|
||||
@@ -2417,7 +2417,7 @@ static bool animchannels_grouping_poll(bContext *C)
|
||||
switch (area->spacetype) {
|
||||
/* supported... */
|
||||
case SPACE_ACTION: {
|
||||
SpaceAction *saction = (SpaceAction *)sl;
|
||||
SpaceAction *saction = reinterpret_cast<SpaceAction *>(sl);
|
||||
|
||||
/* Dopesheet and action only - all others are for other data-types or have no groups. */
|
||||
if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_DOPESHEET) == 0) {
|
||||
@@ -2427,7 +2427,7 @@ static bool animchannels_grouping_poll(bContext *C)
|
||||
break;
|
||||
}
|
||||
case SPACE_GRAPH: {
|
||||
SpaceGraph *sipo = (SpaceGraph *)sl;
|
||||
SpaceGraph *sipo = reinterpret_cast<SpaceGraph *>(sl);
|
||||
|
||||
/* drivers can't have groups... */
|
||||
if (sipo->mode != SIPO_MODE_ANIMATION) {
|
||||
@@ -2477,7 +2477,7 @@ static void animchannels_group_channels(bAnimContext *ac,
|
||||
|
||||
/* Transfer selected F-Curves across to new group. */
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
bActionGroup *grp = fcu->grp;
|
||||
|
||||
/* remove F-Curve from group, then group too if it is now empty */
|
||||
@@ -2514,7 +2514,7 @@ static void animchannels_group_channels(bAnimContext *ac,
|
||||
blender::animrig::Channelbag *last_channelbag = nullptr;
|
||||
bActionGroup *group = nullptr;
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
blender::animrig::Channelbag *channelbag = channelbag_for_action_slot(act->wrap(),
|
||||
ale->slot_handle);
|
||||
|
||||
@@ -2620,7 +2620,7 @@ static int animchannels_ungroup_exec(bContext *C, wmOperator * /*op*/)
|
||||
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
/* Already ungrouped, so skip. */
|
||||
if (fcu->grp == nullptr) {
|
||||
@@ -2753,7 +2753,7 @@ static bool animchannels_delete_containers(const bContext *C, bAnimContext *ac)
|
||||
break;
|
||||
}
|
||||
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
AnimData *adt = ale->adt;
|
||||
FCurve *fcu, *fcn;
|
||||
|
||||
@@ -2902,7 +2902,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator * /*op*/)
|
||||
case ANIMTYPE_FCURVE: {
|
||||
/* F-Curves if we can identify its parent */
|
||||
AnimData *adt = ale->adt;
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
/* try to free F-Curve */
|
||||
BLI_assert_msg((fcu->driver != nullptr) == (ac.datatype == ANIMCONT_DRIVERS),
|
||||
@@ -2913,8 +2913,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator * /*op*/)
|
||||
}
|
||||
case ANIMTYPE_NLACURVE: {
|
||||
/* NLA Control Curve - Deleting it should disable the corresponding setting... */
|
||||
NlaStrip *strip = (NlaStrip *)ale->owner;
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
NlaStrip *strip = static_cast<NlaStrip *>(ale->owner);
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
if (STREQ(fcu->rna_path, "strip_time")) {
|
||||
strip->flag &= ~NLASTRIP_FLAG_USR_TIME;
|
||||
@@ -2935,8 +2935,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator * /*op*/)
|
||||
}
|
||||
case ANIMTYPE_GPLAYER: {
|
||||
/* Grease Pencil layer */
|
||||
bGPdata *gpd = (bGPdata *)ale->id;
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPdata *gpd = reinterpret_cast<bGPdata *>(ale->id);
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
/* try to delete the layer's data and the layer itself */
|
||||
BKE_gpencil_layer_delete(gpd, gpl);
|
||||
@@ -2964,8 +2964,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator * /*op*/)
|
||||
}
|
||||
case ANIMTYPE_MASKLAYER: {
|
||||
/* Mask layer */
|
||||
Mask *mask = (Mask *)ale->id;
|
||||
MaskLayer *masklay = (MaskLayer *)ale->data;
|
||||
Mask *mask = reinterpret_cast<Mask *>(ale->id);
|
||||
MaskLayer *masklay = static_cast<MaskLayer *>(ale->data);
|
||||
|
||||
/* try to delete the layer's data and the layer itself */
|
||||
BKE_mask_layer_remove(mask, masklay);
|
||||
@@ -3552,7 +3552,7 @@ static int animchannels_enable_exec(bContext *C, wmOperator * /*op*/)
|
||||
|
||||
/* loop through filtered data and clean curves */
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
/* remove disabled flags from F-Curves */
|
||||
fcu->flag &= ~FCURVE_DISABLED;
|
||||
@@ -3737,7 +3737,7 @@ static void box_select_anim_channels(bAnimContext *ac, const rcti &rect, short s
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
int filter;
|
||||
|
||||
SpaceNla *snla = (SpaceNla *)ac->sl;
|
||||
SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac->sl);
|
||||
View2D *v2d = &ac->region->v2d;
|
||||
rctf rectf;
|
||||
|
||||
@@ -3779,14 +3779,14 @@ static void box_select_anim_channels(bAnimContext *ac, const rcti &rect, short s
|
||||
/* type specific actions */
|
||||
switch (ale->type) {
|
||||
case ANIMTYPE_GROUP: {
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
select_pchan_for_action_group(ac, agrp, ale, true);
|
||||
/* always clear active flag after doing this */
|
||||
agrp->flag &= ~AGRP_ACTIVE;
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_NLATRACK: {
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
|
||||
/* for now, it's easier just to do this here manually, as defining a new type
|
||||
* currently adds complications when doing other stuff
|
||||
@@ -3968,7 +3968,7 @@ static bool rename_anim_channels(bAnimContext *ac, int channel_index)
|
||||
if (ID_IS_OVERRIDE_LIBRARY(ale->id)) {
|
||||
switch (ale->type) {
|
||||
case ANIMTYPE_NLATRACK: {
|
||||
NlaTrack *nlt = (NlaTrack *)ale->data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
|
||||
if ((nlt->flag & NLATRACK_OVERRIDELIBRARY_LOCAL) == 0) {
|
||||
ANIM_animdata_freelist(&anim_data);
|
||||
return false;
|
||||
@@ -4023,7 +4023,7 @@ static int animchannels_channel_get(bAnimContext *ac, const int mval[2])
|
||||
UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
|
||||
|
||||
if (ac->datatype == ANIMCONT_NLA) {
|
||||
SpaceNla *snla = (SpaceNla *)ac->sl;
|
||||
SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac->sl);
|
||||
UI_view2d_listview_view_to_cell(NLATRACK_NAMEWIDTH,
|
||||
NLATRACK_STEP(snla),
|
||||
0,
|
||||
@@ -4092,7 +4092,7 @@ static void ANIM_OT_channels_rename(wmOperatorType *ot)
|
||||
static int click_select_channel_scene(bAnimListElem *ale,
|
||||
const short /* eEditKeyframes_Select or -1 */ selectmode)
|
||||
{
|
||||
Scene *sce = (Scene *)ale->data;
|
||||
Scene *sce = static_cast<Scene *>(ale->data);
|
||||
AnimData *adt = sce->adt;
|
||||
|
||||
/* set selection status */
|
||||
@@ -4155,14 +4155,14 @@ static void animchannel_select_range(bAnimContext *ac, bAnimListElem *cursor_ele
|
||||
ANIM_channel_setting_set(ac, ale, ACHANNEL_SETTING_SELECT, ACHANNEL_SETFLAG_ADD);
|
||||
in_selection_range = !in_selection_range;
|
||||
if (ale->type == ANIMTYPE_GROUP) {
|
||||
select_pchan_for_action_group(ac, (bActionGroup *)ale->data, ale, false);
|
||||
select_pchan_for_action_group(ac, static_cast<bActionGroup *>(ale->data), ale, false);
|
||||
}
|
||||
}
|
||||
else if (in_selection_range) {
|
||||
/* Select elements between the range. */
|
||||
ANIM_channel_setting_set(ac, ale, ACHANNEL_SETTING_SELECT, ACHANNEL_SETFLAG_ADD);
|
||||
if (ale->type == ANIMTYPE_GROUP) {
|
||||
select_pchan_for_action_group(ac, (bActionGroup *)ale->data, ale, false);
|
||||
select_pchan_for_action_group(ac, static_cast<bActionGroup *>(ale->data), ale, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4184,7 +4184,7 @@ static int click_select_channel_object(bContext *C,
|
||||
using namespace blender::ed;
|
||||
Scene *scene = ac->scene;
|
||||
ViewLayer *view_layer = ac->view_layer;
|
||||
Base *base = (Base *)ale->data;
|
||||
Base *base = static_cast<Base *>(ale->data);
|
||||
Object *ob = base->object;
|
||||
AnimData *adt = ob->adt;
|
||||
|
||||
@@ -4273,7 +4273,7 @@ static int click_select_channel_group(bAnimContext *ac,
|
||||
const short /* eEditKeyframes_Select or -1 */ selectmode,
|
||||
const int filter)
|
||||
{
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
Object *ob = nullptr;
|
||||
bPoseChannel *pchan = nullptr;
|
||||
|
||||
@@ -4288,7 +4288,7 @@ static int click_select_channel_group(bAnimContext *ac,
|
||||
*/
|
||||
if ((ac->ads->filterflag & ADS_FILTER_ONLYSEL) == 0) {
|
||||
if ((ale->id) && (GS(ale->id->name) == ID_OB)) {
|
||||
ob = (Object *)ale->id;
|
||||
ob = reinterpret_cast<Object *>(ale->id);
|
||||
|
||||
if (ob->type == OB_ARMATURE) {
|
||||
/* Assume for now that any group with corresponding name is what we want
|
||||
@@ -4376,7 +4376,7 @@ static int click_select_channel_fcurve(bAnimContext *ac,
|
||||
const short /* eEditKeyframes_Select or -1 */ selectmode,
|
||||
const int filter)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
|
||||
/* select/deselect */
|
||||
if (selectmode == SELECT_INVERT) {
|
||||
@@ -4448,7 +4448,7 @@ static int click_select_channel_shapekey(bAnimContext *ac,
|
||||
bAnimListElem *ale,
|
||||
const short /* eEditKeyframes_Select or -1 */ selectmode)
|
||||
{
|
||||
KeyBlock *kb = (KeyBlock *)ale->data;
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(ale->data);
|
||||
|
||||
/* select/deselect */
|
||||
if (selectmode == SELECT_INVERT) {
|
||||
@@ -4466,7 +4466,7 @@ static int click_select_channel_shapekey(bAnimContext *ac,
|
||||
|
||||
static int click_select_channel_nlacontrols(bAnimListElem *ale)
|
||||
{
|
||||
AnimData *adt = (AnimData *)ale->data;
|
||||
AnimData *adt = static_cast<AnimData *>(ale->data);
|
||||
|
||||
/* Toggle expand:
|
||||
* - Although the triangle widget already allows this,
|
||||
@@ -4484,8 +4484,8 @@ static int click_select_channel_gplayer(bContext *C,
|
||||
const short /* eEditKeyframes_Select or -1 */ selectmode,
|
||||
const int filter)
|
||||
{
|
||||
bGPdata *gpd = (bGPdata *)ale->id;
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPdata *gpd = reinterpret_cast<bGPdata *>(ale->id);
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
/* select/deselect */
|
||||
if (selectmode == SELECT_INVERT) {
|
||||
@@ -4586,7 +4586,7 @@ static int click_select_channel_grease_pencil_layer(bContext *C,
|
||||
|
||||
static int click_select_channel_maskdatablock(bAnimListElem *ale)
|
||||
{
|
||||
Mask *mask = (Mask *)ale->data;
|
||||
Mask *mask = static_cast<Mask *>(ale->data);
|
||||
|
||||
/* Toggle expand
|
||||
* - Although the triangle widget already allows this,
|
||||
@@ -4601,7 +4601,7 @@ static int click_select_channel_masklayer(bAnimContext *ac,
|
||||
bAnimListElem *ale,
|
||||
const short /* eEditKeyframes_Select or -1 */ selectmode)
|
||||
{
|
||||
MaskLayer *masklay = (MaskLayer *)ale->data;
|
||||
MaskLayer *masklay = static_cast<MaskLayer *>(ale->data);
|
||||
|
||||
/* select/deselect */
|
||||
if (selectmode == SELECT_INVERT) {
|
||||
@@ -4881,7 +4881,7 @@ static bool select_anim_channel_keys(bAnimContext *ac, int channel_index, bool e
|
||||
return false;
|
||||
}
|
||||
|
||||
fcu = (FCurve *)ale->key_data;
|
||||
fcu = static_cast<FCurve *>(ale->key_data);
|
||||
success = (fcu != nullptr);
|
||||
|
||||
ANIM_animdata_freelist(&anim_data);
|
||||
@@ -4895,7 +4895,7 @@ static bool select_anim_channel_keys(bAnimContext *ac, int channel_index, bool e
|
||||
ANIM_animdata_filter(
|
||||
ac, &anim_data, eAnimFilter_Flags(filter), ac->data, eAnimCont_Types(ac->datatype));
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
FCurve *fcu_inner = (FCurve *)ale->key_data;
|
||||
FCurve *fcu_inner = static_cast<FCurve *>(ale->key_data);
|
||||
|
||||
if (fcu_inner != nullptr && fcu_inner->bezt != nullptr) {
|
||||
for (i = 0, bezt = fcu_inner->bezt; i < fcu_inner->totvert; i++, bezt++) {
|
||||
@@ -5533,7 +5533,7 @@ static void deselect_all_fcurves(bAnimContext *ac, const bool hide)
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
FCurve *fcu = (FCurve *)ale->key_data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->key_data);
|
||||
fcu->flag &= ~FCURVE_SELECTED;
|
||||
fcu->flag &= ~FCURVE_ACTIVE;
|
||||
if (hide) {
|
||||
@@ -5550,14 +5550,14 @@ static int count_fcurves_hidden_by_filter(bAnimContext *ac, const blender::Span<
|
||||
if (ac->sl->spacetype != SPACE_GRAPH) {
|
||||
return 0;
|
||||
}
|
||||
SpaceGraph *sipo = (SpaceGraph *)ac->sl;
|
||||
SpaceGraph *sipo = reinterpret_cast<SpaceGraph *>(ac->sl);
|
||||
const eAnimFilter_Flags filter = eAnimFilter_Flags(sipo->ads->filterflag);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* Adding FCurves to a map for quicker lookup times. */
|
||||
blender::Map<FCurve *, bool> filtered_fcurves;
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
FCurve *fcu = (FCurve *)ale->key_data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->key_data);
|
||||
filtered_fcurves.add(fcu, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ void ANIM_id_update(Main *bmain, ID *id)
|
||||
/* perform syncing updates for Action Groups */
|
||||
static void animchan_sync_group(bAnimContext *ac, bAnimListElem *ale, bActionGroup **active_agrp)
|
||||
{
|
||||
bActionGroup *agrp = (bActionGroup *)ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
ID *owner_id = ale->id;
|
||||
|
||||
/* major priority is selection status
|
||||
@@ -134,7 +134,7 @@ static void animchan_sync_group(bAnimContext *ac, bAnimListElem *ale, bActionGro
|
||||
|
||||
/* for standard Objects, check if group is the name of some bone */
|
||||
if (GS(owner_id->name) == ID_OB) {
|
||||
Object *ob = (Object *)owner_id;
|
||||
Object *ob = reinterpret_cast<Object *>(owner_id);
|
||||
|
||||
/* check if there are bones, and whether the name matches any
|
||||
* NOTE: this feature will only really work if groups by default contain the F-Curves
|
||||
@@ -181,8 +181,8 @@ static void animchan_sync_fcurve_scene(bAnimListElem *ale)
|
||||
{
|
||||
ID *owner_id = ale->id;
|
||||
BLI_assert(GS(owner_id->name) == ID_SCE);
|
||||
Scene *scene = (Scene *)owner_id;
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
Scene *scene = reinterpret_cast<Scene *>(owner_id);
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
Strip *strip = nullptr;
|
||||
|
||||
/* Only affect if F-Curve involves sequence_editor.strips. */
|
||||
@@ -215,7 +215,7 @@ static void animchan_sync_fcurve_scene(bAnimListElem *ale)
|
||||
/* perform syncing updates for F-Curves */
|
||||
static void animchan_sync_fcurve(bAnimListElem *ale)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
ID *owner_id = ale->id;
|
||||
|
||||
/* major priority is selection status, so refer to the checks done in `anim_filter.cc`
|
||||
@@ -237,7 +237,7 @@ static void animchan_sync_fcurve(bAnimListElem *ale)
|
||||
/* perform syncing updates for GPencil Layers */
|
||||
static void animchan_sync_gplayer(bAnimListElem *ale)
|
||||
{
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
|
||||
/* Make sure the selection flags agree with the "active" flag.
|
||||
* The selection flags are used in the Dopesheet only, whereas
|
||||
|
||||
@@ -273,7 +273,7 @@ float ANIM_nla_tweakedit_remap(bAnimListElem *ale,
|
||||
static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt)
|
||||
{
|
||||
/* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
|
||||
AnimData *adt = (AnimData *)ked->data;
|
||||
AnimData *adt = static_cast<AnimData *>(ked->data);
|
||||
short only_keys = short(ked->i1);
|
||||
|
||||
/* adjust BezTriple handles only if allowed to */
|
||||
@@ -292,7 +292,7 @@ static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt)
|
||||
static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
|
||||
{
|
||||
/* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
|
||||
AnimData *adt = (AnimData *)ked->data;
|
||||
AnimData *adt = static_cast<AnimData *>(ked->data);
|
||||
short only_keys = short(ked->i1);
|
||||
|
||||
/* adjust BezTriple handles only if allowed to */
|
||||
@@ -350,7 +350,7 @@ void ANIM_nla_mapping_apply_if_needed_fcurve(bAnimListElem *ale,
|
||||
short ANIM_get_normalization_flags(SpaceLink *space_link)
|
||||
{
|
||||
if (space_link->spacetype == SPACE_GRAPH) {
|
||||
SpaceGraph *sipo = (SpaceGraph *)space_link;
|
||||
SpaceGraph *sipo = reinterpret_cast<SpaceGraph *>(space_link);
|
||||
bool use_normalization = (sipo->flag & SIPO_NORMALIZE) != 0;
|
||||
bool freeze_normalization = (sipo->flag & SIPO_NORMALIZE_FREEZE) != 0;
|
||||
return use_normalization ? (ANIM_UNITCONV_NORMALIZE |
|
||||
|
||||
@@ -154,7 +154,7 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction)
|
||||
|
||||
/* if not pinned, sync with active object */
|
||||
if (/* `saction->pin == 0` */ true) {
|
||||
Key *key = (Key *)ac->data;
|
||||
Key *key = static_cast<Key *>(ac->data);
|
||||
|
||||
if (key && key->adt) {
|
||||
saction->action = key->adt->action;
|
||||
@@ -167,7 +167,7 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction)
|
||||
|
||||
case SACTCONT_GPENCIL: /* Grease Pencil */ /* XXX review how this mode is handled... */
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
saction->ads.source = (ID *)ac->scene;
|
||||
saction->ads.source = reinterpret_cast<ID *>(ac->scene);
|
||||
|
||||
ac->datatype = ANIMCONT_GPENCIL;
|
||||
ac->data = &saction->ads;
|
||||
@@ -175,7 +175,7 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction)
|
||||
|
||||
case SACTCONT_CACHEFILE: /* Cache File */ /* XXX review how this mode is handled... */
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
saction->ads.source = (ID *)ac->scene;
|
||||
saction->ads.source = reinterpret_cast<ID *>(ac->scene);
|
||||
|
||||
ac->datatype = ANIMCONT_CHANNEL;
|
||||
ac->data = &saction->ads;
|
||||
@@ -191,7 +191,7 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction)
|
||||
#endif
|
||||
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
saction->ads.source = (ID *)ac->scene;
|
||||
saction->ads.source = reinterpret_cast<ID *>(ac->scene);
|
||||
|
||||
ac->datatype = ANIMCONT_MASK;
|
||||
ac->data = &saction->ads;
|
||||
@@ -200,7 +200,7 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction)
|
||||
|
||||
case SACTCONT_DOPESHEET: /* DopeSheet */
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
saction->ads.source = (ID *)ac->scene;
|
||||
saction->ads.source = reinterpret_cast<ID *>(ac->scene);
|
||||
|
||||
ac->datatype = ANIMCONT_DOPESHEET;
|
||||
ac->data = &saction->ads;
|
||||
@@ -208,7 +208,7 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction)
|
||||
|
||||
case SACTCONT_TIMELINE: /* Timeline */
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
saction->ads.source = (ID *)ac->scene;
|
||||
saction->ads.source = reinterpret_cast<ID *>(ac->scene);
|
||||
|
||||
/* sync scene's "selected keys only" flag with our "only selected" flag
|
||||
*
|
||||
@@ -244,7 +244,7 @@ static bool graphedit_get_context(bAnimContext *ac, SpaceGraph *sipo)
|
||||
/* init dopesheet data if non-existent (i.e. for old files) */
|
||||
if (sipo->ads == nullptr) {
|
||||
sipo->ads = static_cast<bDopeSheet *>(MEM_callocN(sizeof(bDopeSheet), "GraphEdit DopeSheet"));
|
||||
sipo->ads->source = (ID *)ac->scene;
|
||||
sipo->ads->source = reinterpret_cast<ID *>(ac->scene);
|
||||
}
|
||||
ac->ads = sipo->ads;
|
||||
ac->grapheditor_mode = eGraphEdit_Mode(sipo->mode);
|
||||
@@ -261,7 +261,7 @@ static bool graphedit_get_context(bAnimContext *ac, SpaceGraph *sipo)
|
||||
switch (sipo->mode) {
|
||||
case SIPO_MODE_ANIMATION: /* Animation F-Curve Editor */
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
sipo->ads->source = (ID *)ac->scene;
|
||||
sipo->ads->source = reinterpret_cast<ID *>(ac->scene);
|
||||
sipo->ads->filterflag &= ~ADS_FILTER_ONLYDRIVERS;
|
||||
|
||||
ac->datatype = ANIMCONT_FCURVES;
|
||||
@@ -270,7 +270,7 @@ static bool graphedit_get_context(bAnimContext *ac, SpaceGraph *sipo)
|
||||
|
||||
case SIPO_MODE_DRIVERS: /* Driver F-Curve Editor */
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
sipo->ads->source = (ID *)ac->scene;
|
||||
sipo->ads->source = reinterpret_cast<ID *>(ac->scene);
|
||||
sipo->ads->filterflag |= ADS_FILTER_ONLYDRIVERS;
|
||||
|
||||
ac->datatype = ANIMCONT_DRIVERS;
|
||||
@@ -297,7 +297,7 @@ static bool nlaedit_get_context(bAnimContext *ac, SpaceNla *snla)
|
||||
|
||||
/* sync settings with current view status, then return appropriate data */
|
||||
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
|
||||
snla->ads->source = (ID *)ac->scene;
|
||||
snla->ads->source = reinterpret_cast<ID *>(ac->scene);
|
||||
snla->ads->filterflag |= ADS_FILTER_ONLYNLA;
|
||||
|
||||
ac->datatype = ANIMCONT_NLA;
|
||||
@@ -317,17 +317,17 @@ bool ANIM_animdata_context_getdata(bAnimContext *ac)
|
||||
if (sl) {
|
||||
switch (ac->spacetype) {
|
||||
case SPACE_ACTION: {
|
||||
SpaceAction *saction = (SpaceAction *)sl;
|
||||
SpaceAction *saction = reinterpret_cast<SpaceAction *>(sl);
|
||||
ok = actedit_get_context(ac, saction);
|
||||
break;
|
||||
}
|
||||
case SPACE_GRAPH: {
|
||||
SpaceGraph *sipo = (SpaceGraph *)sl;
|
||||
SpaceGraph *sipo = reinterpret_cast<SpaceGraph *>(sl);
|
||||
ok = graphedit_get_context(ac, sipo);
|
||||
break;
|
||||
}
|
||||
case SPACE_NLA: {
|
||||
SpaceNla *snla = (SpaceNla *)sl;
|
||||
SpaceNla *snla = reinterpret_cast<SpaceNla *>(sl);
|
||||
ok = nlaedit_get_context(ac, snla);
|
||||
break;
|
||||
}
|
||||
@@ -639,7 +639,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_SCENE: {
|
||||
Scene *sce = (Scene *)data;
|
||||
Scene *sce = static_cast<Scene *>(data);
|
||||
|
||||
ale->flag = sce->flag;
|
||||
|
||||
@@ -650,7 +650,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_OBJECT: {
|
||||
Base *base = (Base *)data;
|
||||
Base *base = static_cast<Base *>(data);
|
||||
Object *ob = base->object;
|
||||
|
||||
ale->flag = ob->flag;
|
||||
@@ -662,7 +662,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_FILLACT_LAYERED: {
|
||||
bAction *action = (bAction *)data;
|
||||
bAction *action = static_cast<bAction *>(data);
|
||||
|
||||
ale->flag = action->flag;
|
||||
|
||||
@@ -681,7 +681,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_FILLACTD: {
|
||||
bAction *act = (bAction *)data;
|
||||
bAction *act = static_cast<bAction *>(data);
|
||||
|
||||
ale->flag = act->flag;
|
||||
|
||||
@@ -690,7 +690,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_FILLDRIVERS: {
|
||||
AnimData *adt = (AnimData *)data;
|
||||
AnimData *adt = static_cast<AnimData *>(data);
|
||||
|
||||
ale->flag = adt->flag;
|
||||
|
||||
@@ -700,115 +700,115 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSMAT: {
|
||||
Material *ma = (Material *)data;
|
||||
Material *ma = static_cast<Material *>(data);
|
||||
ale->flag = FILTER_MAT_OBJD(ma);
|
||||
key_data_from_adt(*ale, ma->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSLAM: {
|
||||
Light *la = (Light *)data;
|
||||
Light *la = static_cast<Light *>(data);
|
||||
ale->flag = FILTER_LAM_OBJD(la);
|
||||
key_data_from_adt(*ale, la->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSCAM: {
|
||||
Camera *ca = (Camera *)data;
|
||||
Camera *ca = static_cast<Camera *>(data);
|
||||
ale->flag = FILTER_CAM_OBJD(ca);
|
||||
key_data_from_adt(*ale, ca->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSCACHEFILE: {
|
||||
CacheFile *cache_file = (CacheFile *)data;
|
||||
CacheFile *cache_file = static_cast<CacheFile *>(data);
|
||||
ale->flag = FILTER_CACHEFILE_OBJD(cache_file);
|
||||
key_data_from_adt(*ale, cache_file->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSCUR: {
|
||||
Curve *cu = (Curve *)data;
|
||||
Curve *cu = static_cast<Curve *>(data);
|
||||
ale->flag = FILTER_CUR_OBJD(cu);
|
||||
key_data_from_adt(*ale, cu->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSARM: {
|
||||
bArmature *arm = (bArmature *)data;
|
||||
bArmature *arm = static_cast<bArmature *>(data);
|
||||
ale->flag = FILTER_ARM_OBJD(arm);
|
||||
key_data_from_adt(*ale, arm->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSMESH: {
|
||||
Mesh *mesh = (Mesh *)data;
|
||||
Mesh *mesh = static_cast<Mesh *>(data);
|
||||
ale->flag = FILTER_MESH_OBJD(mesh);
|
||||
key_data_from_adt(*ale, mesh->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSLAT: {
|
||||
Lattice *lt = (Lattice *)data;
|
||||
Lattice *lt = static_cast<Lattice *>(data);
|
||||
ale->flag = FILTER_LATTICE_OBJD(lt);
|
||||
key_data_from_adt(*ale, lt->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSSPK: {
|
||||
Speaker *spk = (Speaker *)data;
|
||||
Speaker *spk = static_cast<Speaker *>(data);
|
||||
ale->flag = FILTER_SPK_OBJD(spk);
|
||||
key_data_from_adt(*ale, spk->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSHAIR: {
|
||||
Curves *curves = (Curves *)data;
|
||||
Curves *curves = static_cast<Curves *>(data);
|
||||
ale->flag = FILTER_CURVES_OBJD(curves);
|
||||
key_data_from_adt(*ale, curves->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSPOINTCLOUD: {
|
||||
PointCloud *pointcloud = (PointCloud *)data;
|
||||
PointCloud *pointcloud = static_cast<PointCloud *>(data);
|
||||
ale->flag = FILTER_POINTS_OBJD(pointcloud);
|
||||
key_data_from_adt(*ale, pointcloud->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSVOLUME: {
|
||||
Volume *volume = (Volume *)data;
|
||||
Volume *volume = static_cast<Volume *>(data);
|
||||
ale->flag = FILTER_VOLUME_OBJD(volume);
|
||||
key_data_from_adt(*ale, volume->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSSKEY: {
|
||||
Key *key = (Key *)data;
|
||||
Key *key = static_cast<Key *>(data);
|
||||
ale->flag = FILTER_SKE_OBJD(key);
|
||||
key_data_from_adt(*ale, key->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSWOR: {
|
||||
World *wo = (World *)data;
|
||||
World *wo = static_cast<World *>(data);
|
||||
ale->flag = FILTER_WOR_SCED(wo);
|
||||
key_data_from_adt(*ale, wo->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSNTREE: {
|
||||
bNodeTree *ntree = (bNodeTree *)data;
|
||||
bNodeTree *ntree = static_cast<bNodeTree *>(data);
|
||||
ale->flag = FILTER_NTREE_DATA(ntree);
|
||||
key_data_from_adt(*ale, ntree->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSLINESTYLE: {
|
||||
FreestyleLineStyle *linestyle = (FreestyleLineStyle *)data;
|
||||
FreestyleLineStyle *linestyle = static_cast<FreestyleLineStyle *>(data);
|
||||
ale->flag = FILTER_LS_SCED(linestyle);
|
||||
key_data_from_adt(*ale, linestyle->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSPART: {
|
||||
ParticleSettings *part = (ParticleSettings *)ale->data;
|
||||
ParticleSettings *part = static_cast<ParticleSettings *>(ale->data);
|
||||
ale->flag = FILTER_PART_OBJD(part);
|
||||
key_data_from_adt(*ale, part->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSTEX: {
|
||||
Tex *tex = (Tex *)data;
|
||||
Tex *tex = static_cast<Tex *>(data);
|
||||
ale->flag = FILTER_TEX_DATA(tex);
|
||||
key_data_from_adt(*ale, tex->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSGPENCIL: {
|
||||
bGPdata *gpd = (bGPdata *)data;
|
||||
bGPdata *gpd = static_cast<bGPdata *>(data);
|
||||
/* NOTE: we just reuse the same expand filter for this case */
|
||||
ale->flag = EXPANDED_GPD(gpd);
|
||||
|
||||
@@ -817,13 +817,13 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSMCLIP: {
|
||||
MovieClip *clip = (MovieClip *)data;
|
||||
MovieClip *clip = static_cast<MovieClip *>(data);
|
||||
ale->flag = EXPANDED_MCLIP(clip);
|
||||
key_data_from_adt(*ale, clip->adt);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_NLACONTROLS: {
|
||||
AnimData *adt = (AnimData *)data;
|
||||
AnimData *adt = static_cast<AnimData *>(data);
|
||||
|
||||
ale->flag = adt->flag;
|
||||
|
||||
@@ -834,7 +834,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
case ANIMTYPE_GROUP: {
|
||||
BLI_assert_msg(GS(fcurve_owner_id->name) == ID_AC, "fcurve_owner_id should be an Action");
|
||||
|
||||
bActionGroup *agrp = (bActionGroup *)data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(data);
|
||||
|
||||
ale->flag = agrp->flag;
|
||||
|
||||
@@ -846,7 +846,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
case ANIMTYPE_NLACURVE: /* practically the same as ANIMTYPE_FCURVE.
|
||||
* Differences are applied post-creation */
|
||||
{
|
||||
FCurve *fcu = (FCurve *)data;
|
||||
FCurve *fcu = static_cast<FCurve *>(data);
|
||||
|
||||
ale->flag = fcu->flag;
|
||||
|
||||
@@ -855,8 +855,8 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_SHAPEKEY: {
|
||||
KeyBlock *kb = (KeyBlock *)data;
|
||||
Key *key = (Key *)ale->id;
|
||||
KeyBlock *kb = static_cast<KeyBlock *>(data);
|
||||
Key *key = reinterpret_cast<Key *>(ale->id);
|
||||
|
||||
ale->flag = kb->flag;
|
||||
|
||||
@@ -878,7 +878,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_GPLAYER: {
|
||||
bGPDlayer *gpl = (bGPDlayer *)data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(data);
|
||||
|
||||
ale->flag = gpl->flag;
|
||||
|
||||
@@ -914,7 +914,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_MASKLAYER: {
|
||||
MaskLayer *masklay = (MaskLayer *)data;
|
||||
MaskLayer *masklay = static_cast<MaskLayer *>(data);
|
||||
|
||||
ale->flag = masklay->flag;
|
||||
|
||||
@@ -923,7 +923,7 @@ static bAnimListElem *make_new_animlistelem(
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_NLATRACK: {
|
||||
NlaTrack *nlt = (NlaTrack *)data;
|
||||
NlaTrack *nlt = static_cast<NlaTrack *>(data);
|
||||
|
||||
ale->flag = nlt->flag;
|
||||
|
||||
@@ -970,7 +970,7 @@ static bool skip_fcurve_selected_data(bAnimContext *ac,
|
||||
!(ac->ads->filterflag & ADS_FILTER_INCL_HIDDEN);
|
||||
|
||||
if (GS(owner_id->name) == ID_OB) {
|
||||
Object *ob = (Object *)owner_id;
|
||||
Object *ob = reinterpret_cast<Object *>(owner_id);
|
||||
bPoseChannel *pchan = nullptr;
|
||||
char bone_name[sizeof(pchan->name)];
|
||||
|
||||
@@ -986,7 +986,7 @@ static bool skip_fcurve_selected_data(bAnimContext *ac,
|
||||
/* If only visible channels,
|
||||
* skip if bone not visible unless user wants channels from hidden data too. */
|
||||
if (skip_hidden) {
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
|
||||
/* skipping - not visible on currently visible layers */
|
||||
if (!ANIM_bonecoll_is_visible_pchan(arm, pchan)) {
|
||||
@@ -1008,7 +1008,7 @@ static bool skip_fcurve_selected_data(bAnimContext *ac,
|
||||
}
|
||||
}
|
||||
else if (GS(owner_id->name) == ID_SCE) {
|
||||
Scene *scene = (Scene *)owner_id;
|
||||
Scene *scene = reinterpret_cast<Scene *>(owner_id);
|
||||
Strip *strip = nullptr;
|
||||
char strip_name[sizeof(strip->name)];
|
||||
|
||||
@@ -1051,7 +1051,7 @@ static bool skip_fcurve_selected_data(bAnimContext *ac,
|
||||
}
|
||||
}
|
||||
else if (GS(owner_id->name) == ID_NT) {
|
||||
bNodeTree *ntree = (bNodeTree *)owner_id;
|
||||
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(owner_id);
|
||||
bNode *node = nullptr;
|
||||
char node_name[sizeof(node->name)];
|
||||
|
||||
@@ -1900,7 +1900,7 @@ static size_t animfilter_block_data(bAnimContext *ac,
|
||||
|
||||
/* image object data-blocks have no anim-data so check for nullptr */
|
||||
if (adt) {
|
||||
IdAdtTemplate *iat = (IdAdtTemplate *)id;
|
||||
IdAdtTemplate *iat = reinterpret_cast<IdAdtTemplate *>(id);
|
||||
|
||||
/* NOTE: this macro is used instead of inlining the logic here,
|
||||
* since this sort of filtering is still needed in a few places in the rest of the code still -
|
||||
@@ -2032,7 +2032,7 @@ static size_t animdata_filter_shapekey(bAnimContext *ac,
|
||||
key->adt->action->wrap(),
|
||||
key->adt->slot_handle,
|
||||
eAnimFilter_Flags(filter_mode),
|
||||
(ID *)key);
|
||||
reinterpret_cast<ID *>(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2221,7 +2221,8 @@ static size_t animdata_filter_grease_pencil_data(bAnimContext *ac,
|
||||
*/
|
||||
if (filter_mode & ANIMFILTER_ANIMDATA) {
|
||||
if (show_animdata) {
|
||||
items += animfilter_block_data(ac, anim_data, (ID *)grease_pencil, filter_mode);
|
||||
items += animfilter_block_data(
|
||||
ac, anim_data, reinterpret_cast<ID *>(grease_pencil), filter_mode);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -2231,7 +2232,8 @@ static size_t animdata_filter_grease_pencil_data(bAnimContext *ac,
|
||||
/* Add grease pencil layer channels. */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (grease_pencil->flag &GREASE_PENCIL_ANIM_CHANNEL_EXPANDED) {
|
||||
if (show_animdata) {
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)grease_pencil, filter_mode);
|
||||
tmp_items += animfilter_block_data(
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(grease_pencil), filter_mode);
|
||||
}
|
||||
|
||||
if (!(filter_mode & ANIMFILTER_FCURVESONLY)) {
|
||||
@@ -2488,7 +2490,7 @@ static size_t animdata_filter_ds_nodetree_group(bAnimContext *ac,
|
||||
/* add nodetree animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_NTREE_DATA(ntree)) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)ntree, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(ntree), filter_mode);
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
|
||||
@@ -2532,7 +2534,7 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac,
|
||||
items += animdata_filter_ds_nodetree(ac,
|
||||
anim_data,
|
||||
owner_id,
|
||||
(bNodeTree *)node->id,
|
||||
reinterpret_cast<bNodeTree *>(node->id),
|
||||
filter_mode | ANIMFILTER_TMP_IGNORE_ONLYSEL);
|
||||
}
|
||||
}
|
||||
@@ -2576,7 +2578,8 @@ static size_t animdata_filter_ds_linestyle(bAnimContext *ac,
|
||||
/* add scene-level animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_LS_SCED(linestyle)) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)linestyle, filter_mode);
|
||||
tmp_items += animfilter_block_data(
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(linestyle), filter_mode);
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
|
||||
@@ -2612,7 +2615,7 @@ static size_t animdata_filter_ds_texture(
|
||||
/* add texture's animation data to temp collection */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_TEX_DATA(tex)) {
|
||||
/* texture animdata */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)tex, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(tex), filter_mode);
|
||||
|
||||
/* nodes */
|
||||
if ((tex->nodetree) && !(ac->ads->filterflag & ADS_FILTER_NONTREE)) {
|
||||
@@ -2623,7 +2626,7 @@ static size_t animdata_filter_ds_texture(
|
||||
* but under their own section instead so that free-floating textures can also be animated.
|
||||
*/
|
||||
tmp_items += animdata_filter_ds_nodetree(
|
||||
ac, &tmp_data, (ID *)tex, tex->nodetree, filter_mode);
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(tex), tex->nodetree, filter_mode);
|
||||
}
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
@@ -2667,8 +2670,8 @@ static size_t animdata_filter_ds_textures(bAnimContext *ac,
|
||||
|
||||
switch (GS(owner_id->name)) {
|
||||
case ID_PA: {
|
||||
ParticleSettings *part = (ParticleSettings *)owner_id;
|
||||
mtex = (MTex **)(&part->mtex);
|
||||
ParticleSettings *part = reinterpret_cast<ParticleSettings *>(owner_id);
|
||||
mtex = reinterpret_cast<MTex **>(&part->mtex);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -2711,11 +2714,12 @@ static size_t animdata_filter_ds_material(bAnimContext *ac,
|
||||
/* add material's animation data to temp collection */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_MAT_OBJD(ma)) {
|
||||
/* material's animation data */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)ma, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(ma), filter_mode);
|
||||
|
||||
/* nodes */
|
||||
if ((ma->nodetree) && !(ac->ads->filterflag & ADS_FILTER_NONTREE)) {
|
||||
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, (ID *)ma, ma->nodetree, filter_mode);
|
||||
tmp_items += animdata_filter_ds_nodetree(
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(ma), ma->nodetree, filter_mode);
|
||||
}
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
@@ -2781,7 +2785,7 @@ static void animfilter_modifier_idpoin_cb(void *afm_ptr,
|
||||
ID **idpoin,
|
||||
LibraryForeachIDCallbackFlag /*cb_flag*/)
|
||||
{
|
||||
tAnimFilterModifiersContext *afm = (tAnimFilterModifiersContext *)afm_ptr;
|
||||
tAnimFilterModifiersContext *afm = static_cast<tAnimFilterModifiersContext *>(afm_ptr);
|
||||
ID *owner_id = &ob->id;
|
||||
ID *id = *idpoin;
|
||||
|
||||
@@ -2796,7 +2800,7 @@ static void animfilter_modifier_idpoin_cb(void *afm_ptr,
|
||||
switch (GS(id->name)) {
|
||||
case ID_TE: /* Textures */
|
||||
{
|
||||
Tex *tex = (Tex *)id;
|
||||
Tex *tex = reinterpret_cast<Tex *>(id);
|
||||
if (!(afm->ac->ads->filterflag & ADS_FILTER_NOTEX)) {
|
||||
BLI_assert(afm->ac->ads == afm->ads);
|
||||
afm->items += animdata_filter_ds_texture(
|
||||
@@ -2805,7 +2809,7 @@ static void animfilter_modifier_idpoin_cb(void *afm_ptr,
|
||||
break;
|
||||
}
|
||||
case ID_NT: {
|
||||
bNodeTree *node_tree = (bNodeTree *)id;
|
||||
bNodeTree *node_tree = reinterpret_cast<bNodeTree *>(id);
|
||||
if (!(afm->ac->ads->filterflag & ADS_FILTER_NONTREE)) {
|
||||
BLI_assert(afm->ac->ads == afm->ads);
|
||||
afm->items += animdata_filter_ds_nodetree(
|
||||
@@ -2880,11 +2884,13 @@ static size_t animdata_filter_ds_particles(bAnimContext *ac,
|
||||
/* add particle-system's animation data to temp collection */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_PART_OBJD(psys->part)) {
|
||||
/* particle system's animation data */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)psys->part, filter_mode);
|
||||
tmp_items += animfilter_block_data(
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(psys->part), filter_mode);
|
||||
|
||||
/* textures */
|
||||
if (!(ac->ads->filterflag & ADS_FILTER_NOTEX)) {
|
||||
tmp_items += animdata_filter_ds_textures(ac, &tmp_data, (ID *)psys->part, filter_mode);
|
||||
tmp_items += animdata_filter_ds_textures(
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(psys->part), filter_mode);
|
||||
}
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
@@ -2929,7 +2935,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
switch (ob->type) {
|
||||
case OB_CAMERA: /* ------- Camera ------------ */
|
||||
{
|
||||
Camera *ca = (Camera *)ob->data;
|
||||
Camera *ca = static_cast<Camera *>(ob->data);
|
||||
|
||||
if (ads_filterflag & ADS_FILTER_NOCAM) {
|
||||
return 0;
|
||||
@@ -2941,7 +2947,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_LAMP: /* ---------- Light ----------- */
|
||||
{
|
||||
Light *la = (Light *)ob->data;
|
||||
Light *la = static_cast<Light *>(ob->data);
|
||||
|
||||
if (ads_filterflag & ADS_FILTER_NOLAM) {
|
||||
return 0;
|
||||
@@ -2955,7 +2961,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
case OB_SURF: /* ------- Nurbs Surface ---------- */
|
||||
case OB_FONT: /* ------- Text Curve ---------- */
|
||||
{
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
Curve *cu = static_cast<Curve *>(ob->data);
|
||||
|
||||
if (ads_filterflag & ADS_FILTER_NOCUR) {
|
||||
return 0;
|
||||
@@ -2967,7 +2973,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_MBALL: /* ------- MetaBall ---------- */
|
||||
{
|
||||
MetaBall *mb = (MetaBall *)ob->data;
|
||||
MetaBall *mb = static_cast<MetaBall *>(ob->data);
|
||||
|
||||
if (ads_filterflag & ADS_FILTER_NOMBA) {
|
||||
return 0;
|
||||
@@ -2979,7 +2985,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_ARMATURE: /* ------- Armature ---------- */
|
||||
{
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
|
||||
if (ads_filterflag & ADS_FILTER_NOARM) {
|
||||
return 0;
|
||||
@@ -2991,7 +2997,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_MESH: /* ------- Mesh ---------- */
|
||||
{
|
||||
Mesh *mesh = (Mesh *)ob->data;
|
||||
Mesh *mesh = static_cast<Mesh *>(ob->data);
|
||||
|
||||
if (ads_filterflag & ADS_FILTER_NOMESH) {
|
||||
return 0;
|
||||
@@ -3003,7 +3009,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_LATTICE: /* ---- Lattice ---- */
|
||||
{
|
||||
Lattice *lt = (Lattice *)ob->data;
|
||||
Lattice *lt = static_cast<Lattice *>(ob->data);
|
||||
|
||||
if (ads_filterflag & ADS_FILTER_NOLAT) {
|
||||
return 0;
|
||||
@@ -3015,7 +3021,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_SPEAKER: /* ---------- Speaker ----------- */
|
||||
{
|
||||
Speaker *spk = (Speaker *)ob->data;
|
||||
Speaker *spk = static_cast<Speaker *>(ob->data);
|
||||
|
||||
type = ANIMTYPE_DSSPK;
|
||||
expanded = FILTER_SPK_OBJD(spk);
|
||||
@@ -3023,7 +3029,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_CURVES: /* ---------- Curves ----------- */
|
||||
{
|
||||
Curves *curves = (Curves *)ob->data;
|
||||
Curves *curves = static_cast<Curves *>(ob->data);
|
||||
|
||||
if (ads_filterflag2 & ADS_FILTER_NOHAIR) {
|
||||
return 0;
|
||||
@@ -3035,7 +3041,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_POINTCLOUD: /* ---------- PointCloud ----------- */
|
||||
{
|
||||
PointCloud *pointcloud = (PointCloud *)ob->data;
|
||||
PointCloud *pointcloud = static_cast<PointCloud *>(ob->data);
|
||||
|
||||
if (ads_filterflag2 & ADS_FILTER_NOPOINTCLOUD) {
|
||||
return 0;
|
||||
@@ -3047,7 +3053,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
}
|
||||
case OB_VOLUME: /* ---------- Volume ----------- */
|
||||
{
|
||||
Volume *volume = (Volume *)ob->data;
|
||||
Volume *volume = static_cast<Volume *>(ob->data);
|
||||
|
||||
if (ads_filterflag2 & ADS_FILTER_NOVOLUME) {
|
||||
return 0;
|
||||
@@ -3062,7 +3068,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac,
|
||||
/* add object data animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (expanded) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)iat, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(iat), filter_mode);
|
||||
|
||||
/* sub-data filtering... */
|
||||
switch (ob->type) {
|
||||
@@ -3112,7 +3118,7 @@ static size_t animdata_filter_ds_keyanim(
|
||||
/* add shapekey-level animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_SKE_OBJD(key)) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)key, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(key), filter_mode);
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
|
||||
@@ -3176,7 +3182,7 @@ static size_t animdata_filter_ds_obanim(bAnimContext *ac,
|
||||
/* add object-level animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (expanded) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)ob, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(ob), filter_mode);
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
|
||||
@@ -3294,11 +3300,12 @@ static size_t animdata_filter_ds_world(
|
||||
/* add world animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_WOR_SCED(wo)) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)wo, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(wo), filter_mode);
|
||||
|
||||
/* nodes */
|
||||
if ((wo->nodetree) && !(ac->ads->filterflag & ADS_FILTER_NONTREE)) {
|
||||
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, (ID *)wo, wo->nodetree, filter_mode);
|
||||
tmp_items += animdata_filter_ds_nodetree(
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(wo), wo->nodetree, filter_mode);
|
||||
}
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
@@ -3363,7 +3370,7 @@ static size_t animdata_filter_ds_scene(bAnimContext *ac,
|
||||
/* add scene-level animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (expanded) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)sce, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(sce), filter_mode);
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
|
||||
@@ -3413,7 +3420,8 @@ static size_t animdata_filter_dopesheet_scene(bAnimContext *ac,
|
||||
|
||||
/* nodetree */
|
||||
if ((ntree) && !(ac->ads->filterflag & ADS_FILTER_NONTREE)) {
|
||||
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, (ID *)sce, ntree, filter_mode);
|
||||
tmp_items += animdata_filter_ds_nodetree(
|
||||
ac, &tmp_data, reinterpret_cast<ID *>(sce), ntree, filter_mode);
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
@@ -3458,7 +3466,7 @@ static size_t animdata_filter_ds_movieclip(bAnimContext *ac,
|
||||
/* add world animation channels */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_MCLIP(clip)) {
|
||||
/* animation data filtering */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, (ID *)clip, filter_mode);
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, reinterpret_cast<ID *>(clip), filter_mode);
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
/* did we find anything? */
|
||||
@@ -3634,7 +3642,7 @@ static size_t animdata_filter_dopesheet(bAnimContext *ac,
|
||||
eAnimFilter_Flags filter_mode)
|
||||
{
|
||||
bDopeSheet *ads = ac->ads;
|
||||
Scene *scene = (Scene *)ads->source;
|
||||
Scene *scene = reinterpret_cast<Scene *>(ads->source);
|
||||
ViewLayer *view_layer = ac->view_layer;
|
||||
size_t items = 0;
|
||||
|
||||
@@ -3751,7 +3759,7 @@ static short animdata_filter_dopesheet_summary(bAnimContext *ac,
|
||||
* being applicable.
|
||||
*/
|
||||
if ((ac && ac->sl) && (ac->spacetype == SPACE_ACTION)) {
|
||||
SpaceAction *saction = (SpaceAction *)ac->sl;
|
||||
SpaceAction *saction = reinterpret_cast<SpaceAction *>(ac->sl);
|
||||
ads = &saction->ads;
|
||||
}
|
||||
else {
|
||||
@@ -3899,7 +3907,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac,
|
||||
case ANIMCONT_ACTION: /* 'Action Editor' */
|
||||
{
|
||||
Object *obact = ac->obact;
|
||||
SpaceAction *saction = (SpaceAction *)ac->sl;
|
||||
SpaceAction *saction = reinterpret_cast<SpaceAction *>(ac->sl);
|
||||
bDopeSheet *ads = (saction) ? &saction->ads : nullptr;
|
||||
BLI_assert(ads == ac->ads);
|
||||
UNUSED_VARS_NDEBUG(ads);
|
||||
@@ -3909,7 +3917,8 @@ size_t ANIM_animdata_filter(bAnimContext *ac,
|
||||
if (UNLIKELY(filter_mode & ANIMFILTER_ANIMDATA)) {
|
||||
/* all channels here are within the same AnimData block, hence this special case */
|
||||
if (LIKELY(obact->adt)) {
|
||||
ANIMCHANNEL_NEW_CHANNEL(ac->bmain, obact->adt, ANIMTYPE_ANIMDATA, (ID *)obact, nullptr);
|
||||
ANIMCHANNEL_NEW_CHANNEL(
|
||||
ac->bmain, obact->adt, ANIMTYPE_ANIMDATA, reinterpret_cast<ID *>(obact), nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -3922,7 +3931,8 @@ size_t ANIM_animdata_filter(bAnimContext *ac,
|
||||
|
||||
animrig::Action &action = static_cast<bAction *>(data)->wrap();
|
||||
const animrig::slot_handle_t slot_handle = obact->adt->slot_handle;
|
||||
items += animfilter_action(ac, anim_data, action, slot_handle, filter_mode, (ID *)obact);
|
||||
items += animfilter_action(
|
||||
ac, anim_data, action, slot_handle, filter_mode, reinterpret_cast<ID *>(obact));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3930,13 +3940,14 @@ size_t ANIM_animdata_filter(bAnimContext *ac,
|
||||
}
|
||||
case ANIMCONT_SHAPEKEY: /* 'ShapeKey Editor' */
|
||||
{
|
||||
Key *key = (Key *)data;
|
||||
Key *key = static_cast<Key *>(data);
|
||||
|
||||
/* specially check for AnimData filter, see #36687. */
|
||||
if (UNLIKELY(filter_mode & ANIMFILTER_ANIMDATA)) {
|
||||
/* all channels here are within the same AnimData block, hence this special case */
|
||||
if (LIKELY(key->adt)) {
|
||||
ANIMCHANNEL_NEW_CHANNEL(ac->bmain, key->adt, ANIMTYPE_ANIMDATA, (ID *)key, nullptr);
|
||||
ANIMCHANNEL_NEW_CHANNEL(
|
||||
ac->bmain, key->adt, ANIMTYPE_ANIMDATA, reinterpret_cast<ID *>(key), nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -67,7 +67,7 @@ ListBase *ED_scene_markers_get(Scene *scene, ScrArea *area)
|
||||
/* local marker sets... */
|
||||
if (area) {
|
||||
if (area->spacetype == SPACE_ACTION) {
|
||||
SpaceAction *saction = (SpaceAction *)area->spacedata.first;
|
||||
SpaceAction *saction = static_cast<SpaceAction *>(area->spacedata.first);
|
||||
|
||||
/* local markers can only be shown when there's only a single active action to grab them from
|
||||
* - flag only takes effect when there's an action, otherwise it can get too confusing?
|
||||
@@ -826,12 +826,14 @@ struct MarkerMove {
|
||||
|
||||
static bool ed_marker_move_use_time(MarkerMove *mm)
|
||||
{
|
||||
if (((mm->slink->spacetype == SPACE_SEQ) && !(((SpaceSeq *)mm->slink)->flag & SEQ_DRAWFRAMES)) ||
|
||||
if (((mm->slink->spacetype == SPACE_SEQ) &&
|
||||
!(reinterpret_cast<SpaceSeq *>(mm->slink)->flag & SEQ_DRAWFRAMES)) ||
|
||||
((mm->slink->spacetype == SPACE_ACTION) &&
|
||||
(((SpaceAction *)mm->slink)->flag & SACTION_DRAWTIME)) ||
|
||||
(reinterpret_cast<SpaceAction *>(mm->slink)->flag & SACTION_DRAWTIME)) ||
|
||||
((mm->slink->spacetype == SPACE_GRAPH) &&
|
||||
(((SpaceGraph *)mm->slink)->flag & SIPO_DRAWTIME)) ||
|
||||
((mm->slink->spacetype == SPACE_NLA) && (((SpaceNla *)mm->slink)->flag & SNLA_DRAWTIME)))
|
||||
(reinterpret_cast<SpaceGraph *>(mm->slink)->flag & SIPO_DRAWTIME)) ||
|
||||
((mm->slink->spacetype == SPACE_NLA) &&
|
||||
(reinterpret_cast<SpaceNla *>(mm->slink)->flag & SNLA_DRAWTIME)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ static void fmodifier_reorder(bContext *C, Panel *panel, int new_index)
|
||||
static short get_fmodifier_expand_flag(const bContext * /*C*/, Panel *panel)
|
||||
{
|
||||
PointerRNA *ptr = fmodifier_get_pointers(nullptr, panel, nullptr);
|
||||
FModifier *fcm = (FModifier *)ptr->data;
|
||||
FModifier *fcm = static_cast<FModifier *>(ptr->data);
|
||||
|
||||
return fcm->ui_expand_flag;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ static short get_fmodifier_expand_flag(const bContext * /*C*/, Panel *panel)
|
||||
static void set_fmodifier_expand_flag(const bContext * /*C*/, Panel *panel, short expand_flag)
|
||||
{
|
||||
PointerRNA *ptr = fmodifier_get_pointers(nullptr, panel, nullptr);
|
||||
FModifier *fcm = (FModifier *)ptr->data;
|
||||
FModifier *fcm = static_cast<FModifier *>(ptr->data);
|
||||
|
||||
fcm->ui_expand_flag = expand_flag;
|
||||
}
|
||||
@@ -236,9 +236,9 @@ struct FModifierDeleteContext {
|
||||
|
||||
static void delete_fmodifier_cb(bContext *C, void *ctx_v, void *fcm_v)
|
||||
{
|
||||
FModifierDeleteContext *ctx = (FModifierDeleteContext *)ctx_v;
|
||||
FModifierDeleteContext *ctx = static_cast<FModifierDeleteContext *>(ctx_v);
|
||||
ListBase *modifiers = ctx->modifiers;
|
||||
FModifier *fcm = (FModifier *)fcm_v;
|
||||
FModifier *fcm = static_cast<FModifier *>(fcm_v);
|
||||
|
||||
/* remove the given F-Modifier from the active modifier-stack */
|
||||
remove_fmodifier(modifiers, fcm);
|
||||
@@ -251,7 +251,7 @@ static void delete_fmodifier_cb(bContext *C, void *ctx_v, void *fcm_v)
|
||||
|
||||
static void fmodifier_influence_draw(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
FModifier *fcm = (FModifier *)ptr->data;
|
||||
FModifier *fcm = static_cast<FModifier *>(ptr->data);
|
||||
uiItemS(layout);
|
||||
|
||||
uiLayout *row = uiLayoutRowWithHeading(layout, true, IFACE_("Influence"));
|
||||
@@ -281,7 +281,7 @@ static void fmodifier_frame_range_draw(const bContext *C, Panel *panel)
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
uiLayoutSetPropDecorate(layout, false);
|
||||
|
||||
FModifier *fcm = (FModifier *)ptr->data;
|
||||
FModifier *fcm = static_cast<FModifier *>(ptr->data);
|
||||
uiLayoutSetActive(layout, fcm->flag & FMODIFIER_FLAG_RANGERESTRICT);
|
||||
|
||||
col = uiLayoutColumn(layout, true);
|
||||
@@ -299,7 +299,7 @@ static void fmodifier_panel_header(const bContext *C, Panel *panel)
|
||||
|
||||
ID *owner_id;
|
||||
PointerRNA *ptr = fmodifier_get_pointers(C, panel, &owner_id);
|
||||
FModifier *fcm = (FModifier *)ptr->data;
|
||||
FModifier *fcm = static_cast<FModifier *>(ptr->data);
|
||||
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||
|
||||
uiBlock *block = uiLayoutGetBlock(layout);
|
||||
@@ -360,8 +360,8 @@ static void generator_panel_draw(const bContext *C, Panel *panel)
|
||||
|
||||
ID *owner_id;
|
||||
PointerRNA *ptr = fmodifier_get_pointers(C, panel, &owner_id);
|
||||
FModifier *fcm = (FModifier *)ptr->data;
|
||||
FMod_Generator *data = (FMod_Generator *)fcm->data;
|
||||
FModifier *fcm = static_cast<FModifier *>(ptr->data);
|
||||
FMod_Generator *data = static_cast<FMod_Generator *>(fcm->data);
|
||||
|
||||
uiItemR(layout, ptr, "mode", UI_ITEM_NONE, "", ICON_NONE);
|
||||
|
||||
@@ -581,7 +581,7 @@ static void panel_register_noise(ARegionType *region_type,
|
||||
static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void * /*arg*/)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
FMod_Envelope *env = (FMod_Envelope *)fcm_dv;
|
||||
FMod_Envelope *env = static_cast<FMod_Envelope *>(fcm_dv);
|
||||
FCM_EnvelopeData *fedn;
|
||||
FCM_EnvelopeData fed;
|
||||
|
||||
@@ -638,7 +638,7 @@ static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void * /*arg*/)
|
||||
/* TODO: should we have a separate file for things like this? */
|
||||
static void fmod_envelope_deletepoint_cb(bContext * /*C*/, void *fcm_dv, void *ind_v)
|
||||
{
|
||||
FMod_Envelope *env = (FMod_Envelope *)fcm_dv;
|
||||
FMod_Envelope *env = static_cast<FMod_Envelope *>(fcm_dv);
|
||||
FCM_EnvelopeData *fedn;
|
||||
int index = POINTER_AS_INT(ind_v);
|
||||
|
||||
@@ -673,8 +673,8 @@ static void envelope_panel_draw(const bContext *C, Panel *panel)
|
||||
|
||||
ID *owner_id;
|
||||
PointerRNA *ptr = fmodifier_get_pointers(C, panel, &owner_id);
|
||||
FModifier *fcm = (FModifier *)ptr->data;
|
||||
FMod_Envelope *env = (FMod_Envelope *)fcm->data;
|
||||
FModifier *fcm = static_cast<FModifier *>(ptr->data);
|
||||
FMod_Envelope *env = static_cast<FMod_Envelope *>(fcm->data);
|
||||
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
uiLayoutSetPropDecorate(layout, false);
|
||||
|
||||
@@ -264,7 +264,8 @@ static short ob_keyframes_loop(KeyframeEditData *ked,
|
||||
/* Loop through each F-Curve, applying the operation as required,
|
||||
* but stopping on the first one. */
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
if (ANIM_fcurve_keyframes_loop(ked, (FCurve *)ale->data, key_ok, key_cb, fcu_cb)) {
|
||||
if (ANIM_fcurve_keyframes_loop(ked, static_cast<FCurve *>(ale->data), key_ok, key_cb, fcu_cb))
|
||||
{
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
@@ -313,7 +314,8 @@ static short scene_keyframes_loop(KeyframeEditData *ked,
|
||||
/* Loop through each F-Curve, applying the operation as required,
|
||||
* but stopping on the first one. */
|
||||
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
|
||||
if (ANIM_fcurve_keyframes_loop(ked, (FCurve *)ale->data, key_ok, key_cb, fcu_cb)) {
|
||||
if (ANIM_fcurve_keyframes_loop(ked, static_cast<FCurve *>(ale->data), key_ok, key_cb, fcu_cb))
|
||||
{
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
@@ -421,7 +423,8 @@ short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked,
|
||||
* NOTE: must keep this code in sync with the drawing code and also the filtering code!
|
||||
*/
|
||||
case ALE_GROUP: /* action group */
|
||||
return agrp_keyframes_loop(ked, (bActionGroup *)ale->data, key_ok, key_cb, fcu_cb);
|
||||
return agrp_keyframes_loop(
|
||||
ked, static_cast<bActionGroup *>(ale->data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_ACTION_LAYERED: { /* Layered Action. */
|
||||
/* This assumes that the ALE_ACTION_LAYERED channel is shown in the dopesheet context,
|
||||
* underneath the data-block that owns `ale->adt`. So that means that the loop is limited to
|
||||
@@ -438,13 +441,17 @@ short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked,
|
||||
}
|
||||
|
||||
case ALE_ACT: /* Legacy Action. */
|
||||
return action_legacy_keyframes_loop(ked, (bAction *)ale->key_data, key_ok, key_cb, fcu_cb);
|
||||
return action_legacy_keyframes_loop(
|
||||
ked, static_cast<bAction *>(ale->key_data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_OB: /* object */
|
||||
return ob_keyframes_loop(ked, ads, (Object *)ale->key_data, key_ok, key_cb, fcu_cb);
|
||||
return ob_keyframes_loop(
|
||||
ked, ads, static_cast<Object *>(ale->key_data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_SCE: /* scene */
|
||||
return scene_keyframes_loop(ked, ads, (Scene *)ale->data, key_ok, key_cb, fcu_cb);
|
||||
return scene_keyframes_loop(
|
||||
ked, ads, static_cast<Scene *>(ale->data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_ALL: /* 'all' (DopeSheet summary) */
|
||||
return summary_keyframes_loop(ked, (bAnimContext *)ale->data, key_ok, key_cb, fcu_cb);
|
||||
return summary_keyframes_loop(
|
||||
ked, static_cast<bAnimContext *>(ale->data), key_ok, key_cb, fcu_cb);
|
||||
|
||||
case ALE_NONE:
|
||||
case ALE_GPFRAME:
|
||||
@@ -482,20 +489,22 @@ short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked,
|
||||
* NOTE: must keep this code in sync with the drawing code and also the filtering code!
|
||||
*/
|
||||
case ALE_GROUP: /* action group */
|
||||
return agrp_keyframes_loop(ked, (bActionGroup *)data, key_ok, key_cb, fcu_cb);
|
||||
return agrp_keyframes_loop(ked, static_cast<bActionGroup *>(data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_ACTION_LAYERED:
|
||||
case ALE_ACTION_SLOT:
|
||||
/* This function is only used in nlaedit_apply_scale_exec(). Since the NLA has no support for
|
||||
* layered Actions in strips, there is no need to implement this here. */
|
||||
return 0;
|
||||
case ALE_ACT: /* action */
|
||||
return action_legacy_keyframes_loop(ked, (bAction *)data, key_ok, key_cb, fcu_cb);
|
||||
return action_legacy_keyframes_loop(
|
||||
ked, static_cast<bAction *>(data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_OB: /* object */
|
||||
return ob_keyframes_loop(ked, ads, (Object *)data, key_ok, key_cb, fcu_cb);
|
||||
return ob_keyframes_loop(ked, ads, static_cast<Object *>(data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_SCE: /* scene */
|
||||
return scene_keyframes_loop(ked, ads, (Scene *)data, key_ok, key_cb, fcu_cb);
|
||||
return scene_keyframes_loop(ked, ads, static_cast<Scene *>(data), key_ok, key_cb, fcu_cb);
|
||||
case ALE_ALL: /* 'all' (DopeSheet summary) */
|
||||
return summary_keyframes_loop(ked, (bAnimContext *)data, key_ok, key_cb, fcu_cb);
|
||||
return summary_keyframes_loop(
|
||||
ked, static_cast<bAnimContext *>(data), key_ok, key_cb, fcu_cb);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -847,7 +856,7 @@ short bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt)
|
||||
|
||||
void bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt)
|
||||
{
|
||||
KeyframeEditCD_Remap *rmap = (KeyframeEditCD_Remap *)ked->data;
|
||||
KeyframeEditCD_Remap *rmap = static_cast<KeyframeEditCD_Remap *>(ked->data);
|
||||
const float scale = (rmap->newMax - rmap->newMin) / (rmap->oldMax - rmap->oldMin);
|
||||
|
||||
/* perform transform on all three handles unless indicated otherwise */
|
||||
|
||||
@@ -102,7 +102,7 @@ void clean_fcurve(bAnimListElem *ale,
|
||||
bool cleardefault,
|
||||
const bool only_selected_keys)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->key_data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->key_data);
|
||||
BezTriple *old_bezts, *bezt, *beztn;
|
||||
BezTriple *lastb;
|
||||
int totCount, i;
|
||||
@@ -1070,7 +1070,7 @@ static void decimate_fcurve_segment(FCurve *fcu,
|
||||
|
||||
bool decimate_fcurve(bAnimListElem *ale, float remove_ratio, float error_sq_max)
|
||||
{
|
||||
FCurve *fcu = (FCurve *)ale->key_data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->key_data);
|
||||
/* Check if the curve actually has any points. */
|
||||
if (fcu == nullptr || fcu->bezt == nullptr || fcu->totvert == 0) {
|
||||
return true;
|
||||
@@ -1359,7 +1359,7 @@ static bool is_animating_bone(const bAnimListElem *ale)
|
||||
return false;
|
||||
}
|
||||
|
||||
FCurve *fcurve = (FCurve *)ale->key_data;
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->key_data);
|
||||
if (!fcurve->rna_path) {
|
||||
return false;
|
||||
}
|
||||
@@ -2062,7 +2062,7 @@ static float paste_get_y_offset(const bAnimContext *ac,
|
||||
|
||||
switch (value_offset_mode) {
|
||||
case KEYFRAME_PASTE_VALUE_OFFSET_CURSOR: {
|
||||
const SpaceGraph *sipo = (SpaceGraph *)ac->sl;
|
||||
const SpaceGraph *sipo = reinterpret_cast<SpaceGraph *>(ac->sl);
|
||||
const float offset = sipo->cursorVal - fcurve_in_copy_buffer.bezt[0].vec[1][1];
|
||||
return offset;
|
||||
}
|
||||
@@ -2136,7 +2136,7 @@ eKeyPasteError paste_animedit_keys(bAnimContext *ac,
|
||||
if (from_single && to_single) {
|
||||
/* 1:1 match, no tricky checking, just paste. */
|
||||
bAnimListElem *ale = static_cast<bAnimListElem *>(anim_data->first);
|
||||
FCurve *fcu = (FCurve *)ale->data; /* destination F-Curve */
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data); /* destination F-Curve */
|
||||
const FCurve &fcurve_in_copy_buffer =
|
||||
*keyframe_copy_buffer->keyframe_data.channelbag(0)->fcurve(0);
|
||||
|
||||
@@ -2173,7 +2173,7 @@ eKeyPasteError paste_animedit_keys(bAnimContext *ac,
|
||||
ac, *fcurve_in_copy_buffer, ale, paste_context.value_offset_mode);
|
||||
|
||||
/* Do the actual pasting. */
|
||||
FCurve *fcurve_to_paste_into = (FCurve *)ale->data;
|
||||
FCurve *fcurve_to_paste_into = static_cast<FCurve *>(ale->data);
|
||||
ANIM_nla_mapping_apply_if_needed_fcurve(ale, fcurve_to_paste_into, false, false);
|
||||
paste_animedit_keys_fcurve(fcurve_to_paste_into,
|
||||
*fcurve_in_copy_buffer,
|
||||
|
||||
@@ -556,7 +556,7 @@ static ActKeyColumn *nalloc_ak_gpframe(void *data)
|
||||
{
|
||||
ActKeyColumn *ak = static_cast<ActKeyColumn *>(
|
||||
MEM_callocN(sizeof(ActKeyColumn), "ActKeyColumnGPF"));
|
||||
const bGPDframe *gpf = (bGPDframe *)data;
|
||||
const bGPDframe *gpf = static_cast<bGPDframe *>(data);
|
||||
|
||||
/* store settings based on state of BezTriple */
|
||||
ak->cfra = gpf->framenum;
|
||||
@@ -576,7 +576,7 @@ static ActKeyColumn *nalloc_ak_gpframe(void *data)
|
||||
/* Node updater callback used for building ActKeyColumns from GPencil frames. */
|
||||
static void nupdate_ak_gpframe(ActKeyColumn *ak, void *data)
|
||||
{
|
||||
bGPDframe *gpf = (bGPDframe *)data;
|
||||
bGPDframe *gpf = static_cast<bGPDframe *>(data);
|
||||
|
||||
/* Set selection status and 'touched' status. */
|
||||
if (gpf->flag & GP_FRAME_SELECT) {
|
||||
@@ -599,7 +599,7 @@ static ActKeyColumn *nalloc_ak_masklayshape(void *data)
|
||||
{
|
||||
ActKeyColumn *ak = static_cast<ActKeyColumn *>(
|
||||
MEM_callocN(sizeof(ActKeyColumn), "ActKeyColumnGPF"));
|
||||
const MaskLayerShape *masklay_shape = (const MaskLayerShape *)data;
|
||||
const MaskLayerShape *masklay_shape = static_cast<const MaskLayerShape *>(data);
|
||||
|
||||
/* Store settings based on state of BezTriple. */
|
||||
ak->cfra = masklay_shape->frame;
|
||||
@@ -614,7 +614,7 @@ static ActKeyColumn *nalloc_ak_masklayshape(void *data)
|
||||
/* Node updater callback used for building ActKeyColumns from GPencil frames */
|
||||
static void nupdate_ak_masklayshape(ActKeyColumn *ak, void *data)
|
||||
{
|
||||
MaskLayerShape *masklay_shape = (MaskLayerShape *)data;
|
||||
MaskLayerShape *masklay_shape = static_cast<MaskLayerShape *>(data);
|
||||
|
||||
/* Set selection status and 'touched' status. */
|
||||
if (masklay_shape->flag & MASK_SHAPE_SELECT) {
|
||||
|
||||
@@ -175,7 +175,7 @@ static int insert_key_with_keyingset(bContext *C, wmOperator *op, KeyingSet *ks)
|
||||
/* exit the edit mode to make sure that those object data properties that have been
|
||||
* updated since the last switching to the edit mode will be keyframed correctly
|
||||
*/
|
||||
if (obedit && blender::animrig::keyingset_find_id(ks, (ID *)obedit->data)) {
|
||||
if (obedit && blender::animrig::keyingset_find_id(ks, static_cast<ID *>(obedit->data))) {
|
||||
blender::ed::object::mode_set(C, OB_MODE_OBJECT);
|
||||
ob_edit_mode = true;
|
||||
}
|
||||
@@ -806,7 +806,7 @@ static bool can_delete_key(FCurve *fcu, Object *ob, ReportList *reports)
|
||||
/* skip if bone is not selected */
|
||||
if ((pchan) && (pchan->bone)) {
|
||||
/* bones are only selected/editable if visible... */
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
|
||||
/* skipping - not visible on currently visible layers */
|
||||
if (!ANIM_bonecoll_is_visible_pchan(arm, pchan)) {
|
||||
|
||||
@@ -436,7 +436,7 @@ static void update_duplicate_subtarget(EditBone *dup_bone,
|
||||
static void update_duplicate_action_constraint_settings(
|
||||
EditBone *dup_bone, EditBone *orig_bone, Object *ob, bPoseChannel *pchan, bConstraint *curcon)
|
||||
{
|
||||
bActionConstraint *act_con = (bActionConstraint *)curcon->data;
|
||||
bActionConstraint *act_con = static_cast<bActionConstraint *>(curcon->data);
|
||||
|
||||
float mat[4][4];
|
||||
|
||||
@@ -588,7 +588,7 @@ static void update_duplicate_action_constraint_settings(
|
||||
static void update_duplicate_kinematics_constraint_settings(bConstraint *curcon)
|
||||
{
|
||||
/* IK constraint */
|
||||
bKinematicConstraint *ik = (bKinematicConstraint *)curcon->data;
|
||||
bKinematicConstraint *ik = static_cast<bKinematicConstraint *>(curcon->data);
|
||||
ik->poleangle = -M_PI - ik->poleangle;
|
||||
/* Wrap the angle to the +/-180.0f range (default soft limit of the input boxes). */
|
||||
ik->poleangle = angle_wrap_rad(ik->poleangle);
|
||||
@@ -600,7 +600,7 @@ static void update_duplicate_loc_rot_constraint_settings(Object *ob,
|
||||
{
|
||||
/* This code assumes that bRotLimitConstraint and bLocLimitConstraint have the same fields in
|
||||
* the same memory locations. */
|
||||
bRotLimitConstraint *limit = (bRotLimitConstraint *)curcon->data;
|
||||
bRotLimitConstraint *limit = static_cast<bRotLimitConstraint *>(curcon->data);
|
||||
float local_mat[4][4], imat[4][4];
|
||||
|
||||
float min_vec[3], max_vec[3];
|
||||
@@ -678,7 +678,7 @@ static void update_duplicate_transform_constraint_settings(Object *ob,
|
||||
bPoseChannel *pchan,
|
||||
bConstraint *curcon)
|
||||
{
|
||||
bTransformConstraint *trans = (bTransformConstraint *)curcon->data;
|
||||
bTransformConstraint *trans = static_cast<bTransformConstraint *>(curcon->data);
|
||||
|
||||
float target_mat[4][4], own_mat[4][4], imat[4][4];
|
||||
|
||||
@@ -967,7 +967,7 @@ static void update_duplicate_custom_bone_shapes(bContext *C, EditBone *dup_bone,
|
||||
|
||||
/* Skip the first two chars in the object name as those are used to store object type */
|
||||
BLI_string_flip_side_name(name_flip, pchan->custom->id.name + 2, false, sizeof(name_flip));
|
||||
Object *shape_ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, name_flip);
|
||||
Object *shape_ob = reinterpret_cast<Object *>(BKE_libblock_find_name(bmain, ID_OB, name_flip));
|
||||
|
||||
/* If name_flip doesn't exist, BKE_libblock_find_name() returns pchan->custom (best match) */
|
||||
shape_ob = shape_ob == pchan->custom ? nullptr : shape_ob;
|
||||
|
||||
@@ -760,7 +760,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op)
|
||||
short headtail = 0;
|
||||
|
||||
/* check that the points don't belong to the same bone */
|
||||
ebp_a = (EditBonePoint *)points.first;
|
||||
ebp_a = static_cast<EditBonePoint *>(points.first);
|
||||
ebp_b = ebp_a->next;
|
||||
|
||||
if (((ebp_a->head_owner == ebp_b->tail_owner) && (ebp_a->head_owner != nullptr)) ||
|
||||
@@ -1071,7 +1071,7 @@ static void bone_align_to_bone(ListBase *edbo, EditBone *selbone, EditBone *actb
|
||||
static int armature_align_bones_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = CTX_data_edit_object(C);
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
EditBone *actbone = CTX_data_active_bone(C);
|
||||
EditBone *actmirb = nullptr;
|
||||
int num_selected_bones;
|
||||
|
||||
@@ -99,7 +99,7 @@ void ED_armature_ebone_unique_name(ListBase *ebones, char *name, EditBone *bone)
|
||||
|
||||
static bool bone_unique_check(void *arg, const char *name)
|
||||
{
|
||||
return BKE_armature_find_bone_name((bArmature *)arg, name) != nullptr;
|
||||
return BKE_armature_find_bone_name(static_cast<bArmature *>(arg), name) != nullptr;
|
||||
}
|
||||
|
||||
static void ed_armature_bone_unique_name(bArmature *arm, char *name)
|
||||
@@ -137,7 +137,7 @@ static void constraint_bone_name_fix(Object *ob,
|
||||
|
||||
/* action constraints */
|
||||
if (curcon->type == CONSTRAINT_TYPE_ACTION) {
|
||||
bActionConstraint *actcon = (bActionConstraint *)curcon->data;
|
||||
bActionConstraint *actcon = static_cast<bActionConstraint *>(curcon->data);
|
||||
BKE_action_fix_paths_rename(
|
||||
&ob->id, actcon->act, "pose.bones", oldname, newname, 0, 0, true);
|
||||
}
|
||||
@@ -283,7 +283,7 @@ void ED_armature_bone_rename(Main *bmain,
|
||||
LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
|
||||
switch (md->type) {
|
||||
case eModifierType_Hook: {
|
||||
HookModifierData *hmd = (HookModifierData *)md;
|
||||
HookModifierData *hmd = reinterpret_cast<HookModifierData *>(md);
|
||||
|
||||
if (hmd->object && (hmd->object->data == arm)) {
|
||||
if (STREQ(hmd->subtarget, oldname)) {
|
||||
@@ -293,7 +293,7 @@ void ED_armature_bone_rename(Main *bmain,
|
||||
break;
|
||||
}
|
||||
case eModifierType_UVWarp: {
|
||||
UVWarpModifierData *umd = (UVWarpModifierData *)md;
|
||||
UVWarpModifierData *umd = reinterpret_cast<UVWarpModifierData *>(md);
|
||||
|
||||
if (umd->object_src && (umd->object_src->data == arm)) {
|
||||
if (STREQ(umd->bone_src, oldname)) {
|
||||
@@ -314,7 +314,7 @@ void ED_armature_bone_rename(Main *bmain,
|
||||
|
||||
/* fix camera focus */
|
||||
if (ob->type == OB_CAMERA) {
|
||||
Camera *cam = (Camera *)ob->data;
|
||||
Camera *cam = static_cast<Camera *>(ob->data);
|
||||
if ((cam->dof.focus_object != nullptr) && (cam->dof.focus_object->data == arm)) {
|
||||
if (STREQ(cam->dof.focus_subtarget, oldname)) {
|
||||
STRNCPY(cam->dof.focus_subtarget, newname);
|
||||
@@ -362,7 +362,7 @@ void ED_armature_bone_rename(Main *bmain,
|
||||
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
|
||||
LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
|
||||
if (sl->spacetype == SPACE_VIEW3D) {
|
||||
View3D *v3d = (View3D *)sl;
|
||||
View3D *v3d = reinterpret_cast<View3D *>(sl);
|
||||
if (v3d->ob_center && v3d->ob_center->data == arm) {
|
||||
if (STREQ(v3d->ob_center_bone, oldname)) {
|
||||
STRNCPY(v3d->ob_center_bone, newname);
|
||||
|
||||
@@ -608,7 +608,7 @@ static void separated_armature_fix_links(Main *bmain, Object *origArm, Object *n
|
||||
*/
|
||||
static void separate_armature_bones(Main *bmain, Object *ob, const bool is_select)
|
||||
{
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
bPoseChannel *pchan, *pchann;
|
||||
EditBone *curbone;
|
||||
|
||||
@@ -861,7 +861,7 @@ static const EnumPropertyItem prop_editarm_make_parent_types[] = {
|
||||
static int armature_parent_set_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = CTX_data_edit_object(C);
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
EditBone *actbone = CTX_data_active_bone(C);
|
||||
EditBone *actmirb = nullptr;
|
||||
short val = RNA_enum_get(op->ptr, "type");
|
||||
|
||||
@@ -657,7 +657,7 @@ static EditBone *get_nearest_editbonepoint(
|
||||
/* find the bone after the current active bone, so as to bump up its chances in selection.
|
||||
* this way overlapping bones will cycle selection state as with objects. */
|
||||
Object *obedit_orig = vc->obedit;
|
||||
EditBone *ebone_active_orig = ((bArmature *)obedit_orig->data)->act_edbone;
|
||||
EditBone *ebone_active_orig = static_cast<bArmature *>(obedit_orig->data)->act_edbone;
|
||||
if (ebone_active_orig == nullptr) {
|
||||
use_cycle = false;
|
||||
}
|
||||
@@ -1452,7 +1452,7 @@ static void armature_select_less(bArmature * /*arm*/, EditBone *ebone)
|
||||
|
||||
static void armature_select_more_less(Object *ob, bool more)
|
||||
{
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
|
||||
/* XXX(@ideasman42): eventually we shouldn't need this. */
|
||||
ED_armature_edit_sync_selection(arm->edbo);
|
||||
@@ -2035,7 +2035,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
|
||||
int direction = RNA_enum_get(op->ptr, "direction");
|
||||
const bool add_to_sel = RNA_boolean_get(op->ptr, "extend");
|
||||
bool changed = false;
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
|
||||
ebone_active = arm->act_edbone;
|
||||
if (ebone_active == nullptr) {
|
||||
|
||||
@@ -400,7 +400,7 @@ static void add_verts_to_dgroups(ReportList *reports,
|
||||
}
|
||||
|
||||
/* create verts */
|
||||
mesh = (Mesh *)ob->data;
|
||||
mesh = static_cast<Mesh *>(ob->data);
|
||||
verts = static_cast<float(*)[3]>(
|
||||
MEM_callocN(mesh->verts_num * sizeof(*verts), "closestboneverts"));
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ static bool armature_undosys_poll(bContext *C)
|
||||
|
||||
static bool armature_undosys_step_encode(bContext *C, Main *bmain, UndoStep *us_p)
|
||||
{
|
||||
ArmatureUndoStep *us = (ArmatureUndoStep *)us_p;
|
||||
ArmatureUndoStep *us = reinterpret_cast<ArmatureUndoStep *>(us_p);
|
||||
|
||||
/* Important not to use the 3D view when getting objects because all objects
|
||||
* outside of this list will be moved out of edit-mode when reading back undo steps. */
|
||||
@@ -246,7 +246,7 @@ static bool armature_undosys_step_encode(bContext *C, Main *bmain, UndoStep *us_
|
||||
static void armature_undosys_step_decode(
|
||||
bContext *C, Main *bmain, UndoStep *us_p, const eUndoStepDir /*dir*/, bool /*is_final*/)
|
||||
{
|
||||
ArmatureUndoStep *us = (ArmatureUndoStep *)us_p;
|
||||
ArmatureUndoStep *us = reinterpret_cast<ArmatureUndoStep *>(us_p);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
|
||||
@@ -288,7 +288,7 @@ static void armature_undosys_step_decode(
|
||||
|
||||
static void armature_undosys_step_free(UndoStep *us_p)
|
||||
{
|
||||
ArmatureUndoStep *us = (ArmatureUndoStep *)us_p;
|
||||
ArmatureUndoStep *us = reinterpret_cast<ArmatureUndoStep *>(us_p);
|
||||
|
||||
for (uint i = 0; i < us->elems_len; i++) {
|
||||
ArmatureUndoStep_Elem *elem = &us->elems[i];
|
||||
@@ -301,12 +301,12 @@ static void armature_undosys_foreach_ID_ref(UndoStep *us_p,
|
||||
UndoTypeForEachIDRefFn foreach_ID_ref_fn,
|
||||
void *user_data)
|
||||
{
|
||||
ArmatureUndoStep *us = (ArmatureUndoStep *)us_p;
|
||||
ArmatureUndoStep *us = reinterpret_cast<ArmatureUndoStep *>(us_p);
|
||||
|
||||
foreach_ID_ref_fn(user_data, ((UndoRefID *)&us->scene_ref));
|
||||
foreach_ID_ref_fn(user_data, reinterpret_cast<UndoRefID *>(&us->scene_ref));
|
||||
for (uint i = 0; i < us->elems_len; i++) {
|
||||
ArmatureUndoStep_Elem *elem = &us->elems[i];
|
||||
foreach_ID_ref_fn(user_data, ((UndoRefID *)&elem->obedit_ref));
|
||||
foreach_ID_ref_fn(user_data, reinterpret_cast<UndoRefID *>(&elem->obedit_ref));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -371,7 +371,7 @@ struct BVHCallbackUserData {
|
||||
|
||||
static void bvh_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
|
||||
{
|
||||
BVHCallbackUserData *data = (BVHCallbackUserData *)userdata;
|
||||
BVHCallbackUserData *data = static_cast<BVHCallbackUserData *>(userdata);
|
||||
const blender::int3 &tri = data->sys->heat.corner_tris[index];
|
||||
const blender::Span<int> corner_verts = data->sys->heat.corner_verts;
|
||||
float(*verts)[3] = data->sys->heat.verts;
|
||||
@@ -1758,8 +1758,8 @@ void ED_mesh_deform_bind_callback(Object *object,
|
||||
int verts_num,
|
||||
float cagemat[4][4])
|
||||
{
|
||||
MeshDeformModifierData *mmd_orig = (MeshDeformModifierData *)BKE_modifier_get_original(
|
||||
object, &mmd->modifier);
|
||||
MeshDeformModifierData *mmd_orig = reinterpret_cast<MeshDeformModifierData *>(
|
||||
BKE_modifier_get_original(object, &mmd->modifier));
|
||||
MeshDeformBind mdb{};
|
||||
int a;
|
||||
|
||||
@@ -1806,7 +1806,7 @@ void ED_mesh_deform_bind_callback(Object *object,
|
||||
MEM_freeN(mdb.vertexcos);
|
||||
|
||||
/* compact weights */
|
||||
BKE_modifier_mdef_compact_influences((ModifierData *)mmd_orig);
|
||||
BKE_modifier_mdef_compact_influences(reinterpret_cast<ModifierData *>(mmd_orig));
|
||||
|
||||
end_progress_bar();
|
||||
waitcursor(0);
|
||||
|
||||
@@ -626,7 +626,7 @@ static int pose_bone_rotmode_exec(bContext *C, wmOperator *op)
|
||||
|
||||
if (prev_ob != ob) {
|
||||
/* Notifiers and updates. */
|
||||
DEG_id_tag_update((ID *)ob, ID_RECALC_GEOMETRY);
|
||||
DEG_id_tag_update(reinterpret_cast<ID *>(ob), ID_RECALC_GEOMETRY);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
|
||||
prev_ob = ob;
|
||||
|
||||
@@ -174,7 +174,7 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd)
|
||||
/* Apply the relevant changes to the pose */
|
||||
static void poselib_blend_apply(bContext *C, wmOperator *op)
|
||||
{
|
||||
PoseBlendData *pbd = (PoseBlendData *)op->customdata;
|
||||
PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
|
||||
|
||||
if (!pbd->needs_redraw) {
|
||||
return;
|
||||
@@ -327,14 +327,14 @@ static bAction *poselib_blend_init_get_action(bContext *C, wmOperator *op)
|
||||
PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
|
||||
|
||||
pbd->temp_id_consumer = asset::temp_id_consumer_create(asset);
|
||||
return (bAction *)asset::temp_id_consumer_ensure_local_id(
|
||||
pbd->temp_id_consumer, ID_AC, CTX_data_main(C), op->reports);
|
||||
return reinterpret_cast<bAction *>(asset::temp_id_consumer_ensure_local_id(
|
||||
pbd->temp_id_consumer, ID_AC, CTX_data_main(C), op->reports));
|
||||
}
|
||||
|
||||
static bAction *flip_pose(bContext *C, blender::Span<Object *> objects, bAction *action)
|
||||
{
|
||||
bAction *action_copy = (bAction *)BKE_id_copy_ex(
|
||||
nullptr, &action->id, nullptr, LIB_ID_COPY_LOCALIZE);
|
||||
bAction *action_copy = reinterpret_cast<bAction *>(
|
||||
BKE_id_copy_ex(nullptr, &action->id, nullptr, LIB_ID_COPY_LOCALIZE));
|
||||
|
||||
/* Lock the window manager while flipping the pose. Flipping requires temporarily modifying the
|
||||
* pose, which can cause unwanted visual glitches. */
|
||||
|
||||
@@ -293,7 +293,7 @@ void ED_armature_pose_select_in_wpaint_mode(const Scene *scene,
|
||||
ModifierData *md = BKE_modifiers_get_virtual_modifierlist(ob_active, &virtual_modifier_data);
|
||||
for (; md; md = md->next) {
|
||||
if (md->type == eModifierType_Armature) {
|
||||
ArmatureModifierData *amd = (ArmatureModifierData *)md;
|
||||
ArmatureModifierData *amd = reinterpret_cast<ArmatureModifierData *>(md);
|
||||
Object *ob_arm = amd->object;
|
||||
if (ob_arm != nullptr) {
|
||||
Base *base_arm = BKE_view_layer_base_find(view_layer, ob_arm);
|
||||
@@ -617,7 +617,7 @@ void POSE_OT_select_all(wmOperatorType *ot)
|
||||
static int pose_select_parent_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
bPoseChannel *pchan, *parent;
|
||||
|
||||
/* Determine if there is an active bone */
|
||||
|
||||
@@ -425,7 +425,7 @@ static void pose_slide_apply_vec3(tPoseSlideOp *pso,
|
||||
|
||||
/* Using this path, find each matching F-Curve for the variables we're interested in. */
|
||||
while ((ld = poseAnim_mapping_getNextFCurve(&pfl->fcurves, ld, path))) {
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
const int idx = fcu->array_index;
|
||||
const int lock = pso->axislock;
|
||||
|
||||
@@ -462,7 +462,7 @@ static void pose_slide_apply_props(tPoseSlideOp *pso,
|
||||
* so a similar method should work here for those too
|
||||
*/
|
||||
LISTBASE_FOREACH (LinkData *, ld, &pfl->fcurves) {
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
const char *bPtr, *pPtr;
|
||||
|
||||
if (fcu->rna_path == nullptr) {
|
||||
@@ -597,7 +597,7 @@ static void pose_slide_apply_quat(tPoseSlideOp *pso, tPChanFCurveLink *pfl)
|
||||
|
||||
/* Using this path, find each matching F-Curve for the variables we're interested in. */
|
||||
while ((ld = poseAnim_mapping_getNextFCurve(&pfl->fcurves, ld, path))) {
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
|
||||
/* Assign this F-Curve to one of the relevant pointers. */
|
||||
switch (fcu->array_index) {
|
||||
@@ -982,7 +982,7 @@ static int pose_slide_invoke_common(bContext *C, wmOperator *op, const wmEvent *
|
||||
/* Do this for each F-Curve. */
|
||||
LISTBASE_FOREACH (LinkData *, ld, &pfl->fcurves) {
|
||||
AnimData *adt = pfl->ob->adt;
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
fcurve_to_keylist(adt, fcu, pso->keylist, 0, {-FLT_MAX, FLT_MAX}, adt != nullptr);
|
||||
}
|
||||
}
|
||||
@@ -1701,7 +1701,7 @@ static void propagate_curve_values(ListBase /*tPChanFCurveLink*/ *pflinks,
|
||||
const KeyframeSettings settings = get_keyframe_settings(true);
|
||||
LISTBASE_FOREACH (tPChanFCurveLink *, pfl, pflinks) {
|
||||
LISTBASE_FOREACH (LinkData *, ld, &pfl->fcurves) {
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
if (!fcu->bezt) {
|
||||
continue;
|
||||
}
|
||||
@@ -1719,7 +1719,7 @@ static float find_next_key(ListBase *pflinks, const float start_frame)
|
||||
float target_frame = FLT_MAX;
|
||||
LISTBASE_FOREACH (tPChanFCurveLink *, pfl, pflinks) {
|
||||
LISTBASE_FOREACH (LinkData *, ld, &pfl->fcurves) {
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
if (!fcu->bezt) {
|
||||
continue;
|
||||
}
|
||||
@@ -1742,7 +1742,7 @@ static float find_last_key(ListBase *pflinks)
|
||||
float target_frame = FLT_MIN;
|
||||
LISTBASE_FOREACH (tPChanFCurveLink *, pfl, pflinks) {
|
||||
LISTBASE_FOREACH (LinkData *, ld, &pfl->fcurves) {
|
||||
const FCurve *fcu = (const FCurve *)ld->data;
|
||||
const FCurve *fcu = static_cast<const FCurve *>(ld->data);
|
||||
if (!fcu->bezt) {
|
||||
continue;
|
||||
}
|
||||
@@ -1773,7 +1773,7 @@ static void get_keyed_frames_in_range(ListBase *pflinks,
|
||||
AnimKeylist *keylist = ED_keylist_create();
|
||||
LISTBASE_FOREACH (tPChanFCurveLink *, pfl, pflinks) {
|
||||
LISTBASE_FOREACH (LinkData *, ld, &pfl->fcurves) {
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
fcurve_to_keylist(nullptr, fcu, keylist, 0, {start_frame, end_frame}, false);
|
||||
}
|
||||
}
|
||||
@@ -1796,7 +1796,7 @@ static void get_selected_frames(ListBase *pflinks, ListBase /*FrameLink*/ *targe
|
||||
AnimKeylist *keylist = ED_keylist_create();
|
||||
LISTBASE_FOREACH (tPChanFCurveLink *, pfl, pflinks) {
|
||||
LISTBASE_FOREACH (LinkData *, ld, &pfl->fcurves) {
|
||||
FCurve *fcu = (FCurve *)ld->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ld->data);
|
||||
fcurve_to_keylist(nullptr, fcu, keylist, 0, {-FLT_MAX, FLT_MAX}, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ static void applyarmature_reset_bone_constraint(const bConstraint *constraint)
|
||||
* bConstraintTypeInfo callback function. */
|
||||
switch (constraint->type) {
|
||||
case CONSTRAINT_TYPE_STRETCHTO: {
|
||||
bStretchToConstraint *stretch_to = (bStretchToConstraint *)constraint->data;
|
||||
bStretchToConstraint *stretch_to = static_cast<bStretchToConstraint *>(constraint->data);
|
||||
stretch_to->orglength = 0.0f; /* Force recalculation on next evaluation. */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ static eAction_TransformFlags get_item_transform_flags_and_fcurves(Object &ob,
|
||||
short flags = 0;
|
||||
|
||||
/* Build PointerRNA from provided data to obtain the paths to use. */
|
||||
PointerRNA ptr = RNA_pointer_create_discrete((ID *)&ob, &RNA_PoseBone, &pchan);
|
||||
PointerRNA ptr = RNA_pointer_create_discrete(reinterpret_cast<ID *>(&ob), &RNA_PoseBone, &pchan);
|
||||
|
||||
/* Get the basic path to the properties of interest. */
|
||||
const std::optional<std::string> basePath = RNA_path_from_ID_to_struct(&ptr);
|
||||
@@ -185,7 +185,7 @@ static void fcurves_to_pchan_links_get(ListBase &pfLinks, Object &ob, bPoseChann
|
||||
pfl->pchan = &pchan;
|
||||
|
||||
/* Get the RNA path to this pchan - this needs to be freed! */
|
||||
PointerRNA ptr = RNA_pointer_create_discrete((ID *)&ob, &RNA_PoseBone, &pchan);
|
||||
PointerRNA ptr = RNA_pointer_create_discrete(reinterpret_cast<ID *>(&ob), &RNA_PoseBone, &pchan);
|
||||
pfl->pchan_path = BLI_strdup(RNA_path_from_ID_to_struct(&ptr).value_or("").c_str());
|
||||
|
||||
BLI_addtail(&pfLinks, pfl);
|
||||
@@ -443,7 +443,7 @@ LinkData *poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, con
|
||||
|
||||
/* check each link to see if the linked F-Curve has a matching path */
|
||||
for (ld = first; ld; ld = ld->next) {
|
||||
const FCurve *fcu = (const FCurve *)ld->data;
|
||||
const FCurve *fcu = static_cast<const FCurve *>(ld->data);
|
||||
|
||||
/* check if paths match */
|
||||
if (STREQ(path, fcu->rna_path)) {
|
||||
|
||||
@@ -259,7 +259,7 @@ void gpencil_to_keylist(bDopeSheet *ads, bGPdata *gpd, AnimKeylist *keylist, boo
|
||||
|
||||
/* Grease Pencil Cels. */
|
||||
void grease_pencil_cels_to_keylist(AnimData *adt,
|
||||
const GreasePencilLayer *layer,
|
||||
const GreasePencilLayer *gpl,
|
||||
AnimKeylist *keylist,
|
||||
int saction_flag);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user