Blender V4.3
grease_pencil_edit.cc File Reference
#include "BLI_array_utils.hh"
#include "BLI_assert.h"
#include "BLI_index_mask.hh"
#include "BLI_index_range.hh"
#include "BLI_math_base.hh"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_matrix.hh"
#include "BLI_math_vector.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_offset_indices.hh"
#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DNA_anim_types.h"
#include "DNA_array_utils.hh"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "DNA_windowmanager_types.h"
#include "BKE_anim_data.hh"
#include "BKE_animsys.h"
#include "BKE_attribute.hh"
#include "BKE_context.hh"
#include "BKE_curves_utils.hh"
#include "BKE_customdata.hh"
#include "BKE_deform.hh"
#include "BKE_fcurve_driver.h"
#include "BKE_grease_pencil.hh"
#include "BKE_instances.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_preview_image.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "ED_curves.hh"
#include "ED_grease_pencil.hh"
#include "ED_object.hh"
#include "ED_transform_snap_object_context.hh"
#include "ED_view3d.hh"
#include "GEO_join_geometries.hh"
#include "GEO_realize_instances.hh"
#include "GEO_reorder.hh"
#include "GEO_set_curve_type.hh"
#include "GEO_smooth_curves.hh"
#include "GEO_subdivide_curves.hh"
#include "UI_interface_c.hh"
#include "UI_resources.hh"
#include <limits>

Go to the source code of this file.

Classes

struct  blender::ed::greasepencil::Clipboard
 

Namespaces

namespace  blender
 
namespace  blender::ed
 
namespace  blender::ed::greasepencil
 

Functions

void blender::ed::greasepencil::clipboard_free ()
 
const bke::CurvesGeometryblender::ed::greasepencil::clipboard_curves ()
 
static Array< intblender::ed::greasepencil::clipboard_materials_remap (Main &bmain, Object &object)
 
IndexRange blender::ed::greasepencil::clipboard_paste_strokes (Main &bmain, Object &object, bke::greasepencil::Drawing &drawing, const float4x4 &transform, const bool keep_world_transform, const bool paste_back)
 
void ED_operatortypes_grease_pencil_edit ()
 
static bke::greasepencil::Layerblender::ed::greasepencil::copy_layer (GreasePencil &grease_pencil_dst, bke::greasepencil::LayerGroup &group_dst, const bke::greasepencil::Layer &layer_src)
 
static bke::greasepencil::LayerGroupblender::ed::greasepencil::copy_layer_group_recursive (GreasePencil &grease_pencil_dst, bke::greasepencil::LayerGroup &parent_dst, const bke::greasepencil::LayerGroup &group_src, Map< StringRefNull, StringRefNull > &layer_name_map)
 
static void blender::ed::greasepencil::copy_layer_group_content (GreasePencil &grease_pencil_dst, bke::greasepencil::LayerGroup &group_dst, const bke::greasepencil::LayerGroup &group_src, Map< StringRefNull, StringRefNull > &layer_name_map)
 
static Array< intblender::ed::greasepencil::add_materials_to_map (const GreasePencil &grease_pencil, VectorSet< Material * > &materials)
 
static void blender::ed::greasepencil::remap_material_indices (bke::greasepencil::Drawing &drawing, const Span< int > material_index_map)
 
static Map< StringRefNull, StringRefNullblender::ed::greasepencil::add_vertex_groups (Object &object, GreasePencil &grease_pencil, const ListBase &vertex_group_names)
 
static void blender::ed::greasepencil::remap_vertex_groups (bke::greasepencil::Drawing &drawing, const Map< StringRefNull, StringRefNull > &vertex_group_map)
 
static void blender::ed::greasepencil::join_object_with_active (Main &bmain, Object &ob_src, Object &ob_dst, VectorSet< Material * > &materials)
 
Smooth Stroke Operator
static int blender::ed::greasepencil::grease_pencil_stroke_smooth_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_stroke_smooth (wmOperatorType *ot)
 
Simplify Stroke Operator
static float blender::ed::greasepencil::dist_to_interpolated (float3 pos, float3 posA, float3 posB, float val, float valA, float valB)
 
static int64_t blender::ed::greasepencil::stroke_simplify (const IndexRange points, const bool cyclic, const float epsilon, const FunctionRef< float(int64_t, int64_t, int64_t)> dist_function, MutableSpan< bool > points_to_delete)
 
static int blender::ed::greasepencil::grease_pencil_stroke_simplify_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_stroke_simplify (wmOperatorType *ot)
 
Delete Operator
static bke::CurvesGeometry blender::ed::greasepencil::remove_points_and_split (const bke::CurvesGeometry &curves, const IndexMask &mask)
 
static int blender::ed::greasepencil::grease_pencil_delete_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_delete (wmOperatorType *ot)
 
Stroke Material Set Operator
static int blender::ed::greasepencil::grease_pencil_stroke_material_set_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_stroke_material_set (wmOperatorType *ot)
 
Set Active Material Operator
static int blender::ed::greasepencil::grease_pencil_set_active_material_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_set_active_material (wmOperatorType *ot)
 
static const EnumPropertyItemblender::ed::greasepencil::material_enum_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
 
static int blender::ed::greasepencil::grease_pencil_set_material_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_set_material (wmOperatorType *ot)
 
Set Uniform Thickness Operator
static int blender::ed::greasepencil::grease_pencil_set_uniform_thickness_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_set_uniform_thickness (wmOperatorType *ot)
 
Set Uniform Opacity Operator
static int blender::ed::greasepencil::grease_pencil_set_uniform_opacity_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_set_uniform_opacity (wmOperatorType *ot)
 
Switch Direction Operator
static int blender::ed::greasepencil::grease_pencil_stroke_switch_direction_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_stroke_switch_direction (wmOperatorType *ot)
 
Duplicate Operator
static int blender::ed::greasepencil::grease_pencil_duplicate_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_duplicate (wmOperatorType *ot)
 
static int blender::ed::greasepencil::grease_pencil_clean_loose_exec (bContext *C, wmOperator *op)
 
static int blender::ed::greasepencil::grease_pencil_clean_loose_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_clean_loose (wmOperatorType *ot)
 
Stroke Subdivide Operator
static int blender::ed::greasepencil::gpencil_stroke_subdivide_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_stroke_subdivide (wmOperatorType *ot)
 
Move To Layer Operator
static int blender::ed::greasepencil::grease_pencil_move_to_layer_exec (bContext *C, wmOperator *op)
 
static int blender::ed::greasepencil::grease_pencil_move_to_layer_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_move_to_layer (wmOperatorType *ot)
 
Merge Stroke Operator
static int blender::ed::greasepencil::grease_pencil_stroke_merge_by_distance_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_stroke_merge_by_distance (wmOperatorType *ot)
 
Extrude Operator
static bke::CurvesGeometry blender::ed::greasepencil::extrude_grease_pencil_curves (const bke::CurvesGeometry &src, const IndexMask &points_to_extrude)
 
static int blender::ed::greasepencil::grease_pencil_extrude_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_extrude (wmOperatorType *ot)
 
Reproject Strokes Operator
static int blender::ed::greasepencil::grease_pencil_reproject_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::grease_pencil_reproject_ui (bContext *, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_reproject (wmOperatorType *ot)
 
Snapping Selection to Grid Operator
static bool blender::ed::greasepencil::grease_pencil_snap_poll (bContext *C)
 
static int blender::ed::greasepencil::grease_pencil_snap_to_grid_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_snap_to_grid (wmOperatorType *ot)
 
Snapping Selection to Cursor Operator
static int blender::ed::greasepencil::grease_pencil_snap_to_cursor_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_snap_to_cursor (wmOperatorType *ot)
 
Snapping Cursor to Selection Operator
static bool blender::ed::greasepencil::grease_pencil_snap_compute_centroid (const Scene &scene, const Object &object, const GreasePencil &grease_pencil, float3 &r_centroid, float3 &r_min, float3 &r_max)
 
static int blender::ed::greasepencil::grease_pencil_snap_cursor_to_sel_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_snap_cursor_to_selected (wmOperatorType *ot)
 
static float4x3 blender::ed::greasepencil::expand_4x2_mat (float4x2 strokemat)
 
static int blender::ed::greasepencil::grease_pencil_texture_gradient_exec (bContext *C, wmOperator *op)
 
static int blender::ed::greasepencil::grease_pencil_texture_gradient_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int blender::ed::greasepencil::grease_pencil_texture_gradient_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_texture_gradient (wmOperatorType *ot)
 
Set Curve Type Operator
static int blender::ed::greasepencil::grease_pencil_set_curve_type_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_set_curve_type (wmOperatorType *ot)
 
Set Handle Type Operator
static int blender::ed::greasepencil::grease_pencil_set_handle_type_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_set_handle_type (wmOperatorType *ot)
 
Set Curve Resolution Operator
static int blender::ed::greasepencil::grease_pencil_set_curve_resolution_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_set_curve_resolution (wmOperatorType *ot)
 
static int blender::ed::greasepencil::grease_pencil_reset_uvs_exec (bContext *C, wmOperator *)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_reset_uvs (wmOperatorType *ot)
 
Join Objects Operator
int ED_grease_pencil_join_objects_exec (bContext *C, wmOperator *op)
 

Dissolve Points Operator

enum class  blender::ed::greasepencil::DissolveMode : int8_t { blender::ed::greasepencil::POINTS = 0 , blender::ed::greasepencil::BETWEEN = 1 , blender::ed::greasepencil::UNSELECT = 2 }
 
static const EnumPropertyItem blender::ed::greasepencil::prop_dissolve_types []
 
static Array< bool > blender::ed::greasepencil::get_points_to_dissolve (bke::CurvesGeometry &curves, const IndexMask &mask, const DissolveMode mode)
 
static int blender::ed::greasepencil::grease_pencil_dissolve_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_dissolve (wmOperatorType *ot)
 

Delete Frame Operator

enum class  blender::ed::greasepencil::DeleteFrameMode : int8_t { blender::ed::greasepencil::ACTIVE_FRAME = 0 , blender::ed::greasepencil::ALL_FRAMES = 1 }
 
static const EnumPropertyItem blender::ed::greasepencil::prop_greasepencil_deleteframe_types []
 
static int blender::ed::greasepencil::grease_pencil_delete_frame_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_delete_frame (wmOperatorType *ot)
 

Cyclical Set Operator

enum class  blender::ed::greasepencil::CyclicalMode : int8_t { blender::ed::greasepencil::CLOSE = 0 , blender::ed::greasepencil::OPEN = 1 , blender::ed::greasepencil::TOGGLE = 2 }
 
static const EnumPropertyItem blender::ed::greasepencil::prop_cyclical_types []
 
static int blender::ed::greasepencil::grease_pencil_cyclical_set_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_cyclical_set (wmOperatorType *ot)
 

Set Curve Caps Operator

enum class  blender::ed::greasepencil::CapsMode : int8_t { blender::ed::greasepencil::FLAT = 0 , blender::ed::greasepencil::START = 1 , blender::ed::greasepencil::END = 2 , blender::ed::greasepencil::ROUND = 3 }
 
static void blender::ed::greasepencil::toggle_caps (MutableSpan< int8_t > caps, const IndexMask &strokes)
 
static int blender::ed::greasepencil::grease_pencil_caps_set_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_caps_set (wmOperatorType *ot)
 

Reorder Operator

enum class  blender::ed::greasepencil::ReorderDirection : int8_t { blender::ed::greasepencil::TOP = 0 , blender::ed::greasepencil::UP = 1 , blender::ed::greasepencil::DOWN = 2 , blender::ed::greasepencil::BOTTOM = 3 }
 
static Array< intblender::ed::greasepencil::get_reordered_indices (const IndexRange universe, const IndexMask &selected, const ReorderDirection direction)
 
static int blender::ed::greasepencil::grease_pencil_stroke_reorder_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_stroke_reorder (wmOperatorType *ot)
 

Stroke Separate Operator

enum class  blender::ed::greasepencil::SeparateMode : int8_t { blender::ed::greasepencil::SELECTED = 0 , blender::ed::greasepencil::MATERIAL = 1 , blender::ed::greasepencil::LAYER = 2 }
 
static const EnumPropertyItem blender::ed::greasepencil::prop_separate_modes []
 
static void blender::ed::greasepencil::remove_unused_materials (Main *bmain, Object *object)
 
static Objectblender::ed::greasepencil::duplicate_grease_pencil_object (Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_prev, const GreasePencil &grease_pencil_src)
 
static bke::greasepencil::Layerblender::ed::greasepencil::find_or_create_layer_in_dst_by_name (const int layer_index, const GreasePencil &grease_pencil_src, GreasePencil &grease_pencil_dst)
 
static bool blender::ed::greasepencil::grease_pencil_separate_selected (bContext &C, Main &bmain, Scene &scene, ViewLayer &view_layer, Base &base_prev, Object &object_src)
 
static bool blender::ed::greasepencil::grease_pencil_separate_layer (bContext &C, Main &bmain, Scene &scene, ViewLayer &view_layer, Base &base_prev, Object &object_src)
 
static bool blender::ed::greasepencil::grease_pencil_separate_material (bContext &C, Main &bmain, Scene &scene, ViewLayer &view_layer, Base &base_prev, Object &object_src)
 
static int blender::ed::greasepencil::grease_pencil_separate_exec (bContext *C, wmOperator *op)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_separate (wmOperatorType *ot)
 

Copy and Paste Operator

static struct blender::ed::greasepencil::Clipboardblender::ed::greasepencil::grease_pencil_clipboard = nullptr
 
std::mutex blender::ed::greasepencil::grease_pencil_clipboard_lock
 
static Clipboardblender::ed::greasepencil::ensure_grease_pencil_clipboard ()
 
static int blender::ed::greasepencil::grease_pencil_paste_strokes_exec (bContext *C, wmOperator *op)
 
static bke::GeometrySet blender::ed::greasepencil::join_geometries_with_transform (Span< bke::GeometrySet > geometries, Span< float4x4 > transforms)
 
static int blender::ed::greasepencil::grease_pencil_copy_strokes_exec (bContext *C, wmOperator *op)
 
static bool blender::ed::greasepencil::grease_pencil_paste_strokes_poll (bContext *C)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_paste (wmOperatorType *ot)
 
static void blender::ed::greasepencil::GREASE_PENCIL_OT_copy (wmOperatorType *ot)
 

Function Documentation

◆ ED_grease_pencil_join_objects_exec()

◆ ED_operatortypes_grease_pencil_edit()

void ED_operatortypes_grease_pencil_edit ( )