Blender V5.0
blender::bke::greasepencil Namespace Reference

Namespaces

namespace  convert
namespace  tests

Classes

class  DrawingRuntime
class  Drawing
class  DrawingReference
class  TreeNode
class  LayerMask
struct  LayerTransformData
class  LayerRuntime
class  Layer
class  LayerGroupRuntime
class  LayerGroup

Typedefs

using FramesMapKeyT = int

Functions

void copy_drawing_array (Span< const GreasePencilDrawingBase * > src_drawings, MutableSpan< GreasePencilDrawingBase * > dst_drawings)
 TREENODE_COMMON_METHODS_FORWARD_IMPL (Layer)
 TREENODE_COMMON_METHODS_FORWARD_IMPL (LayerGroup)
const AttributeAccessorFunctionsget_attribute_accessor_functions ()
void ensure_non_empty_layer_names (Main &bmain, GreasePencil &grease_pencil)
static void update_triangle_cache (const Span< float3 > positions, const Span< float3 > normals, const OffsetIndices< int > points_by_curve, const OffsetIndices< int > triangle_offsets, const IndexMask &curve_mask, MutableSpan< int3 > triangles)
static void update_curve_plane_normal_cache (const Span< float3 > positions, const OffsetIndices< int > points_by_curve, const IndexMask &curve_mask, MutableSpan< float3 > normals)
static float4x2 get_local_to_stroke_matrix (const Span< float3 > positions, const float3 normal)
static float3x2 get_stroke_to_texture_matrix (const float uv_rotation, const float2 uv_translation, const float2 uv_scale)
static float4x3 expand_4x2_mat (const float4x2 &strokemat)
static const auto & changed_tags ()
static const auto & builtin_attributes ()
static int get_domain_size (const void *owner, const AttrDomain domain)
static AttributeAccessorFunctions get_grease_pencil_accessor_functions ()
Vertex groups in drawings
void validate_drawing_vertex_groups (GreasePencil &grease_pencil)
int ensure_vertex_group (StringRef name, ListBase &vertex_group_names)
void assign_to_vertex_group (Drawing &drawing, StringRef name, float weight)
void assign_to_vertex_group_from_mask (CurvesGeometry &curves, const IndexMask &mask, StringRef name, float weight)
bool remove_from_vertex_group (Drawing &drawing, StringRef name, bool use_selection)
void clear_vertex_groups (GreasePencil &grease_pencil)

Variables

constexpr float LEGACY_RADIUS_CONVERSION_FACTOR = 1.0f / 2000.0f
constexpr StringRef ATTR_RADIUS = "radius"
constexpr StringRef ATTR_OPACITY = "opacity"
constexpr StringRef ATTR_VERTEX_COLOR = "vertex_color"
constexpr StringRef ATTR_FILL_COLOR = "fill_color"

Typedef Documentation

◆ FramesMapKeyT

Function Documentation

◆ assign_to_vertex_group()

◆ assign_to_vertex_group_from_mask()

void blender::bke::greasepencil::assign_to_vertex_group_from_mask ( bke::CurvesGeometry & curves,
const IndexMask & mask,
StringRef name,
float weight )

◆ builtin_attributes()

const auto & blender::bke::greasepencil::builtin_attributes ( )
static

Definition at line 21 of file grease_pencil_attributes.cc.

Referenced by get_grease_pencil_accessor_functions().

◆ changed_tags()

const auto & blender::bke::greasepencil::changed_tags ( )
static

Definition at line 15 of file grease_pencil_attributes.cc.

Referenced by get_grease_pencil_accessor_functions().

◆ clear_vertex_groups()

void blender::bke::greasepencil::clear_vertex_groups ( GreasePencil & grease_pencil)

◆ copy_drawing_array()

void blender::bke::greasepencil::copy_drawing_array ( Span< const GreasePencilDrawingBase * > src_drawings,
MutableSpan< GreasePencilDrawingBase * > dst_drawings )

◆ ensure_non_empty_layer_names()

void blender::bke::greasepencil::ensure_non_empty_layer_names ( Main & bmain,
GreasePencil & grease_pencil )

Renames layers with empty names to "Layer".

Note
While original data should not have layers with empty names, we allow layer names to be empty in evaluated geometry.
Examples
/usr/src/RPM/BUILD/blender5.0-5.0.0/source/blender/blenkernel/BKE_grease_pencil.hh.

Definition at line 1969 of file grease_pencil.cc.

References DATA_.

Referenced by blender::ed::object::apply_grease_pencil_for_modifier(), blender::ed::object::apply_grease_pencil_for_modifier_all_keyframes(), and blender::ed::geometry::store_result_geometry().

◆ ensure_vertex_group()

int blender::bke::greasepencil::ensure_vertex_group ( StringRef name,
ListBase & vertex_group_names )

Find or create a vertex group in a drawing.

Definition at line 55 of file grease_pencil_vertex_groups.cc.

References BKE_defgroup_name_index(), BLI_addtail(), BLI_assert, BLI_listbase_count(), MEM_callocN(), bDeformGroup::name, and name.

Referenced by blender::write_weights_for_drawing().

◆ expand_4x2_mat()

float4x3 blender::bke::greasepencil::expand_4x2_mat ( const float4x2 & strokemat)
static

◆ get_attribute_accessor_functions()

◆ get_domain_size()

int blender::bke::greasepencil::get_domain_size ( const void * owner,
const AttrDomain domain )
static

Definition at line 30 of file grease_pencil_attributes.cc.

References blender::bke::Layer.

Referenced by get_grease_pencil_accessor_functions().

◆ get_grease_pencil_accessor_functions()

◆ get_local_to_stroke_matrix()

float4x2 blender::bke::greasepencil::get_local_to_stroke_matrix ( const Span< float3 > positions,
const float3 normal )
static

◆ get_stroke_to_texture_matrix()

float3x2 blender::bke::greasepencil::get_stroke_to_texture_matrix ( const float uv_rotation,
const float2 uv_translation,
const float2 uv_scale )
static

◆ remove_from_vertex_group()

bool blender::bke::greasepencil::remove_from_vertex_group ( Drawing & drawing,
StringRef name,
bool use_selection )

◆ TREENODE_COMMON_METHODS_FORWARD_IMPL() [1/2]

blender::bke::greasepencil::TREENODE_COMMON_METHODS_FORWARD_IMPL ( Layer )

◆ TREENODE_COMMON_METHODS_FORWARD_IMPL() [2/2]

blender::bke::greasepencil::TREENODE_COMMON_METHODS_FORWARD_IMPL ( LayerGroup )

◆ update_curve_plane_normal_cache()

◆ update_triangle_cache()

◆ validate_drawing_vertex_groups()

Variable Documentation

◆ ATTR_FILL_COLOR

StringRef blender::bke::greasepencil::ATTR_FILL_COLOR = "fill_color"
constexpr

◆ ATTR_OPACITY

StringRef blender::bke::greasepencil::ATTR_OPACITY = "opacity"
constexpr

◆ ATTR_RADIUS

StringRef blender::bke::greasepencil::ATTR_RADIUS = "radius"
constexpr

◆ ATTR_VERTEX_COLOR

StringRef blender::bke::greasepencil::ATTR_VERTEX_COLOR = "vertex_color"
constexpr

◆ LEGACY_RADIUS_CONVERSION_FACTOR