[Bf-blender-cvs] [aa363a71cd3] temp-attribute-processor: improve naming
Jacques Lucke
noreply at git.blender.org
Thu May 27 12:51:43 CEST 2021
Commit: aa363a71cd391b4ff1ec7acd7cd64401f34995cf
Author: Jacques Lucke
Date: Thu May 27 11:27:30 2021 +0200
Branches: temp-attribute-processor
https://developer.blender.org/rBaa363a71cd391b4ff1ec7acd7cd64401f34995cf
improve naming
===================================================================
M source/blender/blenkernel/intern/node.cc
M source/blender/makesdna/DNA_node_types.h
M source/blender/makesrna/RNA_access.h
M source/blender/makesrna/intern/rna_nodetree.c
M source/blender/nodes/geometry/nodes/node_geo_attribute_processor.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 902759cd320..d6edf85f53e 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -582,13 +582,16 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree)
else if (node->type == GEO_NODE_ATTRIBUTE_PROCESSOR) {
NodeGeometryAttributeProcessor *storage = (NodeGeometryAttributeProcessor *)node->storage;
BLO_write_struct(writer, NodeGeometryAttributeProcessor, storage);
- BLO_write_struct_list(writer, AttributeProcessorInput, &storage->group_inputs);
- BLO_write_struct_list(writer, AttributeProcessorOutput, &storage->group_outputs);
- LISTBASE_FOREACH (AttributeProcessorInput *, input, &storage->group_inputs) {
- BLO_write_string(writer, input->identifier);
+ BLO_write_struct_list(writer, AttributeProcessorInputSettings, &storage->inputs_settings);
+ BLO_write_struct_list(
+ writer, AttributeProcessorOutputSettings, &storage->outputs_settings);
+ LISTBASE_FOREACH (
+ AttributeProcessorInputSettings *, input_settings, &storage->inputs_settings) {
+ BLO_write_string(writer, input_settings->identifier);
}
- LISTBASE_FOREACH (AttributeProcessorOutput *, output, &storage->group_outputs) {
- BLO_write_string(writer, output->identifier);
+ LISTBASE_FOREACH (
+ AttributeProcessorOutputSettings *, output_settings, &storage->outputs_settings) {
+ BLO_write_string(writer, output_settings->identifier);
}
}
else if (node->typeinfo != &NodeTypeUndefined) {
@@ -775,13 +778,15 @@ void ntreeBlendReadData(BlendDataReader *reader, bNodeTree *ntree)
case GEO_NODE_ATTRIBUTE_PROCESSOR: {
NodeGeometryAttributeProcessor *storage = (NodeGeometryAttributeProcessor *)
node->storage;
- BLO_read_list(reader, &storage->group_inputs);
- BLO_read_list(reader, &storage->group_outputs);
- LISTBASE_FOREACH (AttributeProcessorInput *, input, &storage->group_inputs) {
- BLO_read_data_address(reader, &input->identifier);
+ BLO_read_list(reader, &storage->inputs_settings);
+ BLO_read_list(reader, &storage->outputs_settings);
+ LISTBASE_FOREACH (
+ AttributeProcessorInputSettings *, input_settings, &storage->inputs_settings) {
+ BLO_read_data_address(reader, &input_settings->identifier);
}
- LISTBASE_FOREACH (AttributeProcessorOutput *, output, &storage->group_outputs) {
- BLO_read_data_address(reader, &output->identifier);
+ LISTBASE_FOREACH (
+ AttributeProcessorOutputSettings *, output_settings, &storage->outputs_settings) {
+ BLO_read_data_address(reader, &output_settings->identifier);
}
break;
}
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 6a747211249..f398634884c 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1358,34 +1358,34 @@ typedef struct NodeGeometryAttributeTransfer {
uint8_t mapping;
} NodeGeometryAttributeTransfer;
-typedef struct AttributeProcessorInput {
- struct AttributeProcessorInput *next, *prev;
+typedef struct AttributeProcessorInputSettings {
+ struct AttributeProcessorInputSettings *next, *prev;
char *identifier;
/* GeometryNodeAttributeProcessorInputMode. */
uint8_t input_mode;
char _pad[7];
-} AttributeProcessorInput;
+} AttributeProcessorInputSettings;
-typedef struct AttributeProcessorOutput {
- struct AttributeProcessorOutput *next, *prev;
+typedef struct AttributeProcessorOutputSettings {
+ struct AttributeProcessorOutputSettings *next, *prev;
char *identifier;
/* GeometryNodeAttributeProcessorOutputMode. */
uint8_t output_mode;
char _pad[7];
-} AttributeProcessorOutput;
+} AttributeProcessorOutputSettings;
typedef struct NodeGeometryAttributeProcessor {
/* AttributeDomain. */
int8_t domain;
char _pad[7];
- /* List of AttributeProcessorInput. */
- ListBase group_inputs;
- /* List of AttributeProcessorOutput. */
- ListBase group_outputs;
+ /* List of AttributeProcessorInputSettings. */
+ ListBase inputs_settings;
+ /* List of AttributeProcessorOutputSettings. */
+ ListBase outputs_settings;
} NodeGeometryAttributeProcessor;
/* script node mode */
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 755372f911e..2f30ab4217e 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -72,8 +72,8 @@ extern StructRNA RNA_ArrayModifier;
extern StructRNA RNA_Attribute;
extern StructRNA RNA_AttributeGroup;
extern StructRNA RNA_AttributeNodeTree;
-extern StructRNA RNA_AttributeProcessorInput;
-extern StructRNA RNA_AttributeProcessorOutput;
+extern StructRNA RNA_AttributeProcessorInputSettings;
+extern StructRNA RNA_AttributeProcessorOutputSettings;
extern StructRNA RNA_AssetMetaData;
extern StructRNA RNA_AssetTag;
extern StructRNA RNA_BackgroundImage;
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 383957ae0a4..69efc43ae1a 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9920,7 +9920,7 @@ static void def_geo_attribute_processor_group_input(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna = RNA_def_struct(brna, "AttributeProcessorInput", NULL);
+ 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);
@@ -9953,7 +9953,7 @@ static void def_geo_attribute_processor_group_output(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna = RNA_def_struct(brna, "AttributeProcessorOutput", NULL);
+ 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);
@@ -9989,12 +9989,12 @@ static void def_geo_attribute_processor(StructRNA *srna)
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, "group_inputs", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "AttributeProcessorInput");
+ 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, "group_outputs", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "AttributeProcessorOutput");
+ 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", "");
}
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_processor.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_processor.cc
index 1739f286858..9440544dcb1 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_processor.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_processor.cc
@@ -51,22 +51,26 @@ static void geo_node_attribute_processor_layout(uiLayout *layout, bContext *C, P
{
uiLayout *box = uiLayoutBox(layout);
bNodeSocket *interface_socket = (bNodeSocket *)group->inputs.first;
- AttributeProcessorInput *input = (AttributeProcessorInput *)storage->group_inputs.first;
- for (; interface_socket && input;
- interface_socket = interface_socket->next, input = input->next) {
+ AttributeProcessorInputSettings *input_settings = (AttributeProcessorInputSettings *)
+ storage->inputs_settings.first;
+ for (; interface_socket && input_settings;
+ interface_socket = interface_socket->next, input_settings = input_settings->next) {
PointerRNA input_ptr;
- RNA_pointer_create(ptr->owner_id, &RNA_AttributeProcessorInput, input, &input_ptr);
+ RNA_pointer_create(
+ ptr->owner_id, &RNA_AttributeProcessorInputSettings, input_settings, &input_ptr);
uiItemR(box, &input_ptr, "input_mode", 0, interface_socket->name, ICON_NONE);
}
}
{
uiLayout *box = uiLayoutBox(layout);
bNodeSocket *interface_socket = (bNodeSocket *)group->outputs.first;
- AttributeProcessorOutput *output = (AttributeProcessorOutput *)storage->group_outputs.first;
- for (; interface_socket && output;
- interface_socket = interface_socket->next, output = output->next) {
+ AttributeProcessorOutputSettings *output_settings = (AttributeProcessorOutputSettings *)
+ storage->outputs_settings.first;
+ for (; interface_socket && output_settings;
+ interface_socket = interface_socket->next, output_settings = output_settings->next) {
PointerRNA output_ptr;
- RNA_pointer_create(ptr->owner_id, &RNA_AttributeProcessorOutput, output, &output_ptr);
+ RNA_pointer_create(
+ ptr->owner_id, &RNA_AttributeProcessorOutputSettings, output_settings, &output_ptr);
uiItemR(box, &output_ptr, "output_mode", 0, interface_socket->name, ICON_NONE);
}
}
@@ -82,39 +86,40 @@ static void geo_node_attribute_processor_init(bNodeTree *UNUSED(ntree), bNode *n
namespace blender::nodes {
-static void free_group_input(AttributeProcessorInput *input)
+static void free_group_input(AttributeProcessorInputSettings *input_settings)
{
- MEM_freeN(input->identifier);
- MEM_freeN(input);
+ MEM_freeN(input_settings->identifier);
+ MEM_freeN(input_settings);
}
-static void free_group_output(AttributeProcessorOutput *ou
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list