Blender V5.0
blender::io::grease_pencil::GreasePencilExporter Class Reference

#include <grease_pencil_io_intern.hh>

Inherited by blender::io::grease_pencil::PDFExporter, and blender::io::grease_pencil::SVGExporter.

Classes

struct  ObjectInfo

Public Types

using WriteStrokeFn

Public Member Functions

 GreasePencilExporter (const IOContext &context, const ExportParams &params)
void prepare_render_params (Scene &scene, int frame_number)
Vector< ObjectInforetrieve_objects () const
void foreach_stroke_in_layer (const Object &object, const bke::greasepencil::Layer &layer, const bke::greasepencil::Drawing &drawing, WriteStrokeFn stroke_fn)
float2 project_to_screen (const float4x4 &transform, const float3 &position) const
bool is_selected_frame (const GreasePencil &grease_pencil, int frame_number) const
std::string coord_to_svg_string (const float2 &screen_co) const

Static Public Member Functions

static ColorGeometry4f compute_average_stroke_color (const Material &material, const Span< ColorGeometry4f > vertex_colors)
static float compute_average_stroke_opacity (const Span< float > opacities)
static std::optional< floattry_get_uniform_point_width (const RegionView3D &rv3d, const Span< float3 > world_positions, const Span< float > radii)

Protected Attributes

const IOContext context_
const ExportParams params_
std::optional< float4x4camera_persmat_
blender::Bounds< float2camera_rect_
float2 camera_fac_
blender::Bounds< float2screen_rect_

Detailed Description

Definition at line 48 of file grease_pencil_io_intern.hh.

Member Typedef Documentation

◆ WriteStrokeFn

Initial value:
FunctionRef<void(const Span<float3> positions,
const Span<float3> positions_left,
const Span<float3> positions_right,
bool cyclic,
int8_t type,
float opacity,
std::optional<float> width,
bool round_cap,
bool is_outline)>
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f

Definition at line 81 of file grease_pencil_io_intern.hh.

Constructor & Destructor Documentation

◆ GreasePencilExporter()

blender::io::grease_pencil::GreasePencilExporter::GreasePencilExporter ( const IOContext & context,
const ExportParams & params )

Definition at line 133 of file grease_pencil_io.cc.

References context_, params, and params_.

Member Function Documentation

◆ compute_average_stroke_color()

ColorGeometry4f blender::io::grease_pencil::GreasePencilExporter::compute_average_stroke_color ( const Material & material,
const Span< ColorGeometry4f > vertex_colors )
static

◆ compute_average_stroke_opacity()

float blender::io::grease_pencil::GreasePencilExporter::compute_average_stroke_opacity ( const Span< float > opacities)
static

Definition at line 292 of file grease_pencil_io.cc.

References blender::io::grease_pencil::get_average().

Referenced by foreach_stroke_in_layer().

◆ coord_to_svg_string()

◆ foreach_stroke_in_layer()

void blender::io::grease_pencil::GreasePencilExporter::foreach_stroke_in_layer ( const Object & object,
const bke::greasepencil::Layer & layer,
const bke::greasepencil::Drawing & drawing,
WriteStrokeFn stroke_fn )

Definition at line 369 of file grease_pencil_io.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::CurvesGeometry::attributes(), BKE_material_default_gpencil(), BKE_object_material_get(), BLI_assert, compute_average_stroke_color(), compute_average_stroke_opacity(), context_, blender::ed::greasepencil::create_curves_outline(), blender::bke::Curve, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::bke::greasepencil::Drawing::fill_colors(), MaterialGPencilStyle::fill_rgba, MaterialGPencilStyle::flag, foreach_stroke_in_layer(), blender::IndexRange::from_single(), blender::VArray< T >::from_single(), GP_MATERIAL_FILL_SHOW, GP_MATERIAL_HIDE, GP_MATERIAL_STROKE_SHOW, GP_STROKE_CAP_TYPE_ROUND, Material::gp_style, blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_right(), blender::math::interpolate(), is_cyclic(), blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::greasepencil::Drawing::opacities(), GreasePencilLayer::opacity, params_, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::positions(), blender::bke::greasepencil::Drawing::radii(), blender::geometry::resample_to_length(), blender::IndexRange::size(), blender::Span< T >::slice(), blender::Span< T >::slice_safe(), blender::bke::greasepencil::Drawing::strokes(), blender::bke::greasepencil::Layer::to_world_space(), blender::math::transform_points(), try_get_uniform_point_width(), types, and blender::bke::greasepencil::Drawing::vertex_colors().

Referenced by blender::io::grease_pencil::PDFExporter::export_grease_pencil_layer(), blender::io::grease_pencil::SVGExporter::export_grease_pencil_layer(), and foreach_stroke_in_layer().

◆ is_selected_frame()

bool blender::io::grease_pencil::GreasePencilExporter::is_selected_frame ( const GreasePencil & grease_pencil,
int frame_number ) const

◆ prepare_render_params()

◆ project_to_screen()

◆ retrieve_objects()

◆ try_get_uniform_point_width()

std::optional< float > blender::io::grease_pencil::GreasePencilExporter::try_get_uniform_point_width ( const RegionView3D & rv3d,
const Span< float3 > world_positions,
const Span< float > radii )
static

Member Data Documentation

◆ camera_fac_

float2 blender::io::grease_pencil::GreasePencilExporter::camera_fac_
protected

Definition at line 62 of file grease_pencil_io_intern.hh.

Referenced by prepare_render_params(), and project_to_screen().

◆ camera_persmat_

◆ camera_rect_

◆ context_

◆ params_

◆ screen_rect_


The documentation for this class was generated from the following files: