47 "Distribute vertices along the full stroke, retaining relative distances between the "
53 "Distribute vertices at regular distances along the full stroke "},
58 "Project vertices onto the stroke using vertex normals and connected edges. "
59 "Requires more exact annotation placement, otherwise it may do nothing"},
76 bool changed_multi =
false;
83 for (
Object *obedit : objects) {
89 if (gps->totpoints < 2) {
100 float4x4 mat = obedit_eval->world_to_object();
102 for (
const int i :
IndexRange(gps->totpoints)) {
105 mat,
float3(stroke_point->
x, stroke_point->
y, stroke_point->
z));
109 all_points.
append(std::move(points));
116 stroke_data.
append(points);
121 "fit_edge_loops_to_annotation geom=%he factor=%f method=%i strokes=%p lock_x=%b "
122 "lock_y=%b lock_z=%b",
134 changed_multi =
true;
138 EDBM_update(id_cast<Mesh *>(obedit->data), ¶ms);
141 if (changed_multi && delete_strokes && gpf) {
142 bool deleted =
false;
145 gps_next = gps->
next;
179 ot->
name =
"Fit Edge Loops To Annotation";
180 ot->
description =
"Stretch selected vertices to active stroke";
181 ot->
idname =
"MESH_OT_fit_edge_loops_to_annotation";
190 ot->
srna,
"factor", 1.0f, 0.0f, 1.0f,
"Factor",
"Annotation factor", 0.0f, 1.0f);
195 "Remove strokes if they have been used");
201 "Method of distributing the vertices over the stroke");
Object is a sort of wrapper for general info.
constexpr IndexRange()=default
void append(const T &value)
void reserve(const int64_t min_capacity)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void MESH_OT_fit_edge_loops_to_annotation(wmOperatorType *ot)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
bool EDBM_op_callf(BMesh *bm, wmOperator *op, const char *fmt,...)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static void edbm_fit_edge_loops_to_annotation_ui(bContext *, wmOperator *op)
PropertyRNA * RNA_def_boolean_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const bool *default_value, const char *ui_name, const char *ui_description)
void BKE_annotations_free_stroke(struct bGPDstroke *gps)
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values)
MatBase< float, 4, 4 > float4x4
static const EnumPropertyItem prop_method_items[]
ViewLayer * CTX_data_view_layer(const bContext *C)
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
bool ED_operator_editmesh(bContext *C)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
bGPdata * ED_annotation_data_get_active(const bContext *C)
struct bGPDlayer * BKE_annotations_layer_active_get(struct bGPdata *gpd)
static wmOperatorStatus edbm_fit_edge_loops_to_annotation_exec(bContext *C, wmOperator *op)
@ TO_ANNOTATION_SPREAD_EVENLY
Main * CTX_data_main(const bContext *C)
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Scene * CTX_data_scene(const bContext *C)
VecBase< float, 3 > float3
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
float RNA_float_get(PointerRNA *ptr, const char *name)
View3D * CTX_wm_view3d(const bContext *C)
ListBaseT< bGPDstroke > strokes
void use_property_split_set(bool is_sep)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) ui(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT