|
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.
Classes | |
| class | VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > |
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::greasepencil |
Typedefs | |
| using | float3 |
| using | int3 |
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) |
| using blender::float3 |
Definition at line 619 of file BLI_math_vector_types.hh.
| using blender::int3 |
Definition at line 602 of file BLI_math_vector_types.hh.
| GreasePencil * BKE_grease_pencil_add | ( | Main * | bmain, |
| const char * | name ) |
Definition at line 2112 of file grease_pencil.cc.
References BKE_grease_pencil_add(), and BKE_id_new().
Referenced by BKE_grease_pencil_add(), 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(), BKE_grease_pencil_batch_cache_dirty_tag_cb, and GreasePencil::runtime.
Referenced by BKE_grease_pencil_batch_cache_dirty_tag(), and 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(), BKE_grease_pencil_batch_cache_free_cb, and GreasePencil::runtime.
Referenced by BKE_grease_pencil_batch_cache_free(), and 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_grease_pencil_copy_for_eval(), BKE_id_copy_ex(), GreasePencil::id, LIB_ID_COPY_LOCALIZE, and GreasePencil::runtime.
Referenced by BKE_grease_pencil_copy_for_eval(), 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(), BKE_grease_pencil_copy_layer_group_parameters(), GreasePencilLayerTreeNode::color, GreasePencilLayerTreeGroup::color_tag, copy_v3_v3(), and GreasePencilLayerTreeNode::flag.
Referenced by BKE_grease_pencil_copy_layer_group_parameters(), 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(), BKE_grease_pencil_copy_layer_parameters(), 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 BKE_grease_pencil_copy_layer_parameters(), 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, BKE_grease_pencil_copy_parameters(), 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 BKE_grease_pencil_copy_parameters(), 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 BKE_grease_pencil_drawing_attribute_required().
Referenced by BKE_attribute_required(), and BKE_grease_pencil_drawing_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 BKE_grease_pencil_duplicate_drawing_array(), blender::bke::greasepencil::copy_drawing_array(), GreasePencil::drawing_array, GreasePencil::drawing_array_num, and MEM_calloc_arrayN().
Referenced by BKE_grease_pencil_duplicate_drawing_array(), and 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 BKE_grease_pencil_eval_geometry(), DEG_get_ctime(), grease_pencil_evaluate_layers(), and GreasePencil::runtime.
Referenced by BKE_grease_pencil_eval_geometry(), and 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 BKE_grease_pencil_has_curve_with_type(), GP_DRAWING, blender::bke::greasepencil::Drawing::strokes(), and wrap().
Referenced by BKE_grease_pencil_has_curve_with_type(), and 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(), BKE_grease_pencil_material_index_remove(), BLI_assert, blender::bke::Curve, blender::bke::SpanAttributeWriter< T >::domain, blender::bke::SpanAttributeWriter< T >::finish(), GP_DRAWING, i, blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::bke::SpanAttributeWriter< T >::span, blender::bke::greasepencil::Drawing::strokes_for_write(), and wrap().
Referenced by BKE_grease_pencil_material_index_remove(), and 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(), BKE_grease_pencil_material_index_used(), blender::Span< T >::contains(), blender::bke::Curve, GP_DRAWING, blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::greasepencil::Drawing::strokes(), and wrap().
Referenced by BKE_grease_pencil_material_index_used(), and 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(), BKE_grease_pencil_material_remap(), BLI_assert, blender::bke::Curve, blender::bke::SpanAttributeWriter< T >::domain, blender::bke::SpanAttributeWriter< T >::finish(), GP_DRAWING, i, 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_grease_pencil_material_remap(), and BKE_object_material_remap().
| GreasePencil * BKE_grease_pencil_new_nomain | ( | ) |
Definition at line 2119 of file grease_pencil.cc.
References BKE_grease_pencil_new_nomain(), and BKE_id_new_nomain().
Referenced by BKE_grease_pencil_new_nomain(), 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_grease_pencil_nomain_to_grease_pencil(), 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, i, GreasePencil::id, ID_RECALC_GEOMETRY, blender::IndexRange::IndexRange(), GreasePencil::layers_data, GreasePencil::root_group_ptr, GreasePencilDrawingBase::type, and wrap().
Referenced by BKE_grease_pencil_nomain_to_grease_pencil(), 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_alt_ensure_from_brush(), BKE_grease_pencil_object_material_ensure_from_brush(), BKE_object_material_slot_find_index(), and Material::id.
Referenced by BKE_grease_pencil_object_material_alt_ensure_from_brush(), and 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_ensure_by_name(), BKE_grease_pencil_object_material_index_get_by_name(), BKE_grease_pencil_object_material_new(), and BKE_object_material_get().
Referenced by blender::ed::greasepencil::add_material_from_template(), BKE_grease_pencil_object_material_ensure_by_name(), 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_grease_pencil_object_material_ensure_from_brush(), BKE_material_default_gpencil(), BKE_object_material_get(), GP_BRUSH_MATERIAL_PINNED, and grease_pencil_object_material_ensure_from_brush_pinned().
Referenced by BKE_grease_pencil_object_material_alt_ensure_from_brush(), BKE_grease_pencil_object_material_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_grease_pencil_object_material_from_brush_get(), BKE_object_material_get(), and GP_BRUSH_MATERIAL_PINNED.
Referenced by BKE_grease_pencil_object_material_from_brush_get(), and 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_grease_pencil_object_material_index_get_by_name(), BKE_object_material_get(), BKE_object_material_len_p(), i, Material::id, ID::name, and STREQ.
Referenced by BKE_grease_pencil_object_material_ensure_by_name(), BKE_grease_pencil_object_material_index_get_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_grease_pencil_object_material_new(), BKE_MAT_ASSIGN_USERPREF, BKE_object_material_assign(), BKE_object_material_slot_add(), Material::id, id_us_min(), and Object::totcol.
Referenced by blender::ed::object::add_grease_pencil_materials_for_conversion(), BKE_grease_pencil_object_material_ensure_by_name(), BKE_grease_pencil_object_material_new(), 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 BKE_grease_pencil_point_coords_apply(), CURVE_TYPE_BEZIER, GreasePencilFrame::drawing_index, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::foreach_item(), blender::bke::greasepencil::Layer::frames(), GP_DRAWING, i, blender::math::invert(), blender::bke::greasepencil::Layer::local_transform(), blender::bke::greasepencil::Drawing::radii_for_write(), blender::bke::greasepencil::Drawing::strokes_for_write(), blender::bke::greasepencil::Drawing::tag_positions_changed(), blender::math::transform_point(), GreasePencilDrawingBase::type, and wrap().
Referenced by BKE_grease_pencil_point_coords_apply(), and 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 BKE_grease_pencil_point_coords_apply_with_mat4(), CURVE_TYPE_BEZIER, GreasePencilFrame::drawing_index, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::foreach_item(), blender::bke::greasepencil::Layer::frames(), GP_DRAWING, i, blender::math::invert(), blender::bke::greasepencil::Layer::local_transform(), mat4_to_scale(), 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::math::transform_point(), GreasePencilDrawingBase::type, and wrap().
Referenced by BKE_grease_pencil_point_coords_apply_with_mat4(), and 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 BKE_grease_pencil_point_coords_get(), CURVE_TYPE_BEZIER, GreasePencilFrame::drawing_index, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::foreach_item(), blender::bke::greasepencil::Layer::frames(), GP_DRAWING, i, blender::bke::greasepencil::Layer::local_transform(), blender::bke::greasepencil::Drawing::radii(), blender::bke::greasepencil::Drawing::strokes(), blender::math::transform_point(), GreasePencilDrawingBase::type, and wrap().
Referenced by BKE_grease_pencil_point_coords_get(), and 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 BKE_grease_pencil_references_cyclic_check(), and grease_pencil_references_cyclic_check_internal().
Referenced by BKE_grease_pencil_references_cyclic_check().
| int BKE_grease_pencil_stroke_point_count | ( | const GreasePencil & | grease_pencil | ) |
Definition at line 2500 of file grease_pencil.cc.
References BKE_grease_pencil_stroke_point_count(), GreasePencilFrame::drawing_index, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::foreach_item(), blender::bke::greasepencil::Layer::frames(), GP_DRAWING, blender::bke::greasepencil::Drawing::strokes(), GreasePencilDrawingBase::type, and wrap().
Referenced by BKE_grease_pencil_stroke_point_count(), and 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 BKE_grease_pencil_vgroup_name_update(), Object::data, LISTBASE_FOREACH, STREQ, STRNCPY(), Drawing::strokes_for_write(), and wrap().
Referenced by BKE_grease_pencil_vgroup_name_update(), 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_eval_grease_pencil(), BKE_object_free_derived_caches(), blender::bke::AttributeAccessor::contains(), data, DEG_get_ctime(), DEG_get_original(), ELEM, GeometrySet::from_grease_pencil(), GeometrySet::GeometrySet(), GeometrySet::get_component_for_write(), GeometrySet::get_grease_pencil(), GeometrySet::get_grease_pencil_for_write(), grease_pencil_do_layer_adjustments(), blender::bke::GeometryComponentEditData::grease_pencil_edit_hints_, grease_pencil_evaluate_modifiers(), GeometrySet::has_grease_pencil(), GreasePencil::id, OB_MODE_EDIT, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_VERTEX_GREASE_PENCIL, OB_MODE_WEIGHT_GREASE_PENCIL, blender::bke::ReadOnly, GeometrySet::replace_grease_pencil(), and GreasePencil::runtime.
Referenced by BKE_object_eval_grease_pencil(), and BKE_object_handle_data_update().
|
static |
Definition at line 2981 of file grease_pencil.cc.
References delete_drawing(), ELEM, GP_DRAWING, GP_DRAWING_REFERENCE, and GreasePencilDrawingBase::type.
Referenced by delete_drawing().
|
static |
Definition at line 4392 of file grease_pencil.cc.
References drawing_struct_size(), GP_DRAWING, and GP_DRAWING_REFERENCE.
Referenced by drawing_struct_size().
|
static |
Definition at line 4470 of file grease_pencil.cc.
References free_drawing_array().
Referenced by BKE_grease_pencil_nomain_to_grease_pencil(), free_drawing_array(), 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(), get_node_names(), and GreasePencilLayerTreeNode::name.
Referenced by get_node_names(), and 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(), grease_pencil_blend_read_data(), 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.
Referenced by grease_pencil_blend_read_data().
|
static |
Definition at line 325 of file grease_pencil.cc.
References GreasePencil::attribute_storage, blender::bke::attribute_storage_blend_write_prepare(), and grease_pencil_blend_write().
Referenced by grease_pencil_blend_write().
|
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_copy_data(), grease_pencil_set_runtime_visibilities(), GreasePencil::layers_data, GreasePencil::material_array, MEM_dupallocN(), GreasePencil::root_group_ptr, GreasePencil::runtime, and GreasePencil::vertex_group_names.
Referenced by grease_pencil_copy_data().
|
static |
Definition at line 2306 of file grease_pencil.cc.
References Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::AttributeAccessor::contains(), grease_pencil_do_layer_adjustments(), MutableSpan< T >::index_range(), blender::bke::Layer, blender::bke::AttributeAccessor::lookup_or_default(), blender::threading::parallel_for(), and blender::threading::parallel_for_each().
Referenced by BKE_object_eval_grease_pencil(), and grease_pencil_do_layer_adjustments().
|
static |
Definition at line 2375 of file grease_pencil.cc.
References grease_pencil_evaluate_layers(), Array< T, InlineBufferCapacity, Allocator >::index_range(), and GreasePencilLayer::runtime.
Referenced by BKE_grease_pencil_eval_geometry(), and grease_pencil_evaluate_layers().
|
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(), eModifierMode_Editmode, eModifierMode_Realtime, eModifierMode_Render, eModifierType_GreasePencilTime, grease_pencil_evaluate_modifiers(), MOD_APPLY_RENDER, MOD_APPLY_USECACHE, ModifierTypeInfo::modify_geometry_set, ModifierData::next, and ModifierData::type.
Referenced by BKE_object_eval_grease_pencil(), and grease_pencil_evaluate_modifiers().
|
static |
Definition at line 305 of file grease_pencil.cc.
References BKE_LIB_FOREACHID_PROCESS_IDSUPER, data, GP_DRAWING_REFERENCE, grease_pencil_foreach_id(), i, GreasePencilDrawingReference::id_reference, IDWALK_CB_USER, GreasePencil::material_array, and GreasePencil::material_array_num.
Referenced by grease_pencil_foreach_id().
|
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(), grease_pencil_free_data(), GreasePencil::id, GreasePencil::layers_data, GreasePencil::material_array, MEM_SAFE_FREE, GreasePencil::runtime, and GreasePencil::vertex_group_names.
Referenced by grease_pencil_free_data().
|
static |
Definition at line 102 of file grease_pencil.cc.
References GreasePencil::attribute_storage, BLI_assert, CustomData_reset(), DNA_struct_default_get, grease_pencil_init_data(), GreasePencil::layers_data, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, GreasePencil::root_group_ptr, and GreasePencil::runtime.
Referenced by grease_pencil_init_data().
|
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(), grease_pencil_object_material_ensure_from_brush_pinned(), Material::id, and Object::totcol.
Referenced by BKE_grease_pencil_object_material_ensure_from_brush(), and grease_pencil_object_material_ensure_from_brush_pinned().
|
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, GP_FRAME_IMPLICIT_HOLD, grease_pencil_replace_end_frames_after_read(), GreasePencil::id, and LOG.
Referenced by grease_pencil_blend_read_data(), and grease_pencil_replace_end_frames_after_read().
|
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(), grease_pencil_set_runtime_visibilities(), blender::bke::greasepencil::TreeNode::parent_group(), blender::bke::animdata::prop_is_animated(), RNA_path_from_ID_to_property(), RNA_pointer_create_discrete(), and RNA_struct_type_find_property().
Referenced by grease_pencil_copy_data(), and grease_pencil_set_runtime_visibilities().
|
static |
Definition at line 211 of file grease_pencil.cc.
References ELEM, GP_DRAWING, GP_DRAWING_REFERENCE, and grease_pencil_validate_drawing_data().
Referenced by grease_pencil_blend_read_data(), and grease_pencil_validate_drawing_data().
Definition at line 2936 of file grease_pencil.cc.
References BLI_assert, grow_array(), MEM_calloc_arrayN(), MEM_freeN(), num, T, and blender::uninitialized_relocate_n().
Referenced by grow_array().
|
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, influence_data_from_modifier(), and ModifierData::type.
Referenced by influence_data_from_modifier().
|
static |
Definition at line 4508 of file grease_pencil.cc.
References GP_LAYER_TREE_GROUP, GP_LAYER_TREE_LEAF, and layer_tree_node_struct_size().
Referenced by layer_tree_node_struct_size().
|
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, i, read_drawing_array(), GreasePencilDrawing::runtime, and GreasePencilDrawingBase::type.
Referenced by grease_pencil_blend_read_data(), and read_drawing_array().
|
static |
Definition at line 4481 of file grease_pencil.cc.
References GreasePencilLayer::base, BLO_read_int32_array(), BLO_read_string(), BLO_read_struct_array, BLO_read_struct_list, GreasePencilLayer::frames_storage, GreasePencilLayerFramesMapStorage::keys, LISTBASE_FOREACH, mask(), GreasePencilLayer::masks, GreasePencilLayerTreeNode::name, GreasePencilLayerFramesMapStorage::num, GreasePencilLayerTreeNode::parent, GreasePencilLayer::parsubstr, read_layer(), GreasePencilLayer::runtime, GreasePencilLayerFramesMapStorage::values, and GreasePencilLayer::viewlayername.
Referenced by read_layer(), and read_layer_tree_group().
|
static |
Definition at line 4548 of file grease_pencil.cc.
References GreasePencil::active_node, BLO_read_struct, read_layer_tree(), read_layer_tree_group(), and GreasePencil::root_group_ptr.
Referenced by grease_pencil_blend_read_data(), and read_layer_tree().
|
static |
Definition at line 4519 of file grease_pencil.cc.
References GreasePencilLayerTreeGroup::base, BLO_read_string(), BLO_read_struct_list_with_type_size(), GreasePencilLayerTreeGroup::children, GP_LAYER_TREE_GROUP, GP_LAYER_TREE_LEAF, LISTBASE_FOREACH, GreasePencilLayerTreeNode::name, GreasePencilLayerTreeNode::parent, read_layer(), read_layer_tree_group(), GreasePencilLayerTreeGroup::runtime, 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(), reorder_customdata(), and blender::Span< T >::size().
Referenced by reorder_customdata(), and reorder_layer_data().
|
static |
Definition at line 3938 of file grease_pencil.cc.
References Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BLI_assert, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), i, blender::Span< T >::index_range(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), GreasePencil::layers_data, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop(), reorder_customdata(), reorder_layer_data(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::Span< T >::size(), and Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size().
Referenced by reorder_layer_data().
Definition at line 2950 of file grease_pencil.cc.
References BLI_assert, MEM_calloc_arrayN(), MEM_freeN(), num, shrink_array(), T, and blender::uninitialized_move_n().
Referenced by shrink_array().
|
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, IndexRange::is_empty(), shrink_customdata(), IndexRange::size(), and IndexRange::start().
Referenced by shrink_customdata().
|
static |
Definition at line 3529 of file grease_pencil.cc.
References BLI_assert, blender::Span< T >::index_range(), blender::threading::parallel_for(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), transform(), and transform_positions().
Referenced by transform_positions().
|
static |
Definition at line 3814 of file grease_pencil.cc.
References DATA_, blender::StringRefBase::is_empty(), unique_layer_group_name(), and unique_node_name().
Referenced by unique_layer_group_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 unique_node_name().
Referenced by unique_layer_group_name(), and unique_node_name().
|
static |
Definition at line 4274 of file grease_pencil.cc.
References GreasePencilLayerTreeNode::next, GreasePencilLayerTreeNode::parent, GreasePencilLayerTreeNode::prev, GreasePencil::root_group_ptr, and update_active_node_from_node_to_remove().
Referenced by update_active_node_from_node_to_remove().
|
static |
Definition at line 4438 of file grease_pencil.cc.
References 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, i, GreasePencil::id, GreasePencilDrawing::runtime, GreasePencilDrawingBase::type, and write_drawing_array().
Referenced by write_drawing_array().
|
static |
Definition at line 4567 of file grease_pencil.cc.
References GreasePencilLayer::base, BLO_write_int32_array(), BLO_write_string(), BLO_write_struct, BLO_write_struct_array, BLO_write_struct_list, GreasePencilLayer::frames_storage, GreasePencilLayerFramesMapStorage::keys, LISTBASE_FOREACH, mask(), GreasePencilLayer::masks, GreasePencilLayerTreeNode::name, GreasePencilLayerFramesMapStorage::num, GreasePencilLayer::parsubstr, GreasePencilLayerFramesMapStorage::values, GreasePencilLayer::viewlayername, and write_layer().
Referenced by write_layer(), and write_layer_tree_group().
|
static |
Definition at line 4604 of file grease_pencil.cc.
References GreasePencil::root_group_ptr, write_layer_tree(), and write_layer_tree_group().
Referenced by write_layer_tree().
|
static |
Definition at line 4584 of file grease_pencil.cc.
References GreasePencilLayerTreeGroup::base, BLO_write_string(), BLO_write_struct, GreasePencilLayerTreeGroup::children, GP_LAYER_TREE_GROUP, GP_LAYER_TREE_LEAF, LISTBASE_FOREACH, GreasePencilLayerTreeNode::name, 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.
Referenced by BKE_grease_pencil_drawing_attribute_required().
| 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.