[Bf-blender-cvs] [448710996b7] temp-attribute-processor: Merge branch 'master' into temp-attribute-processor
Jacques Lucke
noreply at git.blender.org
Wed Jun 23 14:23:15 CEST 2021
Commit: 448710996b77838f68df67ba23b97d2f3495d005
Author: Jacques Lucke
Date: Wed Jun 23 14:00:05 2021 +0200
Branches: temp-attribute-processor
https://developer.blender.org/rB448710996b77838f68df67ba23b97d2f3495d005
Merge branch 'master' into temp-attribute-processor
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_node.h
index 822bed89e33,a0f6be6b3e9..0c03243b789
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -1437,7 -1437,8 +1437,9 @@@ int ntreeTexExecTree(struct bNodeTree *
#define GEO_NODE_CURVE_TO_POINTS 1057
#define GEO_NODE_CURVE_REVERSE 1058
#define GEO_NODE_SEPARATE_COMPONENTS 1059
- #define GEO_NODE_ATTRIBUTE_PROCESSOR 1060
+ #define GEO_NODE_CURVE_SUBDIVIDE 1060
+ #define GEO_NODE_RAYCAST 1061
++#define GEO_NODE_ATTRIBUTE_PROCESSOR 1062
/** \} */
diff --cc source/blender/makesdna/DNA_node_types.h
index 8cbeb08eccd,12625d3408d..cda8fc6f141
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@@ -1376,50 -1379,15 +1381,59 @@@ typedef struct NodeGeometryAttributeTra
uint8_t mapping;
} NodeGeometryAttributeTransfer;
+ typedef struct NodeGeometryRaycast {
+ /* GeometryNodeRaycastMapMode. */
+ uint8_t mapping;
+
+ uint8_t input_type_ray_direction;
+ uint8_t input_type_ray_length;
+ char _pad[1];
+ } NodeGeometryRaycast;
+
+typedef struct AttributeProcessorInputSettings {
+ struct AttributeProcessorInputSettings *next, *prev;
+
+ char *identifier;
+
+ /* GeometryNodeAttributeProcessorInputMode. */
+ uint8_t input_mode;
+ char _pad[7];
+} AttributeProcessorInputSettings;
+
+typedef struct AttributeProcessorOutputSettings {
+ struct AttributeProcessorOutputSettings *next, *prev;
+
+ char *identifier;
+
+ /* GeometryNodeAttributeProcessorOutputMode. */
+ uint8_t output_mode;
+ char _pad[7];
+} AttributeProcessorOutputSettings;
+
+typedef struct NodeGeometryAttributeProcessor {
+ /* AttributeDomain. */
+ int8_t domain;
+ char _pad[7];
+ /* List of AttributeProcessorInputSettings. */
+ ListBase inputs_settings;
+ /* List of AttributeProcessorOutputSettings. */
+ ListBase outputs_settings;
+} NodeGeometryAttributeProcessor;
+
+typedef struct NodeAttributeSetAttribute {
+ char attribute_name[64];
+ /* eNodeSocketDatatype */
+ uint8_t type;
+ char _pad[7];
+} NodeAttributeSetAttribute;
+
+typedef struct NodeAttributeAttributeInput {
+ char attribute_name[64];
+ /* eNodeSocketDatatype */
+ uint8_t type;
+ char _pad[7];
+} NodeAttributeAttributeInput;
+
/* script node mode */
#define NODE_SCRIPT_INTERNAL 0
#define NODE_SCRIPT_EXTERNAL 1
@@@ -1932,17 -1900,11 +1946,22 @@@ typedef enum GeometryNodeAttributeTrans
GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST = 1,
} GeometryNodeAttributeTransferMapMode;
+ typedef enum GeometryNodeRaycastMapMode {
+ GEO_NODE_RAYCAST_INTERPOLATED = 0,
+ GEO_NODE_RAYCAST_NEAREST = 1,
+ } GeometryNodeRaycastMapMode;
+
+typedef enum GeometryNodeAttributeProcessorInputMode {
+ GEO_NODE_ATTRIBUTE_PROCESSOR_INPUT_MODE_VALUE = 0,
+ GEO_NODE_ATTRIBUTE_PROCESSOR_INPUT_MODE_ATTRIBUTE = 1,
+ GEO_NODE_ATTRIBUTE_PROCESSOR_INPUT_MODE_DEFAULT = 2,
+} GeometryNodeAttributeProcessorInputMode;
+
+typedef enum GeometryNodeAttributeProcessorOutputMode {
+ GEO_NODE_ATTRIBUTE_PROCESSOR_OUTPUT_MODE_ATTRIBUTE = 0,
+ GEO_NODE_ATTRIBUTE_PROCESSOR_OUTPUT_MODE_DEFAULT = 1,
+} GeometryNodeAttributeProcessorOutputMode;
+
#ifdef __cplusplus
}
#endif
diff --cc source/blender/makesrna/intern/rna_nodetree.c
index 9beb18b7acd,c26e9e883d6..8d7d60bd4c0
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@@ -10038,142 -9950,42 +10048,178 @@@ static void def_geo_input_material(Stru
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
+ static void def_geo_raycast(StructRNA *srna)
+ {
+ static EnumPropertyItem mapping_items[] = {
+ {GEO_NODE_RAYCAST_INTERPOLATED,
+ "INTERPOLATED",
+ 0,
+ "Interpolated",
+ "Interpolate the attribute from the corners of the hit face"},
+ {GEO_NODE_RAYCAST_NEAREST,
+ "NEAREST",
+ 0,
+ "Nearest",
+ "Use the attribute value of the closest mesh element"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryRaycast", "storage");
+
+ prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, mapping_items);
+ RNA_def_property_ui_text(prop, "Mapping", "Mapping from the target geometry to hit points");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "input_type_ray_direction", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_vector);
+ RNA_def_property_ui_text(prop, "Input Type Ray Direction", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+
+ prop = RNA_def_property(srna, "input_type_ray_length", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_float);
+ RNA_def_property_ui_text(prop, "Input Type Ray Length", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+ }
+
+static void def_geo_attribute_processor_group_input(BlenderRNA *brna)
+{
+ static EnumPropertyItem input_mode_items[] = {
+ {GEO_NODE_ATTRIBUTE_PROCESSOR_INPUT_MODE_VALUE,
+ "VALUE",
+ 0,
+ "Value",
+ "Pass a value into the group"},
+ {GEO_NODE_ATTRIBUTE_PROCESSOR_INPUT_MODE_ATTRIBUTE,
+ "ATTRIBUTE",
+ 0,
+ "Attribute",
+ "Pass a attribute name into the group"},
+ {GEO_NODE_ATTRIBUTE_PROCESSOR_INPUT_MODE_DEFAULT,
+ "DEFAULT",
+ 0,
+ "Default",
+ "Use the default attribute name or default value if the attribute does not exist"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "AttributeProcessorInputSettings", NULL);
+ RNA_def_struct_ui_text(srna, "Attribute Processor Input", "");
+
+ prop = RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "identifier", "Identifier of the matching socket in the group");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+ prop = RNA_def_property(srna, "input_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Input Mode", "How the group input is provided");
+ RNA_def_property_enum_items(prop, input_mode_items);
+ RNA_def_property_update(
+ prop, NC_NODE | NA_EDITED, "rna_GeometryNodeAttributeProcessor_mode_update");
+}
+
+static void def_geo_attribute_processor_group_output(BlenderRNA *brna)
+{
+ static EnumPropertyItem input_mode_items[] = {
+ {GEO_NODE_ATTRIBUTE_PROCESSOR_OUTPUT_MODE_ATTRIBUTE,
+ "ATTRIBUTE",
+ 0,
+ "Attribute",
+ "Specify the attribute the result should be stored in"},
+ {GEO_NODE_ATTRIBUTE_PROCESSOR_OUTPUT_MODE_DEFAULT,
+ "DEFAULT",
+ 0,
+ "Default",
+ "Use the default attribute name for the output"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "AttributeProcessorOutputSettings", NULL);
+ RNA_def_struct_ui_text(srna, "Attribute Processor Output", "");
+
+ prop = RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "identifier", "Identifier of the matching socket in the group");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+ prop = RNA_def_property(srna, "output_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Output Mode", "Where the group output is stored");
+ RNA_def_property_enum_items(prop, input_mode_items);
+ RNA_def_property_update(
+ prop, NC_NODE | NA_EDITED, "rna_GeometryNodeAttributeProcessor_mode_update");
+}
+
+static void def_geo_attribute_processor(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "id");
+ RNA_def_property_struct_type(prop, "NodeTree");
+ RNA_def_property_pointer_funcs(
+ prop, NULL, NULL, NULL, "rna_GeometryNodeAttributeProcessor_node_tree_poll");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
+ RNA_def_property_ui_text(prop, "Node Tree", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeGroup_update");
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryAttributeProcessor", "storage");
+
+ prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_enum_attribute_domain_items);
+ RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT);
+ RNA_def_property_ui_text(prop, "Domain", "The geometry domain to process attributes in");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "inputs_settings", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "AttributeProcessorInputSettings");
+ RNA_def_property_ui_text(prop, "Group Inputs", "");
+
+ prop = RNA_def_property(srna, "outputs_settings", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "AttributeProcessorOutputSettings");
+ RNA_def_property_ui_text(prop, "Group Outputs", "");
+}
+
+static void def_attr_set_attribute(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "NodeAttributeSetAttribute", "storage");
+
+ prop = RNA_def_property(srna, "attribute_name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Attribute Name", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, node_socket_data_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_AttributeNodeSetAttribute_type_itemf");
+ RNA_def_property_ui_text(prop, "Type", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
+static void def_attr_attribute_input(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ RNA_def_
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list