Blender V5.0
blender::io::grease_pencil Namespace Reference

Classes

struct  IOContext
struct  ImportParams
struct  ExportParams
class  PDFExporter
class  SVGExporter
class  SVGImporter
class  GreasePencilImporter
class  GreasePencilExporter

Enumerations

enum class  ExportStatus : int8_t {
  Ok = 0 , NoFramesSelected , InvalidActiveObjectType , FileWriteError ,
  UnknownError
}

Functions

bool import_svg (const IOContext &context, const ImportParams &params, StringRefNull filepath)
ExportStatus export_svg (const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
bool export_pdf (const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
static float get_average (const Span< float > values)
static ColorGeometry4f get_average (const Span< ColorGeometry4f > values)
static float4x4 persmat_from_camera_object (Scene &scene)
static std::string rgb_to_hexstr (const float color[3])
static void write_stroke_color_attribute (pugi::xml_node node, const ColorGeometry4f &stroke_color, const float stroke_opacity, const bool round_cap)
static void write_fill_color_attribute (pugi::xml_node node, const ColorGeometry4f &fill_color, const float layer_opacity)
static void write_rect (pugi::xml_node node, const float x, const float y, const float width, const float height, const float thickness, const std::string &hexcolor)
static std::string frame_name (int frame_number)
static std::string get_layer_id (const NSVGshape &shape, const int prefix)
static ColorGeometry4f unpack_nano_color (const uint pack)
static ColorGeometry4f average_gradient_color (const NSVGgradient &svg_gradient)
static ColorGeometry4f convert_svg_color (const NSVGpaint &svg_paint)
static IndexRange extend_curves_geometry (bke::CurvesGeometry &curves, const NSVGshape &shape)
static void shape_attributes_to_curves (bke::CurvesGeometry &curves, const NSVGshape &shape, const IndexRange curves_range, const float4x4 &transform, const int material_index)
static void shift_to_bounds_center (GreasePencil &grease_pencil)

Variables

constexpr const char * svg_exporter_name = "SVG Export for Grease Pencil"
constexpr const char * svg_exporter_version = "v2.0"

Enumeration Type Documentation

◆ ExportStatus

enum class blender::io::grease_pencil::ExportStatus : int8_t
strong
Enumerator
Ok 
NoFramesSelected 
InvalidActiveObjectType 
FileWriteError 
UnknownError 

Definition at line 48 of file grease_pencil_io.hh.

Function Documentation

◆ average_gradient_color()

ColorGeometry4f blender::io::grease_pencil::average_gradient_color ( const NSVGgradient & svg_gradient)
static

◆ convert_svg_color()

ColorGeometry4f blender::io::grease_pencil::convert_svg_color ( const NSVGpaint & svg_paint)
static

◆ export_pdf()

bool blender::io::grease_pencil::export_pdf ( const IOContext & context,
const ExportParams & params,
Scene & scene,
StringRefNull filepath )

◆ export_svg()

ExportStatus blender::io::grease_pencil::export_svg ( const IOContext & context,
const ExportParams & params,
Scene & scene,
StringRefNull filepath )

◆ extend_curves_geometry()

◆ frame_name()

std::string blender::io::grease_pencil::frame_name ( int frame_number)
static

◆ get_average() [1/2]

◆ get_average() [2/2]

◆ get_layer_id()

std::string blender::io::grease_pencil::get_layer_id ( const NSVGshape & shape,
const int prefix )
static

◆ import_svg()

bool blender::io::grease_pencil::import_svg ( const IOContext & context,
const ImportParams & params,
StringRefNull filepath )

◆ persmat_from_camera_object()

◆ rgb_to_hexstr()

std::string blender::io::grease_pencil::rgb_to_hexstr ( const float color[3])
static

Definition at line 42 of file grease_pencil_io_export_svg.cc.

References b.

Referenced by write_fill_color_attribute(), and write_stroke_color_attribute().

◆ shape_attributes_to_curves()

void blender::io::grease_pencil::shape_attributes_to_curves ( bke::CurvesGeometry & curves,
const NSVGshape & shape,
const IndexRange curves_range,
const float4x4 & transform,
const int material_index )
static

◆ shift_to_bounds_center()

◆ unpack_nano_color()

ColorGeometry4f blender::io::grease_pencil::unpack_nano_color ( const uint pack)
static

Definition at line 60 of file grease_pencil_io_import_svg.cc.

References float, and srgb_to_linearrgb_v4().

Referenced by average_gradient_color(), and convert_svg_color().

◆ write_fill_color_attribute()

void blender::io::grease_pencil::write_fill_color_attribute ( pugi::xml_node node,
const ColorGeometry4f & fill_color,
const float layer_opacity )
static

◆ write_rect()

void blender::io::grease_pencil::write_rect ( pugi::xml_node node,
const float x,
const float y,
const float width,
const float height,
const float thickness,
const std::string & hexcolor )
static

◆ write_stroke_color_attribute()

void blender::io::grease_pencil::write_stroke_color_attribute ( pugi::xml_node node,
const ColorGeometry4f & stroke_color,
const float stroke_opacity,
const bool round_cap )
static

Variable Documentation

◆ svg_exporter_name

const char* blender::io::grease_pencil::svg_exporter_name = "SVG Export for Grease Pencil"
constexpr

◆ svg_exporter_version

const char* blender::io::grease_pencil::svg_exporter_version = "v2.0"
constexpr