Fix #119909: Unkeyable custom properties receive keyframes #119914
|
@ -298,6 +298,14 @@ static blender::Vector<std::string> construct_rna_paths(PointerRNA *ptr)
|
|||
if (insert_channel_flags & USER_ANIM_KEY_CHANNEL_CUSTOM_PROPERTIES) {
|
||||
if (properties) {
|
||||
LISTBASE_FOREACH (IDProperty *, prop, &properties->data.group) {
|
||||
if (!ELEM(prop->type,
|
||||
eIDPropertyType::IDP_BOOLEAN,
|
||||
eIDPropertyType::IDP_INT,
|
||||
eIDPropertyType::IDP_FLOAT))
|
||||
{
|
||||
/* Ignore unkeyable properties. */
|
||||
|
||||
continue;
|
||||
}
|
||||
std::string name = prop->name;
|
||||
std::string rna_path = "[\"" + name + "\"]";
|
||||
paths.append(rna_path);
|
||||
|
|
Loading…
Reference in New Issue
The
IDP_ARRAY
check is likely not sufficient. It might be an array of unkeyable types, and thus shouldn't be keyed.I think it's better to keep the array check separate, as that would need to check the type of the array elements as well.
Probably best to move the
ELEM(prop->type, eIDPropertyType::IDP_BOOLEAN, eIDPropertyType::IDP_INT, eIDPropertyType::IDP_FLOAT, eIDPropertyType::IDP_DOUBLE
into ais_keyable_type()
like function, and call that on the array elements as well.thanks for spotting that, I've made the changes, but I am not sure how I would create an Array with subtype Group.
I assume that can only be done using python?
I've done some more digging, and the code as it is seems to be safe. In
source/blender/blenkernel/intern/idprop_create.cc
there are three functions to createIDP_ARRAY
properties, forint
,float
, anddouble
, and so these are indeed always safe to key. Creating a custom property likeobject["name"] = ["a", "b", "c"]
will create a property of a type that's shown as "Python" in the UI, not as "Array". If someone finds a way to create an array of groups, we'll get a bug report and handle it then, when we have a concrete counter-example.