forked from blender/blender
Allow "Instance on Points" node to instance on physics component #2
@ -135,6 +135,7 @@ typedef enum GeometryNodeDefaultInputType {
|
|||||||
GEO_NODE_DEFAULT_FIELD_INPUT_NORMAL_FIELD = 3,
|
GEO_NODE_DEFAULT_FIELD_INPUT_NORMAL_FIELD = 3,
|
||||||
GEO_NODE_DEFAULT_FIELD_INPUT_POSITION_FIELD = 4,
|
GEO_NODE_DEFAULT_FIELD_INPUT_POSITION_FIELD = 4,
|
||||||
GEO_NODE_DEFAULT_FIELD_INPUT_INSTANCE_TRANSFORM_FIELD = 5,
|
GEO_NODE_DEFAULT_FIELD_INPUT_INSTANCE_TRANSFORM_FIELD = 5,
|
||||||
|
GEO_NODE_DEFAULT_FIELD_INPUT_ROTATION_FIELD = 6,
|
||||||
} GeometryNodeDefaultInputType;
|
} GeometryNodeDefaultInputType;
|
||||||
|
|
||||||
typedef struct bNodeTreeInterfacePanel {
|
typedef struct bNodeTreeInterfacePanel {
|
||||||
|
@ -456,6 +456,14 @@ static const EnumPropertyItem *rna_NodeTreeInterfaceSocket_default_input_itemf(
|
|||||||
N_("Transformation of each instance from the geometry context")};
|
N_("Transformation of each instance from the geometry context")};
|
||||||
RNA_enum_item_add(&items, &items_count, &instance_transform);
|
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);
|
RNA_enum_item_end(&items, &items_count);
|
||||||
|
@ -457,6 +457,11 @@ static void set_default_input_field(const bNodeTreeInterfaceSocket &input, Socke
|
|||||||
implicit_field_inputs::instance_transform);
|
implicit_field_inputs::instance_transform);
|
||||||
decl.hide_value = true;
|
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)
|
void node_group_declare(NodeDeclarationBuilder &b)
|
||||||
|
Loading…
Reference in New Issue
Block a user