Allow "Instance on Points" node to instance on physics component #2

Merged
Falk David merged 3 commits from filedescriptor/blender:instances-on-physics-bodies into geometry-nodes-rb-component 2024-07-06 14:49:51 +02:00
3 changed files with 14 additions and 0 deletions
Showing only changes of commit c25af70526 - Show all commits

View File

@ -135,6 +135,7 @@ typedef enum GeometryNodeDefaultInputType {
GEO_NODE_DEFAULT_FIELD_INPUT_NORMAL_FIELD = 3,
GEO_NODE_DEFAULT_FIELD_INPUT_POSITION_FIELD = 4,
GEO_NODE_DEFAULT_FIELD_INPUT_INSTANCE_TRANSFORM_FIELD = 5,
GEO_NODE_DEFAULT_FIELD_INPUT_ROTATION_FIELD = 6,
} GeometryNodeDefaultInputType;
typedef struct bNodeTreeInterfacePanel {

View File

@ -456,6 +456,14 @@ static const EnumPropertyItem *rna_NodeTreeInterfaceSocket_default_input_itemf(
N_("Transformation of each instance from the geometry context")};
RNA_enum_item_add(&items, &items_count, &instance_transform);
}
else if (type->type == SOCK_ROTATION) {
const EnumPropertyItem rotation{GEO_NODE_DEFAULT_FIELD_INPUT_ROTATION_FIELD,
"ROTATION",
0,
N_("Rotation"),
N_("The rotation from the context")};
RNA_enum_item_add(&items, &items_count, &rotation);
}
}
RNA_enum_item_end(&items, &items_count);

View File

@ -457,6 +457,11 @@ static void set_default_input_field(const bNodeTreeInterfaceSocket &input, Socke
implicit_field_inputs::instance_transform);
decl.hide_value = true;
}
else if (decl.socket_type == SOCK_ROTATION) {
decl.implicit_input_fn = std::make_unique<ImplicitInputValueFn>(
implicit_field_inputs::rotation);
decl.hide_value = true;
}
}
void node_group_declare(NodeDeclarationBuilder &b)