|
Blender V4.3
|
#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 ¶ms) | |
| void | prepare_render_params (Scene &scene, int frame_number) |
| Vector< ObjectInfo > | retrieve_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 |
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< float > | try_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< float4x4 > | camera_persmat_ |
| blender::Bounds< float2 > | render_rect_ |
Definition at line 48 of file grease_pencil_io_intern.hh.
Definition at line 79 of file grease_pencil_io_intern.hh.
| blender::io::grease_pencil::GreasePencilExporter::GreasePencilExporter | ( | const IOContext & | context, |
| const ExportParams & | params ) |
Definition at line 153 of file grease_pencil_io.cc.
|
static |
Definition at line 343 of file grease_pencil_io.cc.
References blender::ColorRGBA< ChannelStorageType, Space, Alpha >::a, blender::io::grease_pencil::get_average(), blender::math::interpolate(), and MaterialGPencilStyle::stroke_rgba.
|
static |
Definition at line 353 of file grease_pencil_io.cc.
References blender::io::grease_pencil::get_average().
| 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 420 of file grease_pencil_io.cc.
References context_, blender::bke::Curve, blender::bke::greasepencil::Drawing::fill_colors(), GP_STROKE_CAP_TYPE_ROUND, blender::bke::greasepencil::Drawing::opacities(), blender::threading::parallel_for(), blender::bke::greasepencil::Drawing::radii(), blender::io::grease_pencil::IOContext::rv3d, blender::bke::greasepencil::Drawing::strokes(), blender::bke::greasepencil::Drawing::vertex_colors(), and RegionView3D::viewmat.
Referenced by blender::io::grease_pencil::PDFExporter::export_grease_pencil_layer(), and blender::io::grease_pencil::SVGExporter::export_grease_pencil_layer().
| void blender::io::grease_pencil::GreasePencilExporter::prepare_render_params | ( | Scene & | scene, |
| int | frame_number ) |
Definition at line 316 of file grease_pencil_io.cc.
References View3D::camera, camera_persmat_, blender::io::grease_pencil::compute_objects_bounds(), context_, blender::io::grease_pencil::IOContext::depsgraph, ED_view3d_calc_camera_border(), blender::io::grease_pencil::persmat_from_camera_object(), RegionView3D::persp, blender::io::grease_pencil::IOContext::region, render_rect_, retrieve_objects(), blender::io::grease_pencil::IOContext::rv3d, RV3D_CAMOB, blender::io::grease_pencil::IOContext::v3d, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by blender::io::grease_pencil::PDFExporter::export_scene(), and blender::io::grease_pencil::SVGExporter::export_scene().
| float2 blender::io::grease_pencil::GreasePencilExporter::project_to_screen | ( | const float4x4 & | transform, |
| const float3 & | position ) const |
Definition at line 553 of file grease_pencil_io.cc.
References camera_persmat_, context_, ED_view3d_project_float_global(), ELEM, blender::math::project_point(), blender::io::grease_pencil::IOContext::region, render_rect_, blender::math::transform_point(), V2D_IS_CLIPPED, V3D_PROJ_RET_OK, and V3D_PROJ_TEST_NOP.
Referenced by blender::io::grease_pencil::SVGExporter::write_path(), blender::io::grease_pencil::SVGExporter::write_polygon(), blender::io::grease_pencil::SVGExporter::write_polyline(), and blender::io::grease_pencil::PDFExporter::write_stroke_to_polyline().
| Vector< GreasePencilExporter::ObjectInfo > blender::io::grease_pencil::GreasePencilExporter::retrieve_objects | ( | ) | const |
Definition at line 369 of file grease_pencil_io.cc.
References BASE_SELECTED, BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), blender::io::grease_pencil::IOContext::C, camera_persmat_, context_, CTX_data_scene(), CTX_data_view_layer(), blender::math::dot(), ED_view3d_calc_zfac(), RegionView3D::is_persp, LISTBASE_FOREACH, OB_GREASE_PENCIL, blender::io::grease_pencil::ExportParams::object, params_, blender::io::grease_pencil::IOContext::rv3d, blender::io::grease_pencil::ExportParams::select_mode, and RegionView3D::viewinv.
Referenced by blender::io::grease_pencil::PDFExporter::export_grease_pencil_objects(), blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), and prepare_render_params().
|
static |
Definition at line 358 of file grease_pencil_io.cc.
References blender::VArray< T >::ForFunc(), blender::Span< T >::size(), and blender::io::grease_pencil::try_get_constant_value().
|
protected |
Definition at line 60 of file grease_pencil_io_intern.hh.
Referenced by blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), prepare_render_params(), project_to_screen(), and retrieve_objects().
|
protected |
Definition at line 56 of file grease_pencil_io_intern.hh.
Referenced by blender::io::grease_pencil::PDFExporter::export_grease_pencil_objects(), blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), blender::io::grease_pencil::PDFExporter::export_scene(), foreach_stroke_in_layer(), prepare_render_params(), project_to_screen(), and retrieve_objects().
|
protected |
Definition at line 57 of file grease_pencil_io_intern.hh.
Referenced by blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), blender::io::grease_pencil::PDFExporter::export_scene(), and retrieve_objects().
|
protected |
Definition at line 61 of file grease_pencil_io_intern.hh.
Referenced by blender::io::grease_pencil::PDFExporter::add_page(), blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), prepare_render_params(), project_to_screen(), blender::io::grease_pencil::SVGExporter::write_main_node(), blender::io::grease_pencil::SVGExporter::write_path(), blender::io::grease_pencil::SVGExporter::write_polygon(), and blender::io::grease_pencil::SVGExporter::write_polyline().