GPv3: Python API for frame, drawing and drawing attributes #124787
@ -904,6 +904,14 @@ static void rna_AttributeGroupGreasePencilDrawing_active_set(PointerRNA *ptr,
|
||||
BKE_attributes_active_set(owner, layer->name);
|
||||
}
|
||||
|
||||
static bool rna_AttributeGroupGreasePencilDrawing_active_poll(PointerRNA *ptr,
|
||||
const PointerRNA value)
|
||||
{
|
||||
AttributeOwner owner = owner_from_attribute_pointer_rna(&value);
|
||||
filedescriptor marked this conversation as resolved
Outdated
|
||||
return owner.is_valid() && owner.type() == AttributeOwnerType::GreasePencilDrawing &&
|
||||
owner.get_grease_pencil_drawing() == static_cast<GreasePencilDrawing *>(ptr->data);
|
||||
}
|
||||
|
||||
static int rna_AttributeGroupGreasePencilDrawing_active_index_get(PointerRNA *ptr)
|
||||
{
|
||||
GreasePencilDrawing *drawing = static_cast<GreasePencilDrawing *>(ptr->data);
|
||||
@ -1628,7 +1636,7 @@ static void rna_def_attribute_group_grease_pencil_drawing(BlenderRNA *brna)
|
||||
"rna_AttributeGroupGreasePencilDrawing_active_get",
|
||||
"rna_AttributeGroupGreasePencilDrawing_active_set",
|
||||
nullptr,
|
||||
nullptr);
|
||||
"rna_AttributeGroupGreasePencilDrawing_active_poll");
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
|
||||
RNA_def_property_update(prop, 0, "rna_AttributeGroupID_update_active");
|
||||
filedescriptor marked this conversation as resolved
Outdated
Bastien Montagne
commented
I find it weird to use a function named Would suggest to either rename that one to a generic I find it weird to use a function named `rna_AttributeGroupID_update_active` for non-ID-owned attribute data?
Would suggest to either rename that one to a generic `rna_AttributeGroup_update_active`name, or to add a `rna_AttributeGroupGreasePencilDrawing_update_active` one (which could then call `rna_AttributeGroupID_update_active` if it's fine to do so)?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user
Sorry about that, fixed now.