61#include "RNA_prototypes.hh"
114 unique_curves.
add(id_cast<Curves *>(
object->data));
119 return unique_curves;
123 const bool check_editable,
124 const bool check_surface,
125 const bool check_edit_mode)
131 if (check_editable) {
143 if (check_edit_mode) {
199 if (possible_mface_indices.
size() == 1) {
200 return possible_mface_indices.
first();
204 float best_distance_sq =
FLT_MAX;
205 for (
const int possible_mface_i : possible_mface_indices) {
206 const MFace &possible_mface = mface[possible_mface_i];
211 positions[possible_mface.
v1],
212 positions[possible_mface.
v2],
213 positions[possible_mface.
v3]);
215 if (distance_sq < best_distance_sq) {
216 best_distance_sq = distance_sq;
217 mface_i = possible_mface_i;
221 if (possible_mface.
v4) {
225 positions[possible_mface.
v1],
226 positions[possible_mface.
v3],
227 positions[possible_mface.
v4]);
229 if (distance_sq < best_distance_sq) {
230 best_distance_sq = distance_sq;
231 mface_i = possible_mface_i;
247 float mface_positions_su[4][3];
256 mface_weights, positions[mface.
v1], positions[mface.
v2], positions[mface.
v3],
position);
257 mface_weights[3] = 0.0f;
259 return mface_weights;
265 bool *r_could_not_convert_some_curves)
270 Curves &curves_id = *id_cast<Curves *>(curves_ob.
data);
272 if (curves_id.surface ==
nullptr) {
275 Object &surface_ob = *curves_id.surface;
279 Mesh &surface_me = *id_cast<Mesh *>(surface_ob.
data);
284 const Span<int> tri_faces = surface_me.corner_tri_faces();
287 *r_could_not_convert_some_curves =
true;
293 curves.curves_range(), memory, [&](
const int curve_i) {
294 return points_by_curve[curve_i].size() > 1;
297 const int hair_num = multi_point_curves.
size();
306 particle_system = &psys;
310 if (particle_system ==
nullptr) {
313 particle_system = psmd.
psys;
334 for (
const int mface_i : mface_to_poly_map.
index_range()) {
335 const int face_i = mface_to_poly_map[mface_i];
336 poly_to_mface_map[face_i].append(mface_i);
342 const MFace *mfaces =
static_cast<const MFace *
>(
344 const Span<float3> positions = surface_me.vert_positions();
346 multi_point_curves.
foreach_index([&](
const int curve_i,
const int new_hair_i) {
347 const IndexRange points = points_by_curve[curve_i];
349 const float3 &root_pos_cu = positions_cu[points.
first()];
352 const std::optional<bke::bvh::ClosestPointResult> nearest = surface_bvh.
closest_point(
356 const int tri_i = nearest->index;
357 const int face_i = tri_faces[tri_i];
360 positions, mfaces, poly_to_mface_map[face_i], root_pos_su);
361 const MFace &mface = mfaces[mface_i];
366 const int num_keys = points.
size();
373 particle.
num = mface_i;
381 hair_to_surface_mat.
location() = root_pos_su;
385 const float3 &key_pos_cu = positions_cu[points[key_i]];
389 HairKey &key = hair_keys[key_i];
391 const float key_fac = key_i /
float(hair_keys.
size() - 1);
392 key.
time = 100.0f * key_fac;
393 key.
weight = 1.0f - key_fac;
411 bool could_not_convert_some_curves =
false;
417 if (curves_ob != &active_object) {
423 if (could_not_convert_some_curves) {
426 "Some curves could not be converted because they were not attached to the surface");
438 ot->
name =
"Convert Curves to Particle System";
439 ot->
idname =
"CURVES_OT_convert_to_particle_system";
440 ot->
description =
"Add a new or update an existing hair particle system on the surface object";
466 if (transfer_parents) {
467 for (
const int parent_i : parents_cache.
index_range()) {
468 const int segments = parents_cache[parent_i]->segments;
472 parents_to_transfer.
append(parent_i);
473 curve_offsets.
append(points_num);
474 points_num += segments + 1;
477 for (
const int child_i : children_cache.
index_range()) {
478 const int segments = children_cache[child_i]->segments;
482 children_to_transfer.
append(child_i);
483 curve_offsets.
append(points_num);
484 points_num += segments + 1;
486 const int curves_num = parents_to_transfer.
size() + children_to_transfer.
size();
487 curve_offsets.
append(points_num);
490 curves.offsets_for_write().copy_from(curve_offsets);
492 const float4x4 &object_to_world_mat =
object.object_to_world();
500 const int curve_index_offset) {
502 for (const int i : range) {
503 const int hair_i = indices_to_transfer[i];
504 const int curve_i = i + curve_index_offset;
505 const IndexRange points = points_by_curve[curve_i];
506 const Span<ParticleCacheKey> keys{hair_cache[hair_i], points.size()};
507 for (const int key_i : keys.index_range()) {
508 const float3 key_pos_wo = keys[key_i].co;
509 positions[points[key_i]] = math::transform_point(world_to_object_mat, key_pos_wo);
515 if (transfer_parents) {
516 copy_hair_to_curves(parents_cache, parents_to_transfer, 0);
518 copy_hair_to_curves(children_cache, children_to_transfer, parents_to_transfer.size());
520 curves.update_curve_types();
521 curves.tag_topology_changed();
534 if (psys_orig ==
nullptr) {
537 if (psys_orig ==
nullptr) {
550 psys_eval = psmd->
psys;
554 Curves *curves_id = id_cast<Curves *>(ob_new->
data);
573 ot->
name =
"Convert Particle System to Curves";
574 ot->
idname =
"CURVES_OT_convert_from_particle_system";
575 ot->
description =
"Add a new curves object based on the current state of the particle system";
596 Curves &curves_id = *id_cast<Curves *>(curves_ob.
data);
599 const Mesh &surface_mesh = *id_cast<const Mesh *>(surface_ob.
data);
600 const Span<float3> surface_positions = surface_mesh.vert_positions();
601 const Span<int> corner_verts = surface_mesh.corner_verts();
602 const Span<int3> surface_corner_tris = surface_mesh.corner_tris();
604 if (curves_id.surface_uv_map !=
nullptr) {
606 surface_uv_map = *surface_attributes.
lookup<
float2>(curves_id.surface_uv_map,
616 switch (attach_mode) {
621 for (const int curve_i : curves_range) {
622 const IndexRange points = points_by_curve[curve_i];
623 const int first_point_i = points.first();
624 const float3 old_first_point_pos_cu = positions_cu[first_point_i];
625 const float3 old_first_point_pos_su = math::transform_point(transforms.curves_to_surface,
626 old_first_point_pos_cu);
628 const std::optional<bke::bvh::ClosestPointResult> nearest = surface_bvh.closest_point(
629 old_first_point_pos_su);
633 const int tri_index = nearest->index;
635 const float3 new_first_point_pos_su = nearest->position;
636 const float3 new_first_point_pos_cu = math::transform_point(transforms.surface_to_curves,
637 new_first_point_pos_su);
638 const float3 pos_diff_cu = new_first_point_pos_cu - old_first_point_pos_cu;
640 for (float3 &pos_cu : positions_cu.slice(points)) {
641 pos_cu += pos_diff_cu;
644 if (!surface_uv_map.is_empty()) {
645 const int3 &tri = surface_corner_tris[tri_index];
646 const float3 bary_coords = bke::mesh_surface_sample::compute_bary_coord_in_triangle(
647 surface_positions, corner_verts, tri, new_first_point_pos_su);
648 const float2 uv = bke::mesh_surface_sample::sample_corner_attribute_with_bary_coords(
649 bary_coords, tri, surface_uv_map);
650 surface_uv_coords[curve_i] = uv;
658 *r_missing_uvs =
true;
665 for (const int curve_i : curves_range) {
666 const IndexRange points = points_by_curve[curve_i];
667 const int first_point_i = points.first();
668 const float3 old_first_point_pos_cu = positions_cu[first_point_i];
670 const float2 uv = surface_uv_coords[curve_i];
671 ReverseUVSampler::Result lookup_result = reverse_uv_sampler.sample(uv);
672 if (lookup_result.type != ReverseUVSampler::ResultType::Ok) {
673 *r_invalid_uvs = true;
677 const int3 &tri = surface_corner_tris[lookup_result.tri_index];
678 const float3 &bary_coords = lookup_result.bary_weights;
680 const float3 &p0_su = surface_positions[corner_verts[tri[0]]];
681 const float3 &p1_su = surface_positions[corner_verts[tri[1]]];
682 const float3 &p2_su = surface_positions[corner_verts[tri[2]]];
684 float3 new_first_point_pos_su;
685 interp_v3_v3v3v3(new_first_point_pos_su, p0_su, p1_su, p2_su, bary_coords);
686 const float3 new_first_point_pos_cu = math::transform_point(transforms.surface_to_curves,
687 new_first_point_pos_su);
689 const float3 pos_diff_cu = new_first_point_pos_cu - old_first_point_pos_cu;
690 for (float3 &pos_cu : positions_cu.slice(points)) {
691 pos_cu += pos_diff_cu;
699 curves.tag_positions_changed();
707 bool found_invalid_uvs =
false;
708 bool found_missing_uvs =
false;
714 Curves &curves_id = *id_cast<Curves *>(curves_ob->data);
715 if (curves_id.surface ==
nullptr) {
718 if (curves_id.surface->type !=
OB_MESH) {
722 *curves_ob, *curves_id.surface, attach_mode, &found_invalid_uvs, &found_missing_uvs);
726 if (found_missing_uvs) {
729 "Curves do not have attachment information that can be used for deformation");
731 if (found_invalid_uvs) {
747 ot->
name =
"Snap Curves to Surface";
748 ot->
idname =
"CURVES_OT_snap_curves_to_surface";
749 ot->
description =
"Move curves so that the first point is exactly on the surface mesh";
752 ot->
exec = snap_curves_to_surface_exec;
757 {int(AttachMode::Nearest),
761 "Find the closest point on the surface for the root point of every curve and move the root "
763 {int(AttachMode::Deform),
767 "Re-attach curves to a deformed surface using the existing attachment information. This "
768 "only works when the topology of the surface mesh has not changed"},
769 {0,
nullptr, 0,
nullptr,
nullptr},
775 int(AttachMode::Nearest),
777 "How to find the point on the surface to attach to");
791 curves_id->selection_domain = char(domain);
807 if (
const GVArray src = *attributes.
lookup(selection_name, domain)) {
809 src.materialize_to_uninitialized(dst->data.data());
811 attributes.
remove(selection_name);
812 attributes.
add(selection_name,
816 dst->remove_user_and_delete_if_last();
819 if (!active_attribute.empty()) {
840 ot->
name =
"Set Select Mode";
842 ot->
description =
"Change the mode used for selection masking in curves sculpt mode";
856 return std::any_of(curves_ids.
begin(), curves_ids.
end(), [](
const Curves *curves_id) {
857 return has_anything_selected(curves_id->geometry.wrap());
871 for (
Curves *curves_id : unique_curves) {
886 ot->
name =
"(De)select All";
887 ot->
idname =
"CURVES_OT_select_all";
905 for (
Curves *curves_id : unique_curves) {
908 const int domain_size =
curves.attributes().domain_size(selection_domain);
911 const IndexMask inv_random_elements = random_mask(domain_size, seed, probability, memory)
917 if (!was_anything_selected) {
942 ot->
name =
"Select Random";
944 ot->
description =
"Randomize existing selection or create new random selection";
958 "Source of randomness",
967 "Chance of every point or curve being included in the selection",
978 for (
Curves *curves_id : unique_curves) {
983 curves, amount_start, amount_end,
true, memory);
988 if (!was_anything_selected) {
1023 ot->
name =
"Select Ends";
1039 "Number of points to select from the front",
1048 "Number of points to select from the back",
1056 for (
Curves *curves_id : unique_curves) {
1070 ot->
name =
"Select Linked";
1072 ot->
description =
"Select all points in curves with any point selection";
1083 for (
Curves *curves_id : unique_curves) {
1097 ot->
name =
"Select More";
1099 ot->
description =
"Grow the selection by one point";
1110 for (
Curves *curves_id : unique_curves) {
1124 ot->
name =
"Select Less";
1126 ot->
description =
"Shrink the selection by one point";
1141 for (
Curves *curves_id : unique_curves) {
1150 curves.calculate_bezier_auto_handles();
1178 if (
object ==
nullptr) {
1194 Mesh &new_surface_mesh = *id_cast<Mesh *>(new_surface_ob.
data);
1195 const StringRef new_uv_map_name = new_surface_mesh.active_uv_map_name();
1201 Object &curves_ob = *selected_ob;
1202 Curves &curves_id = *id_cast<Curves *>(curves_ob.
data);
1204 MEM_SAFE_DELETE(curves_id.surface_uv_map);
1221 curves_id.surface = &new_surface_ob;
1251 ot->
name =
"Set Curves Surface Object";
1254 "Use the active object as surface for selected curves objects and set it as the parent";
1281 ot->
name =
"Delete";
1283 ot->
description =
"Remove selected control points or curves";
1319 ot->
name =
"Duplicate";
1321 ot->
description =
"Copy selected points or curves";
1341 if (selection.
size() ==
curves.points_num()) {
1342 curves.attributes_for_write().remove(
"tilt");
1348 curves.tag_normals_changed();
1359 ot->
name =
"Clear Tilt";
1361 ot->
description =
"Clear the tilt of selected control points";
1388 if (!cyclic.
span.contains(
true)) {
1389 attributes.
remove(
"cyclic");
1392 curves.calculate_bezier_auto_handles();
1404 ot->
name =
"Toggle Cyclic";
1406 ot->
description =
"Make active curve closed/open loop";
1430 options.convert_bezier_handles_to_poly_points = use_handles;
1431 options.convert_bezier_handles_to_catmull_rom_points = use_handles;
1432 options.keep_bezier_shape_as_nurbs = use_handles;
1433 options.keep_catmull_rom_shape_as_nurbs = use_handles;
1447 ot->
name =
"Set Curve Type";
1463 "Take handle information into account in the conversion");
1478 curves.reverse_curves(selection);
1490 ot->
name =
"Switch Direction";
1492 ot->
description =
"Reverse the direction of the selected curves";
1508 const int points_num =
curves.points_num();
1516 points_selection.
to_bools(points_selection_span);
1518 Array<int> segment_cuts(points_num, number_cuts);
1522 for (const int curve_i : range) {
1523 const IndexRange points = points_by_curve[curve_i];
1524 if (points.size() <= 1) {
1527 for (const int point_i : points.drop_back(1)) {
1528 if (!points_selection_span[point_i] || !points_selection_span[point_i + 1]) {
1529 segment_cuts[point_i] = 0;
1533 if (!points_selection_span[points.last()] || !points_selection_span[points.first()]) {
1534 segment_cuts[points.last()] = 0;
1552 ot->
name =
"Subdivide";
1554 ot->
description =
"Subdivide selected curve segments";
1562 prop =
RNA_def_int(ot->
srna,
"number_cuts", 1, 1, 1000,
"Number of Cuts",
"", 1, 10);
1573 const int new_points_num = new_curves.
points_num();
1574 const int new_curves_num = new_curves.
curves_num();
1592 {old_geometry, new_geometry}, {});
1595 dst_curves = std::move(joined_curves_id->geometry.wrap());
1621 curves.cyclic_for_write().fill(
true);
1624 curves.resolution_for_write().fill(12);
1627 positions[0] =
float3(-radius, 0, 0);
1628 positions[1] =
float3(0, radius, 0);
1629 positions[2] =
float3(radius, 0, 0);
1630 positions[3] =
float3(0, -radius, 0);
1633 curves.handle_positions_left_for_write();
1634 curves.handle_positions_right_for_write();
1636 curves.calculate_bezier_auto_handles();
1644 Curves *active_curves_id = id_cast<Curves *>(
object->data);
1658 ot->
name =
"Add Circle";
1684 curves.resolution_for_write().fill(12);
1690 left_handles[0] =
float3(-1.5f, -0.5, 0) * radius;
1691 positions[0] =
float3(-1.0f, 0, 0) * radius;
1692 right_handles[0] =
float3(-0.5f, 0.5f, 0) * radius;
1694 left_handles[1] =
float3(0, 0, 0) * radius;
1695 positions[1] =
float3(1.0f, 0, 0) * radius;
1696 right_handles[1] =
float3(2.0f, 0, 0) * radius;
1704 Curves *active_curves_id = id_cast<Curves *>(
object->data);
1718 ot->
name =
"Add Bézier";
1737 auto new_handle_type = [&](
const int8_t handle_type) {
1770 for (const int point_i : range) {
1771 if (selection_left[point_i] || selection[point_i]) {
1772 handle_types_left[point_i] = new_handle_type(handle_types_left[point_i]);
1774 if (selection_right[point_i] || selection[point_i]) {
1775 handle_types_right[point_i] = new_handle_type(handle_types_right[point_i]);
1780 curves.calculate_bezier_auto_handles();
1781 curves.calculate_bezier_aligned_handles();
1782 curves.tag_topology_changed();
1797 "The location is automatically calculated to be smooth"},
1802 "The location is calculated to point to the next/previous control point"},
1805 ICON_HANDLE_ALIGNED,
1807 "The location is constrained to point in the opposite direction as the other handle"},
1812 "The handle can be moved anywhere, and does not influence the point's other handle"},
1814 "TOGGLE_FREE_ALIGN",
1816 "Toggle Free/Align",
1817 "Replace Free handles with Align, and all Align with Free handles"},
1818 {0,
nullptr, 0,
nullptr,
nullptr},
1823 ot->
name =
"Set Handle Type";
1825 ot->
description =
"Set the handle type for Bézier curves";
1881 "Make copies of selected elements and move them",
1889 "Extrude Curve and Move",
1890 "Extrude curve and move result",
Generic geometry attributes built on CustomData.
#define CTX_DATA_BEGIN(C, Type, instance, member)
Low-level operations for curves.
CustomData interface, see also DNA_customdata_types.h.
General operations, lookup, etc. for blender objects.
Object is a sort of wrapper for general info.
#define BLI_assert_unreachable()
static AttributeOwner from_id(ID *id)
GMutableSpan take_back(const int64_t n) const
GMutableSpan drop_back(const int64_t n) const
const CPPType & type() const
MutableSpan< T > typed() const
static IndexMask from_predicate(const IndexMask &universe, LinearAllocator<> &memory, Fn &&predicate, exec_mode::Mode mode=exec_mode::parallel)
constexpr int64_t first() const
constexpr int64_t size() const
constexpr int64_t size() const
constexpr T * data() const
constexpr IndexRange index_range() const
constexpr const T & first() const
constexpr int64_t size() const
constexpr const T * end() const
constexpr IndexRange index_range() const
constexpr const T * begin() const
constexpr bool is_empty() const
static VArray from_span(Span< T > values)
void add_new(const Key &key)
void append(const T &value)
GAttributeReader lookup_or_default(StringRef name, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
GAttributeReader lookup(const StringRef name) const
void tag_topology_changed()
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef name)
std::optional< ClosestPointResult > closest_point(const float3 &point, float radius=std::numeric_limits< float >::max()) const
constexpr bool is_empty() const
constexpr bool is_empty() const
constexpr int64_t size() const
constexpr const char * data() const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
IndexMask complement(const IndexMask &universe, LinearAllocator<> &memory) const
void to_bools(MutableSpan< bool > r_bools) const
IndexRange index_range() const
CCL_NAMESPACE_BEGIN struct Options options
float3x3 scale(float3x3 mat, float2 scale)
void invert_booleans(MutableSpan< bool > span)
AttrType cpp_type_to_attribute_type(const CPPType &type)
Curves * curves_new_nomain(int points_num, int curves_num)
static wmOperatorStatus exec(bContext *C, wmOperator *op)
static CurvesGeometry generate_bezier_primitive(const float radius)
static CurvesGeometry generate_circle_primitive(const float radius)
static wmOperatorStatus exec(bContext *C, wmOperator *op)
static wmOperatorStatus exec(bContext *C, wmOperator *)
static wmOperatorStatus curves_convert_from_particle_system_exec(bContext *C, wmOperator *)
static bke::CurvesGeometry particles_to_curves(Object &object, ParticleSystem &psys)
static bool curves_convert_from_particle_system_poll(bContext *C)
static float4 compute_mface_weights_for_position(const Span< float3 > positions, const MFace &mface, const float3 &position)
static int find_mface_for_root_position(const Span< float3 > positions, const MFace *mface, const Span< int > possible_mface_indices, const float3 &root_pos)
static wmOperatorStatus curves_convert_to_particle_system_exec(bContext *C, wmOperator *op)
static void try_convert_single_object(Object &curves_ob, Main &bmain, Scene &scene, bool *r_could_not_convert_some_curves)
static wmOperatorStatus exec(bContext *C, wmOperator *op)
static wmOperatorStatus delete_exec(bContext *C, wmOperator *)
static wmOperatorStatus duplicate_exec(bContext *C, wmOperator *)
static wmOperatorStatus exec(bContext *C, wmOperator *)
static wmOperatorStatus exec(bContext *C, wmOperator *op)
static wmOperatorStatus curves_set_selection_domain_exec(bContext *C, wmOperator *op)
static wmOperatorStatus snap_curves_to_surface_exec(bContext *C, wmOperator *op)
static void snap_curves_to_surface_exec_object(Object &curves_ob, const Object &surface_ob, const AttachMode attach_mode, bool *r_invalid_uvs, bool *r_missing_uvs)
static wmOperatorStatus split_exec(bContext *C, wmOperator *)
static wmOperatorStatus exec(bContext *C, wmOperator *op)
static wmOperatorStatus surface_set_exec(bContext *C, wmOperator *op)
static bool surface_set_poll(bContext *C)
static wmOperatorStatus exec(bContext *C, wmOperator *)
static void CURVES_OT_surface_set(wmOperatorType *ot)
const EnumPropertyItem rna_enum_set_handle_type_items[]
void operatormacros_curves()
static wmOperatorStatus select_linked_exec(bContext *C, wmOperator *)
bool remove_selection(bke::CurvesGeometry &curves, const bke::AttrDomain selection_domain)
static void CURVES_OT_convert_from_particle_system(wmOperatorType *ot)
void keymap_curves(wmKeyConfig *keyconf)
void CURVES_OT_draw(wmOperatorType *ot)
static bool has_anything_selected(const Span< Curves * > curves_ids)
static void CURVES_OT_select_less(wmOperatorType *ot)
static void CURVES_OT_convert_to_particle_system(wmOperatorType *ot)
static void CURVES_OT_select_random(wmOperatorType *ot)
static eHandleDisplay view3d_handle_type_or_default(const View3D *v3d)
static void CURVES_OT_select_ends(wmOperatorType *ot)
void select_linked(bke::CurvesGeometry &curves, const IndexMask &curves_mask, const bool unselect)
void select_all(bke::CurvesGeometry &curves, const IndexMask &mask, const bke::AttrDomain selection_domain, int action)
void operatortypes_curves()
static bool editable_curves_point_domain_poll(bContext *C)
IndexMask retrieve_selected_points(const bke::CurvesGeometry &curves, LinearAllocator<> &memory)
void duplicate_curves(bke::CurvesGeometry &curves, const IndexMask &mask)
static void CURVES_OT_add_bezier(wmOperatorType *ot)
void duplicate_points(bke::CurvesGeometry &curves, const IndexMask &mask)
static void CURVES_OT_select_linked(wmOperatorType *ot)
VectorSet< Curves * > get_unique_editable_curves(const bContext &C)
void foreach_selection_attribute_writer(bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, FunctionRef< void(bke::GSpanAttributeWriter &selection)> fn)
bool editable_curves_poll(bContext *C)
void select_adjacent(bke::CurvesGeometry &curves, const IndexMask &curves_mask, const bool deselect)
static void CURVES_OT_handle_type_set(wmOperatorType *ot)
static void CURVES_OT_subdivide(wmOperatorType *ot)
static void CURVES_OT_select_more(wmOperatorType *ot)
static void CURVES_OT_select_all(wmOperatorType *ot)
static void CURVES_OT_switch_direction(wmOperatorType *ot)
bke::CurvesGeometry split_points(const bke::CurvesGeometry &curves, const IndexMask &points_to_split)
void fill_selection_false(GMutableSpan selection)
bool object_has_editable_curves(const Main &bmain, const Object &object)
static void select_random_ui(bContext *, wmOperator *op)
void ED_curves_pentool_modal_keymap(wmKeyConfig *keyconf)
bool editable_curves_in_edit_mode_poll(bContext *C)
static void CURVES_OT_split(wmOperatorType *ot)
IndexMask retrieve_selected_curves(const bke::CurvesGeometry &curves, LinearAllocator<> &memory)
static void CURVES_OT_tilt_clear(wmOperatorType *ot)
static void CURVES_OT_duplicate(wmOperatorType *ot)
static wmOperatorStatus select_all_exec(bContext *C, wmOperator *op)
static wmOperatorStatus select_more_exec(bContext *C, wmOperator *)
void fill_selection_true(GMutableSpan selection)
static bool curves_poll_impl(bContext *C, const bool check_editable, const bool check_surface, const bool check_edit_mode)
Span< StringRef > get_curves_selection_attribute_names(const bke::CurvesGeometry &curves)
static void CURVES_OT_curve_type_set(wmOperatorType *ot)
static wmOperatorStatus select_random_exec(bContext *C, wmOperator *op)
static void CURVES_OT_cyclic_toggle(wmOperatorType *ot)
void ED_operatortypes_curves_pen()
static wmOperatorStatus select_ends_exec(bContext *C, wmOperator *op)
static void CURVES_OT_delete(wmOperatorType *ot)
static void CURVES_OT_snap_curves_to_surface(wmOperatorType *ot)
static wmOperatorStatus select_less_exec(bContext *C, wmOperator *)
void ensure_surface_deformation_node_exists(bContext &C, Object &curves_ob)
static void append_primitive_curve(bContext *C, Curves &curves_id, CurvesGeometry new_curves, wmOperator &op)
IndexMask end_points(const bke::CurvesGeometry &curves, const IndexMask &curves_mask, const int amount_start, const int amount_end, const bool inverted, IndexMaskMemory &memory)
bool curves_with_surface_poll(bContext *C)
static void select_ends_ui(bContext *, wmOperator *op)
void CURVES_OT_separate(wmOperatorType *ot)
void CURVES_OT_attribute_set(wmOperatorType *ot)
IndexMask retrieve_all_selected_points(const bke::CurvesGeometry &curves, const int handle_display, LinearAllocator<> &memory)
bool curves_poll(bContext *C)
bke::GSpanAttributeWriter ensure_selection_attribute(bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, bke::AttrType create_type, StringRef attribute_name)
void CURVES_OT_extrude(wmOperatorType *ot)
void CURVES_OT_select_linked_pick(wmOperatorType *ot)
static void CURVES_OT_set_selection_domain(wmOperatorType *ot)
static void CURVES_OT_add_circle(wmOperatorType *ot)
bool editable_curves_with_surface_poll(bContext *C)
void add_unit_props_radius(wmOperatorType *ot)
bool parent_set(ReportList *reports, const bContext *C, Scene *scene, Object *const ob, Object *const par, int partype, bool xmirror, bool keep_transform, const int vert_par[3])
Object * context_active_object(const bContext *C)
void add_generic_props(wmOperatorType *ot, bool do_editmode)
void add_generic_get_opts(bContext *C, wmOperator *op, char view_align_axis, float r_loc[3], float r_rot[3], float r_scale[3], bool *r_enter_editmode, unsigned short *r_local_view_bits, bool *r_is_view_aligned)
bke::GeometrySet join_geometries(Span< bke::GeometrySet > geometries, const bke::AttributeFilter &attribute_filter, const std::optional< Span< bke::GeometryComponent::Type > > &component_types_to_join=std::nullopt, bool allow_merging_instance_references=true)
std::optional< TransformGeometryErrors > transform_geometry(bke::GeometrySet &geometry, const float4x4 &transform)
bke::CurvesGeometry subdivide_curves(const bke::CurvesGeometry &src_curves, const IndexMask &selection, const VArray< int > &cuts, const bke::AttributeFilter &attribute_filter={})
bke::CurvesGeometry convert_curves(const bke::CurvesGeometry &src_curves, const IndexMask &selection, CurveType dst_type, const bke::AttributeFilter &attribute_filter, const ConvertCurvesOptions &options={})
void masked_fill(MutableSpan< T > data, const T &value, const IndexMask &mask)
EulerXYZBase< float > EulerXYZ
CartesianBasis invert(const CartesianBasis &basis)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
void WM_main_add_notifier(uint type, void *reference)
std::optional< StringRefNull > BKE_attributes_active_name_get(AttributeOwner &owner)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
const EnumPropertyItem rna_enum_attribute_curves_domain_items[]
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
Object * BKE_object_add(Main *bmain, Scene *scene, ViewLayer *view_layer, ObjectType type, const char *name) ATTR_NONNULL(1
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
struct ModifierData * object_add_particle_system(struct Main *bmain, const struct Scene *scene, struct Object *ob, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
MINLINE void copy_v3_v3(float r[3], const float a[3])
struct ParticleSystem * psys_get_current(struct Object *ob)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
const EnumPropertyItem rna_enum_curves_type_items[]
@ eModifierType_ParticleSystem
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
int RNA_int_get(PointerRNA *ptr, const char *name)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BKE_attributes_active_set(AttributeOwner &owner, StringRef name)
MatBase< float, 4, 4 > float4x4
void psys_free_particles(struct ParticleSystem *psys)
@ OB_MODIFIER_FLAG_ADD_REST_POSITION
ViewLayer * CTX_data_view_layer(const bContext *C)
void WM_operator_properties_select_all(wmOperatorType *ot)
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
VecBase< float, 4 > float4
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
VecBase< float, 2 > float2
void BKE_mesh_tessface_calc(Mesh *mesh)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
Object * CTX_data_edit_object(const bContext *C)
void interp_weights_tri_v3(float w[3], const float v1[3], const float v2[3], const float v3[3], const float co[3])
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
void psys_mat_hair_to_object(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
void interp_weights_poly_v3(float w[], float v[][3], int n, const float co[3])
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
Main * CTX_data_main(const bContext *C)
void closest_on_tri_to_point_v3(float r[3], const float p[3], const float v1[3], const float v2[3], const float v3[3])
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
MINLINE void copy_v4_v4(float r[4], const float a[4])
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)
void psys_changed_type(struct Object *ob, struct ParticleSystem *psys)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
PropertyRNA * RNA_def_float(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)
Object * CTX_data_active_object(const bContext *C)
bool ED_operator_object_active_editable_ex(bContext *C, const Object *ob)
float RNA_float_get(PointerRNA *ptr, const char *name)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
View3D * CTX_wm_view3d(const bContext *C)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
const c_style_mat & ptr() const
ListBaseT< ModifierData > modifiers
ObjectModifierFlag modifier_flag
ListBaseT< struct ParticleSystem > particlesystem
eParticleChildType childtype
struct ParticleSystem * psys
struct ParticleCacheKey ** childcache
struct ParticleCacheKey ** pathcache
eParticleSystem_Flag flag
eHandleDisplay handle_display
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Curves * get_curves_for_write()
MutableVArraySpan< T > span
void use_property_decorate_set(bool is_decorate)
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)
Layout & column(bool align)
bool(*) poll(struct bContext *)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) ui(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports