31 if (!ntree.nodes_by_type(
"GeometryNodeDeformCurvesOnSurface").is_empty()) {
34 for (
const bNode *node : ntree.group_nodes()) {
103 group_input->
locx = -200;
104 group_output->
locx = 200;
105 deform_node->
locx = 0;
121 offsets[i] = points_per_curve * i;
126 const OffsetIndices points_by_curve = curves.points_by_curve();
127 for (
const int i : curves.curves_range()) {
135 float3 no = {std::sin(theta) * std::sin(phi), std::cos(theta) * std::sin(phi), std::cos(phi)};
139 for (
int key = 0; key < points_per_curve; key++) {
140 float t = key /
float(points_per_curve - 1);
141 curve_positions[key] = co;
142 curve_radii[key] = 0.02f * (1.0f - t);
145 co += (offset + no) / points_per_curve;
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
Low-level operations for curves.
#define NODE_GROUP_OUTPUT
#define LISTBASE_FOREACH(type, var, list)
MINLINE float safe_acosf(float a)
@ NODE_INTERFACE_SOCKET_OUTPUT
@ NODE_INTERFACE_SOCKET_INPUT
@ GEO_NODE_ASSET_MODIFIER
Object is a sort of wrapper for general info.
void ED_node_tree_propagate_change(const bContext *C, Main *bmain, bNodeTree *ntree)
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr IndexRange index_range() const
draw_view in_light_buf[] float
bNode * node_add_static_node(const bContext *C, bNodeTree *ntree, int type)
bNodeLink * node_add_link(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock)
bNodeTree * node_tree_add_tree(Main *bmain, const char *name, const char *idname)
bNodeSocket * node_find_socket(bNode *node, eNodeSocketInOut in_out, StringRef identifier)
static bool has_surface_deformation_node(const bNodeTree &ntree)
bke::CurvesGeometry primitive_random_sphere(const int curves_size, const int points_per_curve)
void ensure_surface_deformation_node_exists(bContext &C, Object &curves_ob)
ModifierData * modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
VecBase< float, 3 > float3
struct bNodeTree * node_group
struct GeometryNodeAssetTraits * geometry_node_asset_traits
bNodeTreeInterface tree_interface