Blender V4.5
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 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< float3float3 > positions, const Span< float3float3 > normals, const OffsetIndices< int > points_by_curve, const OffsetIndices< int > triangle_offsets, const IndexMask &curve_mask, MutableSpan< int3int3 > triangles)
static void update_curve_plane_normal_cache (const Span< float3float3 > positions, const OffsetIndices< int > points_by_curve, const IndexMask &curve_mask, MutableSpan< float3float3 > normals)
static float4x2 get_local_to_stroke_matrix (const Span< float3float3 > positions, const float3float3 normal)
static float3x2 get_stroke_to_texture_matrix (const float uv_rotation, const float2float2 uv_translation, const float2float2 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

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.5/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, i, blender::Span< T >::index_range(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), and GreasePencilDrawingBase::type.

Referenced by BKE_grease_pencil_duplicate_drawing_array(), copy_drawing_array(), and blender::ed::greasepencil::join_object_with_active().

◆ domain_custom_data()

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

Definition at line 378 of file grease_pencil.cc.

References blender::bke::Point.

Referenced by get_mutable_attribute().

◆ domain_num()

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

Definition at line 374 of file grease_pencil.cc.

References blender::bke::Point.

Referenced by get_mutable_attribute().

◆ 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.5/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 )

◆ expand_4x2_mat()

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

◆ get_attribute_accessor_functions()

◆ get_local_to_stroke_matrix()

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

◆ get_mutable_attribute()

template<typename T>
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()

float3x2 blender::bke::greasepencil::get_stroke_to_texture_matrix ( const float uv_rotation,
const float2float2 uv_translation,
const float2float2 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