Blender V4.3
blender::io::grease_pencil Namespace Reference

Classes

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

Functions

bool import_svg (const IOContext &context, const ImportParams &params, StringRefNull filepath)
 
bool 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 std::optional< floattry_get_constant_value (const VArray< float > values, const float epsilon=1e-5f)
 
static IndexMask get_visible_strokes (const Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
 
static std::optional< Bounds< float2 > > compute_drawing_bounds (const ARegion &region, const RegionView3D &rv3d, const Object &object, const Object &object_eval, const int layer_index, const int frame_number, const bke::greasepencil::Drawing &drawing)
 
static std::optional< Bounds< float2 > > compute_objects_bounds (const ARegion &region, const RegionView3D &rv3d, const Depsgraph &depsgraph, const Span< GreasePencilExporter::ObjectInfo > objects, const int frame_number)
 
static float4x4 persmat_from_camera_object (Scene &scene)
 
static bool is_selected_frame (const GreasePencil &grease_pencil, const int frame_number)
 
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 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 * attr_material_index = "material_index"
 
constexpr const char * svg_exporter_name = "SVG Export for Grease Pencil"
 
constexpr const char * svg_exporter_version = "v2.0"
 

Function Documentation

◆ average_gradient_color()

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

◆ compute_drawing_bounds()

◆ compute_objects_bounds()

static std::optional< Bounds< float2 > > blender::io::grease_pencil::compute_objects_bounds ( const ARegion & region,
const RegionView3D & rv3d,
const Depsgraph & depsgraph,
const Span< GreasePencilExporter::ObjectInfo > objects,
const int frame_number )
static

◆ convert_svg_color()

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

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

◆ extend_curves_geometry()

◆ get_average() [1/2]

static ColorGeometry4f blender::io::grease_pencil::get_average ( const Span< ColorGeometry4f > values)
static

◆ get_average() [2/2]

◆ get_layer_id()

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

◆ get_visible_strokes()

◆ import_svg()

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

◆ is_selected_frame()

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

◆ persmat_from_camera_object()

◆ rgb_to_hexstr()

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

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

◆ shift_to_bounds_center()

◆ try_get_constant_value()

static std::optional< float > blender::io::grease_pencil::try_get_constant_value ( const VArray< float > values,
const float epsilon = 1e-5f )
static

◆ unpack_nano_color()

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

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

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

◆ write_rect()

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

static 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

◆ attr_material_index

const char* blender::io::grease_pencil::attr_material_index = "material_index"
constexpr

Definition at line 158 of file grease_pencil_io.cc.

Referenced by get_visible_strokes().

◆ 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