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
2 changed files with 8 additions and 0 deletions
Showing only changes of commit ea483a876c - Show all commits

View File

@ -602,6 +602,7 @@ void normal(const bNode &node, void *r_value);
void index(const bNode &node, void *r_value); void index(const bNode &node, void *r_value);
void id_or_index(const bNode &node, void *r_value); void id_or_index(const bNode &node, void *r_value);
void instance_transform(const bNode &node, void *r_value); void instance_transform(const bNode &node, void *r_value);
void rotation(const bNode &node, void *r_value);
} // namespace implicit_field_inputs } // namespace implicit_field_inputs
void build_node_declaration(const bke::bNodeType &typeinfo, void build_node_declaration(const bke::bNodeType &typeinfo,

View File

@ -6,6 +6,7 @@
#include "NOD_socket_declarations.hh" #include "NOD_socket_declarations.hh"
#include "NOD_socket_declarations_geometry.hh" #include "NOD_socket_declarations_geometry.hh"
#include "BLI_math_quaternion_types.hh"
#include "BLI_stack.hh" #include "BLI_stack.hh"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
@ -870,6 +871,12 @@ void instance_transform(const bNode & /*node*/, void *r_value)
bke::SocketValueVariant(bke::AttributeFieldInput::Create<float4x4>("instance_transform")); bke::SocketValueVariant(bke::AttributeFieldInput::Create<float4x4>("instance_transform"));
} }
void rotation(const bNode & /*node*/, void *r_value)
filedescriptor marked this conversation as resolved
Review

If you're adding a new implicit field input it should probably also be supported in node groups.

  • GeometryNodeDefaultInputType enum
  • rna_NodeTreeInterfaceSocket_default_input_itemf
  • set_default_input_field in `node_common.cc
If you're adding a new implicit field input it should probably also be supported in node groups. - `GeometryNodeDefaultInputType` enum - `rna_NodeTreeInterfaceSocket_default_input_itemf` - `set_default_input_field` in `node_common.cc
{
new (r_value)
bke::SocketValueVariant(bke::AttributeFieldInput::Create<math::Quaternion>("rotation"));
}
} // namespace implicit_field_inputs } // namespace implicit_field_inputs
} // namespace blender::nodes } // namespace blender::nodes