|
Blender V4.5
|
#include <iostream>#include <optional>#include "BKE_action.hh"#include "BKE_anim_data.hh"#include "BKE_animsys.h"#include "BKE_asset_edit.hh"#include "BKE_attribute_legacy_convert.hh"#include "BKE_attribute_storage.hh"#include "BKE_attribute_storage_blend_write.hh"#include "BKE_bake_data_block_id.hh"#include "BKE_curves.hh"#include "BKE_customdata.hh"#include "BKE_deform.hh"#include "BKE_fcurve.hh"#include "BKE_geometry_set.hh"#include "BKE_grease_pencil.h"#include "BKE_grease_pencil.hh"#include "BKE_idtype.hh"#include "BKE_lib_id.hh"#include "BKE_lib_query.hh"#include "BKE_main.hh"#include "BKE_material.hh"#include "BKE_modifier.hh"#include "BKE_object.hh"#include "BKE_object_types.hh"#include "BLI_array_utils.hh"#include "BLI_bounds.hh"#include "BLI_enumerable_thread_specific.hh"#include "BLI_listbase.h"#include "BLI_map.hh"#include "BLI_math_euler_types.hh"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_matrix.hh"#include "BLI_math_matrix_types.hh"#include "BLI_math_vector_types.hh"#include "BLI_memarena.h"#include "BLI_memory_utils.hh"#include "BLI_polyfill_2d.h"#include "BLI_resource_scope.hh"#include "BLI_span.hh"#include "BLI_stack.hh"#include "BLI_string.h"#include "BLI_string_ref.hh"#include "BLI_string_utils.hh"#include "BLI_utildefines.h"#include "BLI_vector_set.hh"#include "BLI_virtual_array.hh"#include "BLO_read_write.hh"#include "BLT_translation.hh"#include "DNA_ID.h"#include "DNA_ID_enums.h"#include "DNA_brush_types.h"#include "DNA_defaults.h"#include "DNA_grease_pencil_types.h"#include "DNA_material_types.h"#include "DNA_modifier_types.h"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "RNA_access.hh"#include "RNA_path.hh"#include "RNA_prototypes.hh"#include "MEM_guardedalloc.h"#include "CLG_log.h"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::greasepencil |
Variables | |
| static CLG_LogRef | LOG = {"geom.grease_pencil"} |
| static const char * | ATTR_POSITION = "position" |
| IDTypeInfo | IDType_ID_GP |
| constexpr StringRef | blender::bke::greasepencil::ATTR_RADIUS = "radius" |
| constexpr StringRef | blender::bke::greasepencil::ATTR_OPACITY = "opacity" |
| constexpr StringRef | blender::bke::greasepencil::ATTR_VERTEX_COLOR = "vertex_color" |
| constexpr StringRef | blender::bke::greasepencil::ATTR_FILL_COLOR = "fill_color" |
Draw Cache | |
| void(* | BKE_grease_pencil_batch_cache_dirty_tag_cb )(GreasePencil *grease_pencil, int mode) = nullptr |
| void(* | BKE_grease_pencil_batch_cache_free_cb )(GreasePencil *grease_pencil) = nullptr |
| void | BKE_grease_pencil_batch_cache_dirty_tag (GreasePencil *grease_pencil, int mode) |
| void | BKE_grease_pencil_batch_cache_free (GreasePencil *grease_pencil) |
| GreasePencil * BKE_grease_pencil_add | ( | Main * | bmain, |
| const char * | name ) |
Definition at line 2112 of file grease_pencil.cc.
References BKE_id_new(), and name.
Referenced by BKE_object_obdata_add_from_type(), blender::ed::object::convert_curves_legacy_to_grease_pencil(), blender::ed::object::convert_font_to_grease_pencil(), blender::ed::object::convert_mesh_to_grease_pencil(), and blender::ed::greasepencil::duplicate_grease_pencil_object().
| void BKE_grease_pencil_batch_cache_dirty_tag | ( | GreasePencil * | grease_pencil, |
| int | mode ) |
Definition at line 2916 of file grease_pencil.cc.
References BKE_grease_pencil_batch_cache_dirty_tag_cb, and GreasePencil::runtime.
Referenced by BKE_object_batch_cache_dirty_tag().
| void BKE_grease_pencil_batch_cache_free | ( | GreasePencil * | grease_pencil | ) |
Definition at line 2923 of file grease_pencil.cc.
References BKE_grease_pencil_batch_cache_free_cb, and GreasePencil::runtime.
Referenced by grease_pencil_free_data().
| GreasePencil * BKE_grease_pencil_copy_for_eval | ( | const GreasePencil * | grease_pencil_src | ) |
Definition at line 2125 of file grease_pencil.cc.
References BKE_id_copy_ex(), GreasePencil::id, LIB_ID_COPY_LOCALIZE, and GreasePencil::runtime.
Referenced by blender::ed::object::convert_curves_to_grease_pencil(), blender::bke::GreasePencilComponent::copy(), blender::bke::GreasePencilComponent::ensure_owns_direct_data(), blender::geometry::execute_realize_grease_pencil_tasks(), blender::bke::GreasePencilComponent::get_for_write(), and blender::ed::geometry::get_original_geometry_eval_copy().
| void BKE_grease_pencil_copy_layer_group_parameters | ( | const blender::bke::greasepencil::LayerGroup & | src, |
| blender::bke::greasepencil::LayerGroup & | dst ) |
Definition at line 2171 of file grease_pencil.cc.
References blender::bke::greasepencil::LayerGroup::as_node(), GreasePencilLayerTreeNode::color, GreasePencilLayerTreeGroup::color_tag, copy_v3_v3(), and GreasePencilLayerTreeNode::flag.
Referenced by blender::ed::greasepencil::copy_layer_group_recursive(), and blender::ed::greasepencil::copy_layer_groups_without_layers().
| void BKE_grease_pencil_copy_layer_parameters | ( | const blender::bke::greasepencil::Layer & | src, |
| blender::bke::greasepencil::Layer & | dst ) |
Definition at line 2144 of file grease_pencil.cc.
References GreasePencilLayer::active_mask_index, blender::bke::greasepencil::Layer::as_node(), GreasePencilLayer::blend_mode, BLI_addtail(), GreasePencilLayerTreeNode::color, copy_m4_m4(), copy_v3_v3(), GreasePencilLayerTreeNode::flag, LISTBASE_FOREACH, GreasePencilLayer::masks, GreasePencilLayer::opacity, GreasePencilLayer::parent, GreasePencilLayer::parentinv, GreasePencilLayer::parsubstr, GreasePencilLayer::rotation, GreasePencilLayer::scale, blender::bke::greasepencil::Layer::set_parent_bone_name(), blender::bke::greasepencil::Layer::set_view_layer_name(), GreasePencilLayer::translation, and GreasePencilLayer::viewlayername.
Referenced by blender::ed::greasepencil::copy_layer(), blender::ed::greasepencil::duplicate_layer_and_frames(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_layers(), blender::geometry::execute_realize_grease_pencil_task(), blender::ed::greasepencil::find_or_create_layer_in_dst_by_name(), blender::ed::greasepencil::merge_layers(), and blender::geometry::separate_grease_pencil_layer_selection().
| void BKE_grease_pencil_copy_parameters | ( | const GreasePencil & | src, |
| GreasePencil & | dst ) |
Copy everything except the layer tree and the drawings.
Definition at line 2133 of file grease_pencil.cc.
References GreasePencil::attributes_active_index, BLI_duplicatelist(), GreasePencil::flag, GreasePencil::material_array, GreasePencil::material_array_num, MEM_dupallocN(), GreasePencil::onion_skinning_settings, GreasePencil::vertex_group_active_index, and GreasePencil::vertex_group_names.
Referenced by blender::ed::greasepencil::duplicate_grease_pencil_object(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_layers(), blender::geometry::execute_realize_grease_pencil_tasks(), blender::ed::greasepencil::grease_pencil_merge_layer_exec(), blender::geometry::merge_layers(), blender::geometry::separate_grease_pencil_layer_selection(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), and blender::ed::greasepencil::tests::TEST().
| bool BKE_grease_pencil_drawing_attribute_required | ( | const GreasePencilDrawing * | , |
| const blender::StringRef | name ) |
Definition at line 2106 of file grease_pencil.cc.
References ATTR_POSITION, and name.
Referenced by BKE_attribute_required().
| void BKE_grease_pencil_duplicate_drawing_array | ( | const GreasePencil * | grease_pencil_src, |
| GreasePencil * | grease_pencil_dst ) |
Definition at line 2461 of file grease_pencil.cc.
References blender::bke::greasepencil::copy_drawing_array(), GreasePencil::drawing_array, GreasePencil::drawing_array_num, and MEM_calloc_arrayN().
Referenced by grease_pencil_copy_data().
| void BKE_grease_pencil_eval_geometry | ( | Depsgraph * | depsgraph, |
| GreasePencil * | grease_pencil ) |
Definition at line 2400 of file grease_pencil.cc.
References DEG_get_ctime(), depsgraph, grease_pencil_evaluate_layers(), and GreasePencil::runtime.
Referenced by blender::deg::DepsgraphNodeBuilder::build_object_data_geometry_datablock().
| bool BKE_grease_pencil_has_curve_with_type | ( | const GreasePencil & | grease_pencil, |
| CurveType | type ) |
Definition at line 2481 of file grease_pencil.cc.
References GP_DRAWING, blender::bke::CurvesGeometry::has_curve_with_type(), blender::bke::greasepencil::Drawing::strokes(), and wrap().
Referenced by blender::ed::object::data_xform_create_ex().
| void BKE_grease_pencil_material_index_remove | ( | GreasePencil * | grease_pencil, |
| const int | index ) |
Definition at line 2829 of file grease_pencil.cc.
References blender::bke::CurvesGeometry::attributes_for_write(), BLI_assert, blender::bke::SpanAttributeWriter< T >::domain, blender::bke::SpanAttributeWriter< T >::finish(), GP_DRAWING, blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::bke::SpanAttributeWriter< T >::span, blender::bke::greasepencil::Drawing::strokes_for_write(), and wrap().
Referenced by material_data_index_remove_id().
| bool BKE_grease_pencil_material_index_used | ( | GreasePencil * | grease_pencil, |
| int | index ) |
Definition at line 2855 of file grease_pencil.cc.
References blender::bke::CurvesGeometry::attributes(), blender::Span< T >::contains(), GP_DRAWING, blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::greasepencil::Drawing::strokes(), and wrap().
Referenced by BKE_object_material_slot_used().
| void BKE_grease_pencil_material_remap | ( | GreasePencil * | grease_pencil, |
| const uint * | remap, | ||
| int | totcol ) |
Definition at line 2804 of file grease_pencil.cc.
References blender::bke::CurvesGeometry::attributes_for_write(), BLI_assert, blender::bke::SpanAttributeWriter< T >::domain, blender::bke::SpanAttributeWriter< T >::finish(), GP_DRAWING, blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::bke::SpanAttributeWriter< T >::span, blender::bke::greasepencil::Drawing::strokes_for_write(), UNUSED_VARS_NDEBUG, and wrap().
Referenced by BKE_object_material_remap().
| GreasePencil * BKE_grease_pencil_new_nomain | ( | ) |
Definition at line 2119 of file grease_pencil.cc.
References BKE_id_new_nomain().
Referenced by BKE_object_eval_grease_pencil(), blender::ed::object::convert_curves_to_grease_pencil(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curves_to_grease_pencil_with_one_layer(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_layers(), blender::geometry::execute_realize_grease_pencil_tasks(), blender::geometry::extract_greasepencil_layer_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::geometry::extract_greasepencil_layers(), blender::ed::greasepencil::grease_pencil_merge_layer_exec(), blender::geometry::merge_layers(), blender::geometry::separate_grease_pencil_layer_selection(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), and blender::bke::bake::try_load_grease_pencil().
| void BKE_grease_pencil_nomain_to_grease_pencil | ( | GreasePencil * | grease_pencil_src, |
| GreasePencil * | grease_pencil_dst ) |
Move data from a grease pencil outside of the main data-base into a grease pencil in the data-base. Takes ownership of the source grease pencil.
Definition at line 2180 of file grease_pencil.cc.
References GreasePencil::active_node, BKE_id_free(), BLI_assert, CD_MASK_ALL, CustomData_free(), CustomData_init_from(), DEG_id_tag_update(), GreasePencil::drawing_array, GreasePencil::drawing_array_num, free_drawing_array(), GP_DRAWING, GP_DRAWING_REFERENCE, GreasePencil::id, ID_RECALC_GEOMETRY, GreasePencil::layers_data, GreasePencil::root_group_ptr, GreasePencilDrawingBase::type, and wrap().
Referenced by blender::ed::object::convert_curves_to_grease_pencil(), and blender::ed::greasepencil::grease_pencil_merge_layer_exec().
| Material * BKE_grease_pencil_object_material_alt_ensure_from_brush | ( | Main * | bmain, |
| Object * | ob, | ||
| Brush * | brush ) |
Definition at line 2787 of file grease_pencil.cc.
References blender::bke::asset_edit_id_find_local(), BKE_grease_pencil_object_material_ensure_from_brush(), BKE_object_material_slot_find_index(), Brush::gpencil_settings, Material::id, and BrushGpencilSettings::material_alt.
Referenced by blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done().
| Material * BKE_grease_pencil_object_material_ensure_by_name | ( | Main * | bmain, |
| Object * | ob, | ||
| const char * | name, | ||
| int * | r_index ) |
Definition at line 2723 of file grease_pencil.cc.
References BKE_grease_pencil_object_material_index_get_by_name(), BKE_grease_pencil_object_material_new(), BKE_object_material_get(), and name.
Referenced by blender::ed::greasepencil::add_material_from_template(), and blender::ed::object::mesh_to_grease_pencil_add_material().
| Material * BKE_grease_pencil_object_material_ensure_from_brush | ( | Main * | bmain, |
| Object * | ob, | ||
| Brush * | brush ) |
Definition at line 2760 of file grease_pencil.cc.
References Object::actcol, BKE_material_default_gpencil(), BKE_object_material_get(), BrushGpencilSettings::flag, GP_BRUSH_MATERIAL_PINNED, Brush::gpencil_settings, and grease_pencil_object_material_ensure_from_brush_pinned().
Referenced by BKE_grease_pencil_object_material_alt_ensure_from_brush(), blender::ed::sculpt_paint::grease_pencil_fill_init(), blender::ed::greasepencil::grease_pencil_primitive_invoke(), and blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_begin().
Definition at line 2712 of file grease_pencil.cc.
References Object::actcol, BKE_object_material_get(), BrushGpencilSettings::flag, GP_BRUSH_MATERIAL_PINNED, Brush::gpencil_settings, and BrushGpencilSettings::material.
Referenced by blender::ed::sculpt_paint::grease_pencil_brush_cursor_draw().
| int BKE_grease_pencil_object_material_index_get_by_name | ( | Object * | ob, |
| const char * | name ) |
Definition at line 2681 of file grease_pencil.cc.
References BKE_object_material_get(), BKE_object_material_len_p(), Material::id, ID::name, name, and STREQ.
Referenced by BKE_grease_pencil_object_material_ensure_by_name(), and blender::io::grease_pencil::GreasePencilImporter::create_material().
| Material * BKE_grease_pencil_object_material_new | ( | Main * | bmain, |
| Object * | ob, | ||
| const char * | name, | ||
| int * | r_index ) |
Definition at line 2695 of file grease_pencil.cc.
References Object::actcol, BKE_gpencil_material_add(), BKE_MAT_ASSIGN_USERPREF, BKE_object_material_assign(), BKE_object_material_slot_add(), Material::id, id_us_min(), name, and Object::totcol.
Referenced by blender::ed::object::add_grease_pencil_materials_for_conversion(), BKE_grease_pencil_object_material_ensure_by_name(), blender::ed::greasepencil::clipboard_materials_remap(), blender::io::grease_pencil::GreasePencilImporter::create_material(), and blender::ui::greasepencil::eyedropper_add_material().
| void BKE_grease_pencil_point_coords_apply | ( | GreasePencil & | grease_pencil, |
| blender::Span< blender::float3 > | all_positions, | ||
| blender::Span< float > | all_radii ) |
Definition at line 2572 of file grease_pencil.cc.
References CURVE_TYPE_BEZIER, frame, blender::bke::greasepencil::Layer::frames(), GP_DRAWING, blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::math::invert(), blender::bke::greasepencil::Layer::local_transform(), blender::bke::CurvesGeometry::points_range(), blender::bke::CurvesGeometry::positions_for_write(), blender::bke::greasepencil::Drawing::radii_for_write(), blender::bke::greasepencil::Drawing::strokes_for_write(), blender::bke::greasepencil::Drawing::tag_positions_changed(), blender::bke::CurvesGeometry::tag_radii_changed(), blender::math::transform_point(), GreasePencilDrawingBase::type, and wrap().
Referenced by blender::ed::object::data_xform_restore().
| void BKE_grease_pencil_point_coords_apply_with_mat4 | ( | GreasePencil & | grease_pencil, |
| blender::Span< blender::float3 > | all_positions, | ||
| blender::Span< float > | all_radii, | ||
| const blender::float4x4 & | mat ) |
Definition at line 2622 of file grease_pencil.cc.
References CURVE_TYPE_BEZIER, frame, blender::bke::greasepencil::Layer::frames(), GP_DRAWING, blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::math::invert(), blender::bke::greasepencil::Layer::local_transform(), mat4_to_scale(), blender::bke::CurvesGeometry::points_range(), blender::bke::CurvesGeometry::positions_for_write(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::bke::greasepencil::Drawing::radii_for_write(), blender::bke::greasepencil::Drawing::strokes_for_write(), blender::bke::greasepencil::Drawing::tag_positions_changed(), blender::bke::CurvesGeometry::tag_radii_changed(), blender::math::transform_point(), GreasePencilDrawingBase::type, and wrap().
Referenced by blender::ed::object::data_xform_by_mat4().
| void BKE_grease_pencil_point_coords_get | ( | const GreasePencil & | grease_pencil, |
| blender::MutableSpan< blender::float3 > | all_positions, | ||
| blender::MutableSpan< float > | all_radii ) |
Definition at line 2525 of file grease_pencil.cc.
References CURVE_TYPE_BEZIER, frame, blender::bke::greasepencil::Layer::frames(), GP_DRAWING, blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_right(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::bke::greasepencil::Layer::local_transform(), blender::bke::CurvesGeometry::points_range(), blender::bke::CurvesGeometry::positions(), blender::bke::greasepencil::Drawing::radii(), blender::bke::greasepencil::Drawing::strokes(), blender::math::transform_point(), GreasePencilDrawingBase::type, and wrap().
Referenced by blender::ed::object::data_xform_create_ex().
| bool BKE_grease_pencil_references_cyclic_check | ( | const GreasePencil * | id_reference, |
| const GreasePencil * | grease_pencil ) |
Definition at line 2900 of file grease_pencil.cc.
References grease_pencil_references_cyclic_check_internal().
| int BKE_grease_pencil_stroke_point_count | ( | const GreasePencil & | grease_pencil | ) |
Definition at line 2500 of file grease_pencil.cc.
References frame, blender::bke::greasepencil::Layer::frames(), GP_DRAWING, blender::bke::CurvesGeometry::points_num(), blender::bke::greasepencil::Drawing::strokes(), GreasePencilDrawingBase::type, and wrap().
Referenced by blender::ed::object::data_xform_create_ex().
| void BKE_grease_pencil_vgroup_name_update | ( | Object * | ob, |
| const char * | old_name, | ||
| const char * | new_name ) |
Definition at line 2231 of file grease_pencil.cc.
References Object::data, LISTBASE_FOREACH, STREQ, STRNCPY(), blender::bke::greasepencil::Drawing::strokes_for_write(), CurvesGeometry::vertex_group_names, and wrap().
Referenced by BKE_object_defgroup_set_name(), and ED_armature_bone_rename().
Definition at line 2409 of file grease_pencil.cc.
References BKE_grease_pencil_new_nomain(), BKE_object_eval_assign_data(), BKE_object_free_derived_caches(), blender::bke::AttributeAccessor::contains(), data, DEG_get_ctime(), DEG_get_original(), depsgraph, ELEM, blender::bke::GeometrySet::get_component_for_write(), blender::bke::GeometrySet::get_grease_pencil(), blender::bke::GeometrySet::get_grease_pencil_for_write(), grease_pencil_do_layer_adjustments(), blender::bke::GeometryComponentEditData::grease_pencil_edit_hints_, grease_pencil_evaluate_modifiers(), blender::bke::GeometrySet::has_grease_pencil(), GreasePencil::id, Object::mode, OB_MODE_EDIT, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_VERTEX_GREASE_PENCIL, OB_MODE_WEIGHT_GREASE_PENCIL, blender::bke::GeometrySet::replace_grease_pencil(), GreasePencil::runtime, and scene.
Referenced by BKE_object_handle_data_update().
|
static |
Definition at line 2981 of file grease_pencil.cc.
References ELEM, GP_DRAWING, GP_DRAWING_REFERENCE, and GreasePencilDrawingBase::type.
|
static |
Definition at line 4392 of file grease_pencil.cc.
References GP_DRAWING, and GP_DRAWING_REFERENCE.
|
static |
Definition at line 4470 of file grease_pencil.cc.
Referenced by BKE_grease_pencil_nomain_to_grease_pencil(), and grease_pencil_free_data().
|
static |
Definition at line 3785 of file grease_pencil.cc.
References blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), and node.
Referenced by unique_node_name().
|
static |
Definition at line 370 of file grease_pencil.cc.
References GreasePencil::attribute_storage, BLO_read_data_invalidate(), BLO_read_pointer_array(), BLO_read_struct_list, CustomData_blend_read(), blender::bke::grease_pencil_convert_storage_to_customdata(), grease_pencil_replace_end_frames_after_read(), grease_pencil_validate_drawing_data(), GreasePencil::layers_data, GreasePencil::material_array, GreasePencil::material_array_num, read_drawing_array(), read_layer_tree(), GreasePencil::runtime, and GreasePencil::vertex_group_names.
|
static |
Definition at line 325 of file grease_pencil.cc.
References GreasePencil::attribute_storage.
|
static |
Definition at line 234 of file grease_pencil.cc.
References GreasePencil::attribute_storage, BKE_defgroup_copy_list(), BKE_grease_pencil_duplicate_drawing_array(), BLI_assert, CD_MASK_ALL, CustomData_init_from(), grease_pencil_set_runtime_visibilities(), GreasePencil::layers_data, GreasePencil::material_array, MEM_dupallocN(), GreasePencil::root_group_ptr, GreasePencil::runtime, and GreasePencil::vertex_group_names.
|
static |
Definition at line 2306 of file grease_pencil.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::AttributeAccessor::contains(), info, blender::bke::Layer, blender::bke::AttributeAccessor::lookup_or_default(), blender::threading::parallel_for(), blender::threading::parallel_for_each(), and range.
Referenced by BKE_object_eval_grease_pencil().
|
static |
Definition at line 2375 of file grease_pencil.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), and GreasePencilLayer::runtime.
Referenced by BKE_grease_pencil_eval_geometry().
|
static |
Definition at line 2246 of file grease_pencil.cc.
References BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_clear_errors(), BKE_modifiers_get_virtual_modifierlist(), BKE_object_is_in_editmode(), DAG_EVAL_RENDER, DEG_get_mode(), depsgraph, eModifierMode_Editmode, eModifierMode_Realtime, eModifierMode_Render, eModifierType_GreasePencilTime, MOD_APPLY_RENDER, MOD_APPLY_USECACHE, ModifierTypeInfo::modify_geometry_set, ModifierData::next, scene, and ModifierData::type.
Referenced by BKE_object_eval_grease_pencil().
|
static |
Definition at line 305 of file grease_pencil.cc.
References BKE_LIB_FOREACHID_PROCESS_IDSUPER, data, GP_DRAWING_REFERENCE, GreasePencilDrawingReference::id_reference, IDWALK_CB_USER, GreasePencil::material_array, and GreasePencil::material_array_num.
|
static |
Definition at line 284 of file grease_pencil.cc.
References GreasePencil::attribute_storage, BKE_animdata_free(), BKE_grease_pencil_batch_cache_free(), BLI_freelistN(), CustomData_free(), free_drawing_array(), GreasePencil::id, GreasePencil::layers_data, GreasePencil::material_array, MEM_SAFE_FREE, GreasePencil::runtime, and GreasePencil::vertex_group_names.
|
static |
Definition at line 102 of file grease_pencil.cc.
References GreasePencil::attribute_storage, BLI_assert, CustomData_reset(), DNA_struct_default_get, GreasePencil::layers_data, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, GreasePencil::root_group_ptr, and GreasePencil::runtime.
|
static |
Definition at line 2736 of file grease_pencil.cc.
References blender::bke::asset_edit_id_ensure_local(), BKE_MAT_ASSIGN_USERPREF, BKE_object_material_assign(), BKE_object_material_index_get(), BKE_object_material_slot_add(), Brush::gpencil_settings, Material::id, BrushGpencilSettings::material, and Object::totcol.
Referenced by BKE_grease_pencil_object_material_ensure_from_brush().
|
static |
Definition at line 2882 of file grease_pencil.cc.
References GP_DRAWING_REFERENCE, and grease_pencil_references_cyclic_check_internal().
Referenced by BKE_grease_pencil_references_cyclic_check(), and grease_pencil_references_cyclic_check_internal().
|
static |
End frames have no drawing (drawing_index is -1), which much of the code doesn't handle yet.
They can't be created anymore, but older versions could write them. Replace them with regular frames using an empty drawing, instead of treating them as corrupt, since there could exist valid blendfiles containing them.
Definition at line 185 of file grease_pencil.cc.
References BKE_id_name(), BLI_assert, CLOG_WARN, GreasePencil::flag, frame, GP_FRAME_IMPLICIT_HOLD, GreasePencil::id, and LOG.
Referenced by grease_pencil_blend_read_data().
|
static |
Definition at line 122 of file grease_pencil.cc.
References GreasePencil::adt, blender::bke::greasepencil::LayerGroup::as_node(), BLI_assert_msg, DEG_is_evaluated(), blender::bke::greasepencil::TreeNode::parent_group(), RNA_path_from_ID_to_property(), RNA_pointer_create_discrete(), and RNA_struct_type_find_property().
Referenced by grease_pencil_copy_data().
|
static |
Definition at line 211 of file grease_pencil.cc.
References ELEM, GP_DRAWING, GP_DRAWING_REFERENCE, and value.
Referenced by grease_pencil_blend_read_data().
Definition at line 2936 of file grease_pencil.cc.
References BLI_assert, MEM_calloc_arrayN(), MEM_freeN(), num, and blender::uninitialized_relocate_n().
|
static |
Definition at line 4080 of file grease_pencil.cc.
References ATTR_FALLTHROUGH, eModifierType_GreasePencilArmature, eModifierType_GreasePencilArray, eModifierType_GreasePencilBuild, eModifierType_GreasePencilColor, eModifierType_GreasePencilDash, eModifierType_GreasePencilEnvelope, eModifierType_GreasePencilHook, eModifierType_GreasePencilLattice, eModifierType_GreasePencilLength, eModifierType_GreasePencilLineart, eModifierType_GreasePencilMirror, eModifierType_GreasePencilMultiply, eModifierType_GreasePencilNoise, eModifierType_GreasePencilOffset, eModifierType_GreasePencilOpacity, eModifierType_GreasePencilOutline, eModifierType_GreasePencilShrinkwrap, eModifierType_GreasePencilSimplify, eModifierType_GreasePencilSmooth, eModifierType_GreasePencilSubdiv, eModifierType_GreasePencilTexture, eModifierType_GreasePencilThickness, eModifierType_GreasePencilTime, eModifierType_GreasePencilTint, eModifierType_GreasePencilWeightAngle, eModifierType_GreasePencilWeightProximity, GreasePencilArmatureModifierData::influence, GreasePencilArrayModifierData::influence, GreasePencilBuildModifierData::influence, GreasePencilColorModifierData::influence, GreasePencilDashModifierData::influence, GreasePencilEnvelopeModifierData::influence, GreasePencilHookModifierData::influence, GreasePencilLatticeModifierData::influence, GreasePencilLengthModifierData::influence, GreasePencilMirrorModifierData::influence, GreasePencilMultiModifierData::influence, GreasePencilNoiseModifierData::influence, GreasePencilOffsetModifierData::influence, GreasePencilOpacityModifierData::influence, GreasePencilOutlineModifierData::influence, GreasePencilShrinkwrapModifierData::influence, GreasePencilSimplifyModifierData::influence, GreasePencilSmoothModifierData::influence, GreasePencilSubdivModifierData::influence, GreasePencilTextureModifierData::influence, GreasePencilThickModifierData::influence, GreasePencilTimeModifierData::influence, GreasePencilTintModifierData::influence, GreasePencilWeightAngleModifierData::influence, GreasePencilWeightProximityModifierData::influence, and ModifierData::type.
|
static |
Definition at line 4508 of file grease_pencil.cc.
References GP_LAYER_TREE_GROUP, and GP_LAYER_TREE_LEAF.
|
static |
Definition at line 4403 of file grease_pencil.cc.
References BLO_read_pointer_array(), BLO_read_struct_with_type_size(), GreasePencil::drawing_array, GreasePencil::drawing_array_num, GP_DRAWING, GP_DRAWING_REFERENCE, GreasePencilDrawing::runtime, and GreasePencilDrawingBase::type.
Referenced by grease_pencil_blend_read_data().
|
static |
Definition at line 4481 of file grease_pencil.cc.
References BLO_read_int32_array(), BLO_read_string(), BLO_read_struct_array, BLO_read_struct_list, LISTBASE_FOREACH, mask(), and node.
Referenced by read_layer_tree_group().
|
static |
Definition at line 4548 of file grease_pencil.cc.
References GreasePencil::active_node, BLO_read_struct, read_layer_tree_group(), and GreasePencil::root_group_ptr.
Referenced by grease_pencil_blend_read_data().
|
static |
Definition at line 4519 of file grease_pencil.cc.
References BLO_read_string(), BLO_read_struct_list_with_type_size(), GP_LAYER_TREE_GROUP, GP_LAYER_TREE_LEAF, LISTBASE_FOREACH, node, read_layer(), read_layer_tree_group(), and GreasePencilLayerTreeNode::type.
Referenced by read_layer_tree(), and read_layer_tree_group().
|
static |
Definition at line 3925 of file grease_pencil.cc.
References CD_CONSTRUCT, CD_MASK_ALL, CustomData_copy_data(), CustomData_free(), CustomData_init_layout_from(), data, blender::Span< T >::index_range(), and blender::Span< T >::size().
Referenced by reorder_layer_data().
|
static |
Definition at line 3938 of file grease_pencil.cc.
References BLI_assert, blender::Span< T >::index_range(), GreasePencil::layers_data, reorder_customdata(), and blender::Span< T >::size().
|
static |
Definition at line 2950 of file grease_pencil.cc.
References BLI_assert, MEM_calloc_arrayN(), MEM_freeN(), num, and blender::uninitialized_move_n().
|
static |
Definition at line 4251 of file grease_pencil.cc.
References CD_CONSTRUCT, CD_MASK_ALL, CustomData_copy_data(), CustomData_free(), CustomData_init_layout_from(), CustomData_realloc(), data, blender::IndexRange::is_empty(), blender::IndexRange::size(), size(), and blender::IndexRange::start().
|
static |
Definition at line 3529 of file grease_pencil.cc.
References BLI_assert, blender::Span< T >::index_range(), blender::threading::parallel_for(), range, blender::MutableSpan< T >::size(), and blender::Span< T >::size().
Referenced by blender::ed::object::apply_objects_internal(), blender::ed::sculpt_paint::brushes::calc_bmesh(), blender::ed::sculpt_paint::brushes::calc_faces(), blender::ed::sculpt_paint::brushes::calc_grids(), blender::geometry::execute_realize_pointcloud_tasks(), blender::bke::mesh_transform(), blender::bke::CurvesGeometry::transform(), blender::geometry::transform_curve_edit_hints(), blender::geometry::transform_grease_pencil_edit_hints(), and blender::geometry::transform_pointcloud().
|
static |
Definition at line 3814 of file grease_pencil.cc.
References DATA_, blender::StringRefBase::is_empty(), name, and unique_node_name().
|
static |
Definition at line 3795 of file grease_pencil.cc.
References BLI_assert, BLI_uniquename_cb(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), get_node_names(), blender::StringRefBase::is_empty(), and name.
Referenced by unique_layer_group_name().
|
static |
Definition at line 4274 of file grease_pencil.cc.
References node, and GreasePencil::root_group_ptr.
|
static |
Definition at line 4438 of file grease_pencil.cc.
References blender::bke::CurvesGeometry::blend_write(), blender::bke::CurvesGeometry::blend_write_prepare(), BLO_write_pointer_array(), BLO_write_struct, BLO_write_struct_at_address, blender::ResourceScope::construct(), GreasePencil::drawing_array, GreasePencil::drawing_array_num, GreasePencilDrawing::geometry, GP_DRAWING, GP_DRAWING_REFERENCE, GreasePencil::id, GreasePencilDrawing::runtime, and GreasePencilDrawingBase::type.
|
static |
Definition at line 4567 of file grease_pencil.cc.
References BLO_write_int32_array(), BLO_write_string(), BLO_write_struct, BLO_write_struct_array, BLO_write_struct_list, LISTBASE_FOREACH, mask(), and node.
Referenced by write_layer_tree_group().
|
static |
Definition at line 4604 of file grease_pencil.cc.
References GreasePencil::root_group_ptr, and write_layer_tree_group().
|
static |
Definition at line 4584 of file grease_pencil.cc.
References BLO_write_string(), BLO_write_struct, GP_LAYER_TREE_GROUP, GP_LAYER_TREE_LEAF, LISTBASE_FOREACH, node, write_layer(), and write_layer_tree_group().
Referenced by write_layer_tree(), and write_layer_tree_group().
|
static |
Definition at line 90 of file grease_pencil.cc.
| void(* BKE_grease_pencil_batch_cache_dirty_tag_cb) (GreasePencil *grease_pencil, int mode) | ( | GreasePencil * | grease_pencil, |
| int | mode ) = nullptr |
Definition at line 2912 of file grease_pencil.cc.
Referenced by BKE_grease_pencil_batch_cache_dirty_tag(), and DRW_module_init().
| void(* BKE_grease_pencil_batch_cache_free_cb) (GreasePencil *grease_pencil) | ( | GreasePencil * | grease_pencil | ) | = nullptr |
Definition at line 2914 of file grease_pencil.cc.
Referenced by BKE_grease_pencil_batch_cache_free(), and DRW_module_init().
| IDTypeInfo IDType_ID_GP |
Definition at line 412 of file grease_pencil.cc.
|
static |
Definition at line 83 of file grease_pencil.cc.
Referenced by grease_pencil_replace_end_frames_after_read().