GPv3: Python API for frame, drawing and drawing attributes #124787

Merged
Falk David merged 22 commits from filedescriptor/blender:gpv3-drawing-python-api into main 2024-07-26 16:30:21 +02:00
Showing only changes of commit 35c9c6678d - Show all commits

View File

@ -907,7 +907,7 @@ static void rna_AttributeGroupGreasePencilDrawing_active_set(PointerRNA *ptr,
static bool rna_AttributeGroupGreasePencilDrawing_active_poll(PointerRNA *ptr,
const PointerRNA value)
{
AttributeOwner owner = owner_from_attribute_pointer_rna(&value);
AttributeOwner owner = owner_from_attribute_pointer_rna(const_cast<PointerRNA *>(&value));
filedescriptor marked this conversation as resolved Outdated
In file included from /home/jacques/blender/build_debug/source/blender/makesrna/intern/rna_attribute_gen.cc:36:
/home/jacques/blender/blender/source/blender/makesrna/intern/rna_attribute.cc: In function ‘bool rna_AttributeGroupGreasePencilDrawing_active_poll(PointerRNA*, PointerRNA)’:
/home/jacques/blender/blender/source/blender/makesrna/intern/rna_attribute.cc:910:59: error: invalid conversion from ‘const PointerRNA*’ to ‘PointerRNA*’ [-fpermissive]
  910 |   AttributeOwner owner = owner_from_attribute_pointer_rna(&value);
      |                                                           ^~~~~~
      |                                                           |
      |                                                           const PointerRNA*
/home/jacques/blender/blender/source/blender/makesrna/intern/rna_attribute.cc:187:68: note:   initializing argument 1 of ‘AttributeOwner owner_from_attribute_pointer_rna(PointerRNA*)’
  187 | static AttributeOwner owner_from_attribute_pointer_rna(PointerRNA *ptr)
      |                                                        ~~~~~~~~~~~~^~~
``` In file included from /home/jacques/blender/build_debug/source/blender/makesrna/intern/rna_attribute_gen.cc:36: /home/jacques/blender/blender/source/blender/makesrna/intern/rna_attribute.cc: In function ‘bool rna_AttributeGroupGreasePencilDrawing_active_poll(PointerRNA*, PointerRNA)’: /home/jacques/blender/blender/source/blender/makesrna/intern/rna_attribute.cc:910:59: error: invalid conversion from ‘const PointerRNA*’ to ‘PointerRNA*’ [-fpermissive] 910 | AttributeOwner owner = owner_from_attribute_pointer_rna(&value); | ^~~~~~ | | | const PointerRNA* /home/jacques/blender/blender/source/blender/makesrna/intern/rna_attribute.cc:187:68: note: initializing argument 1 of ‘AttributeOwner owner_from_attribute_pointer_rna(PointerRNA*)’ 187 | static AttributeOwner owner_from_attribute_pointer_rna(PointerRNA *ptr) | ~~~~~~~~~~~~^~~ ```

Sorry about that, fixed now.

Sorry about that, fixed now.
return owner.is_valid() && owner.type() == AttributeOwnerType::GreasePencilDrawing &&
owner.get_grease_pencil_drawing() == static_cast<GreasePencilDrawing *>(ptr->data);
}