ShapeKey: add utils to say whether given ID type supports shapekeys.
Those kind of checks are handy to have for generic processing...
This commit is contained in:
@@ -66,6 +66,8 @@ float *BKE_key_evaluate_object_ex(
|
||||
float *BKE_key_evaluate_object(
|
||||
struct Object *ob, int *r_totelem);
|
||||
|
||||
bool BKE_key_idtype_support(const short id_type);
|
||||
|
||||
struct Key **BKE_key_from_id_p(struct ID *id);
|
||||
struct Key *BKE_key_from_id(struct ID *id);
|
||||
struct Key **BKE_key_from_object_p(struct Object *ob);
|
||||
|
||||
@@ -1374,6 +1374,18 @@ float *BKE_key_evaluate_object(Object *ob, int *r_totelem)
|
||||
return BKE_key_evaluate_object_ex(ob, r_totelem, NULL, 0);
|
||||
}
|
||||
|
||||
bool BKE_key_idtype_support(const short id_type)
|
||||
{
|
||||
switch (id_type) {
|
||||
case ID_ME:
|
||||
case ID_CU:
|
||||
case ID_LT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Key **BKE_key_from_id_p(ID *id)
|
||||
{
|
||||
switch (GS(id->name)) {
|
||||
|
||||
Reference in New Issue
Block a user