|
Blender V5.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 | WriteShapeFn |
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_shape_in_layer (const Object &object, const bke::greasepencil::Layer &layer, const bke::greasepencil::Drawing &drawing, WriteShapeFn shape_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< 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_ |
| Bounds< float2 > | camera_rect_ |
| float2 | camera_fac_ |
| Bounds< float2 > | screen_rect_ |
Definition at line 53 of file grease_pencil_io_intern.hh.
Definition at line 86 of file grease_pencil_io_intern.hh.
| blender::io::grease_pencil::GreasePencilExporter::GreasePencilExporter | ( | const IOContext & | context, |
| const ExportParams & | params ) |
Definition at line 123 of file grease_pencil_io.cc.
|
static |
Definition at line 277 of file grease_pencil_io.cc.
References blender::ColorRGBA< ChannelStorageType, Space, Alpha >::a, blender::io::grease_pencil::get_average(), blender::math::interpolate(), and blender::MaterialGPencilStyle::stroke_rgba.
Referenced by foreach_shape_in_layer().
|
static |
Definition at line 287 of file grease_pencil_io.cc.
References blender::io::grease_pencil::get_average().
Referenced by foreach_shape_in_layer().
| std::string blender::io::grease_pencil::GreasePencilExporter::coord_to_svg_string | ( | const float2 & | screen_co | ) | const |
Definition at line 640 of file grease_pencil_io.cc.
References camera_persmat_, camera_rect_, coord_to_svg_string(), and screen_rect_.
Referenced by coord_to_svg_string(), and blender::io::grease_pencil::SVGExporter::write_path().
| void blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer | ( | const Object & | object, |
| const bke::greasepencil::Layer & | layer, | ||
| const bke::greasepencil::Drawing & | drawing, | ||
| WriteShapeFn | shape_fn ) |
Definition at line 395 of file grease_pencil_io.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::BKE_material_default_gpencil(), blender::BKE_object_material_get(), blender::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(), blender::array_utils::fill_index_range(), blender::bke::greasepencil::Drawing::fills(), foreach_shape_in_layer(), blender::IndexRange::from_single(), blender::VArray< T >::from_single(), blender::io::grease_pencil::get_miter_limit_angle(), blender::GP_MATERIAL_HIDE, blender::GP_STROKE_CAP_TYPE_ROUND, GP_STROKE_MITER_ANGLE_ROUND, blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_right(), blender::math::interpolate(), layer, blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::greasepencil::Drawing::opacities(), params_, blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::positions(), blender::bke::greasepencil::Drawing::radii(), blender::geometry::resample_to_length(), blender::blender::Span< T >::slice(), blender::bke::greasepencil::Drawing::strokes(), blender::math::transform_points(), try_get_uniform_point_width(), 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_shape_in_layer().
| bool blender::io::grease_pencil::GreasePencilExporter::is_selected_frame | ( | const GreasePencil & | grease_pencil, |
| int | frame_number ) const |
Definition at line 626 of file grease_pencil_io.cc.
References is_selected_frame(), and layer.
Referenced by blender::io::grease_pencil::PDFExporter::export_scene(), blender::io::grease_pencil::SVGExporter::export_scene(), and is_selected_frame().
| void blender::io::grease_pencil::GreasePencilExporter::prepare_render_params | ( | Scene & | scene, |
| int | frame_number ) |
Definition at line 241 of file grease_pencil_io.cc.
References blender::BKE_camera_view_border(), blender::BKE_render_resolution(), blender::BLI_assert(), blender::Bounds< T >::Bounds(), blender::View3D::camera, camera_fac_, camera_persmat_, camera_rect_, context_, blender::io::grease_pencil::IOContext::depsgraph, float, blender::io::grease_pencil::persmat_from_camera_object(), blender::RegionView3D::persp, blender::Scene::r, blender::io::grease_pencil::IOContext::region, retrieve_objects(), blender::io::grease_pencil::IOContext::rv3d, blender::RV3D_CAMOB, screen_rect_, blender::io::grease_pencil::IOContext::v3d, blender::ARegion::winx, blender::ARegion::winy, blender::rctf::xmax, blender::rctf::xmin, blender::rctf::ymax, and blender::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 600 of file grease_pencil_io.cc.
References camera_fac_, camera_persmat_, context_, blender::ED_view3d_project_float_global(), ELEM, position, blender::math::project_point(), project_to_screen(), screen_rect_, blender::math::transform_point(), V2D_IS_CLIPPED, blender::V3D_PROJ_RET_OK, and blender::V3D_PROJ_TEST_NOP.
Referenced by project_to_screen(), blender::io::grease_pencil::PDFExporter::write_path(), and blender::io::grease_pencil::SVGExporter::write_path().
| Vector< GreasePencilExporter::ObjectInfo > blender::io::grease_pencil::GreasePencilExporter::retrieve_objects | ( | ) | const |
Definition at line 311 of file grease_pencil_io.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::BASE_ENABLED_RENDER, blender::BASE_SELECTED, blender::BKE_view_layer_object_bases_get(), blender::BKE_view_layer_synced_ensure(), camera_persmat_, context_, blender::CTX_data_main(), blender::CTX_data_scene(), blender::CTX_data_view_layer(), blender::io::grease_pencil::GreasePencilExporter::ObjectInfo::depth, blender::math::dot(), blender::ED_view3d_calc_zfac(), blender::OB_GREASE_PENCIL, params_, position, and retrieve_objects().
Referenced by blender::io::grease_pencil::PDFExporter::export_grease_pencil_objects(), blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), prepare_render_params(), and retrieve_objects().
|
static |
Definition at line 292 of file grease_pencil_io.cc.
References blender::BLI_assert(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::Span< T >::is_empty(), blender::threading::parallel_for(), and blender::Span< T >::size().
Referenced by foreach_shape_in_layer().
|
protected |
Definition at line 67 of file grease_pencil_io_intern.hh.
Referenced by prepare_render_params(), and project_to_screen().
|
protected |
Definition at line 65 of file grease_pencil_io_intern.hh.
Referenced by blender::io::grease_pencil::PDFExporter::add_page(), coord_to_svg_string(), blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), prepare_render_params(), project_to_screen(), retrieve_objects(), and blender::io::grease_pencil::SVGExporter::write_main_node().
Definition at line 66 of file grease_pencil_io_intern.hh.
Referenced by blender::io::grease_pencil::PDFExporter::add_page(), coord_to_svg_string(), blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects(), prepare_render_params(), and blender::io::grease_pencil::SVGExporter::write_main_node().
|
protected |
Definition at line 61 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(), blender::io::grease_pencil::SVGExporter::export_scene(), foreach_shape_in_layer(), GreasePencilExporter(), prepare_render_params(), project_to_screen(), and retrieve_objects().
|
protected |
Definition at line 62 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(), blender::io::grease_pencil::SVGExporter::export_scene(), foreach_shape_in_layer(), GreasePencilExporter(), and retrieve_objects().
Definition at line 68 of file grease_pencil_io_intern.hh.
Referenced by blender::io::grease_pencil::PDFExporter::add_page(), coord_to_svg_string(), prepare_render_params(), project_to_screen(), and blender::io::grease_pencil::SVGExporter::write_main_node().