53 return this->placement.
project(screen_co);
63 this->vc.v3d->overlay.handle_display,
74 this->vc.v3d->overlay.handle_display,
112 aspect_ratios.
span.last() = 1.0f;
119 u_scales.
span.last() = 1.0f;
125 if (!this->grease_pencil->has_active_layer()) {
131 if (!layer.is_editable()) {
136 const int material_index = this->
vc.obact->actcol - 1;
139 if (material !=
nullptr && material->
gp_style !=
nullptr &&
148 bool inserted_keyframe =
false;
150 *this->
vc.scene, *this->grease_pencil, layer,
false, inserted_keyframe))
192 if (
placement.use_project_to_surface()) {
195 else if (
placement.use_project_to_stroke()) {
199 bool inserted_keyframe =
false;
202 const bool use_duplicate_previous_key =
true;
204 if (layer->is_editable()) {
208 use_duplicate_previous_key,
214 if (inserted_keyframe) {
221 for (
const int drawing_index : this->drawings.
index_range()) {
231 if (active_layer !=
nullptr) {
233 this->grease_pencil->get_editable_drawing_at(*active_layer, this->
vc.scene->r.cfra);
235 for (
const int drawing_index : this->drawings.
index_range()) {
238 if (active_drawing == &info.
drawing) {
297 ot->name =
"Grease Pencil Pen";
298 ot->idname =
"GREASE_PENCIL_OT_pen";
299 ot->description =
"Construct and edit splines";
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
Low-level operations for curves.
Low-level operations for curves.
Low-level operations for grease pencil.
General operations, lookup, etc. for materials.
Material * BKE_object_material_get(Object *ob, short act)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void DEG_id_tag_update(ID *id, unsigned int flags)
void ED_workspace_status_text(bContext *C, const char *str)
void ED_region_tag_redraw(ARegion *region)
constexpr T & last(const int64_t n=0) const
static VArray from_single(T value, const int64_t size)
IndexRange index_range() const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
MutableSpan< float > opacities_for_write()
bke::CurvesGeometry & strokes_for_write()
void tag_topology_changed()
float4x4 to_world_space(const Object &object) const
float4x4 local_transform() const
float3 project(float2 co, bool &clipped) const
void ED_operatortypes_grease_pencil_pen()
void ED_grease_pencil_pentool_modal_keymap(wmKeyConfig *keyconf)
IndexMask retrieve_visible_bezier_handle_points(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const int handle_display, IndexMaskMemory &memory)
bool ensure_active_keyframe(const Scene &scene, GreasePencil &grease_pencil, bke::greasepencil::Layer &layer, const bool duplicate_previous_key, bool &r_inserted_keyframe)
IndexMask retrieve_editable_and_all_selected_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, int handle_display, IndexMaskMemory &memory)
static void grease_pencil_pen_exit(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_pen(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_pen_modal(bContext *C, wmOperator *op, const wmEvent *event)
IndexMask retrieve_editable_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
Vector< MutableDrawingInfo > retrieve_editable_drawings(const Scene &scene, GreasePencil &grease_pencil)
static wmOperatorStatus grease_pencil_pen_invoke(bContext *C, wmOperator *op, const wmEvent *event)
VecBase< float, 2 > float2
VecBase< float, 3 > float3
struct MaterialGPencilStyle * gp_style
MutableVArraySpan< T > span
bke::greasepencil::Drawing & drawing
struct ReportList * reports
void WM_cursor_modal_restore(wmWindow *win)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))