Blender V4.5
blender::bke::greasepencil Namespace Reference

Namespaces

namespace  convert
 
namespace  tests
 

Classes

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

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 int domain_num (const CurvesGeometry &curves, const AttrDomain domain)
 
static CustomDatadomain_custom_data (CurvesGeometry &curves, const AttrDomain domain)
 
template<typename T >
static MutableSpan< Tget_mutable_attribute (CurvesGeometry &curves, const AttrDomain domain, const StringRef name, const T default_value=T())
 
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 (float4x2 strokemat)
 
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

Definition at line 384 of file BKE_grease_pencil.hh.

Function Documentation

◆ assign_to_vertex_group()

◆ assign_to_vertex_group_from_mask()

◆ 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 )

Copies the drawings from one array to another. Assumes that dst_drawings is allocated but not initialized, e.g. it will allocate new drawings and store the pointers.

Examples
/usr/src/RPM/BUILD/blender-4.5.8/source/blender/blenkernel/BKE_grease_pencil.hh.

Definition at line 1011 of file grease_pencil.cc.

References BLI_assert, copy_drawing_array(), GP_DRAWING, GP_DRAWING_REFERENCE, blender::Span< T >::index_range(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), and GreasePencilDrawingBase::type.

Referenced by BKE_grease_pencil_duplicate_drawing_array(), and copy_drawing_array().

◆ domain_custom_data()

static CustomData & blender::bke::greasepencil::domain_custom_data ( CurvesGeometry & curves,
const AttrDomain domain )
static

◆ domain_num()

static int blender::bke::greasepencil::domain_num ( const CurvesGeometry & curves,
const AttrDomain domain )
static

◆ 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/blender-4.5.8/source/blender/blenkernel/BKE_grease_pencil.hh.

Definition at line 1972 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()

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

◆ get_attribute_accessor_functions()

const AttributeAccessorFunctions & blender::bke::greasepencil::get_attribute_accessor_functions ( )

◆ get_local_to_stroke_matrix()

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

◆ get_mutable_attribute()

template<typename T >
static MutableSpan< T > blender::bke::greasepencil::get_mutable_attribute ( CurvesGeometry & curves,
const AttrDomain domain,
const StringRef name,
const T default_value = T() )
static

◆ get_stroke_to_texture_matrix()

static 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()

◆ 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

Definition at line 368 of file grease_pencil.cc.

◆ ATTR_VERTEX_COLOR

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

◆ LEGACY_RADIUS_CONVERSION_FACTOR