How to add the data structure of a new geometric node?

I am just a novice in compiling, and I don’t know if my question is correct here.

I already know the various types of data contained in the geometric nodes of Blender, such as Object, Geometry, int, float, vector, color and so on.

I want to add a new Class that contains several data, you can add any other type of data to it, and I want to call it “Array”.

This function request has been sent to Rightclickselect, and the next step of work still needs to be start.

Blender source code is very large, I do not know where new data types, new node types should be added, and which files their code is written in. I want to create nodes that can make “Array” in the editor of Geo node and mat node.

Whether I need to define a new data type in other files, or whether I just need to add a few new nodes, is my question now.

Can someone here tell me how to consult the more detailed development documentation?

Examine the code for adding support for vec2
But I don’t think it will be successful.

Some of the main developers can shed some more light on this; but as far as I can tell the idea of “lists/arrays” as sockets in geometry nodes was sort of “rejected”. Not rejected in the sense that it is a bad idea, but rather that there are other ways of achieving the same things that you’d be able to do with arrays, that incorporate better with the design of the “fields” system.

I’m mentioning this not because I don’t want you to work on it. In fact, I’m very happy that you’re interested in blender development. I just want to avoid you working on something which will likely not get accepted, and prevent you from wasting your time. Some sort of design will be needed first, for something “big” like this.

Strings are not fields due to the memory overhead issues of doing so. I think that if you do this, then the problem may be similar.

Let me tell you why I have such a complicated request:

When I was working on the project, I encountered the following problems: there are a large number of models to be generated, and there are a lot of interfaces for node groups. In order to save memory, I can’t store attributes on every point or face, and I need to rearrange them every time.

So, I thought of adding the following types of nodes, I can add a new array, add the data I want (int, float, string, vector) into an array, and then separate when I use it.

If I use the function that comes with it now, the node diagram is as follows, I can only use “store name att” to store a lot of attributes in a simpler grid, achieve a function like “array”, and then call it with “captrue att” later.

Although the function I want now can be achieved in this way, it is very inefficient.

I think there may be many ways to achieve the function I want, such as making new classes in the plug-in (there are many new classes in animation nodes). No one wants to make too many changes in the kernel, do they?

I am afraid that when I finally do it in my own way, you will choose a better alternative, so I think I need to communicate this with your developers.

Arrays are very few where can be applied now. You won’t be able to get them today. Also, maybe you can’t write them?
This is my old work on solving the issue of a large number of sockets for one node:
Hope this helps you in your project.


You can compare the number of sockets on the left and right

I pretend to have a field structure field_A field_B field_C and I pass only field as a string And the names are known to those nodes that work with them

I realized that this is necessary when I did it …

All vectors links at the top = components of the matrix of the branch trunk, for inheritance of transformations

With a string method, I could call it a tree matrix
Enter this name in save matrix
And don’t even send a link. And if it were necessary to convey I would only put the name line

The best one I’ve come up with: Make 1 node that receives a string and returns the field names of your type
Sign them as a type (for example, for matrices, I immediately give them MATRIX)
Now make 2 nodes that will capture attributes and give by name using the first node
You now have cast nodes If you want to perform an operation on them, you make a node that internally receives everything, changes it, and then captures it. As a result, you get OOP in geo nodes


You separate all data into related groups
Gradually add them to your geometry
And then inject the geometry and all your group names into the node that uses them

Geometry.SetMatrix("MyData1").SetMatrix("MyData2").SetColor3Mode("MyColor1","MyColor2","MyColor3")
MyBigNode(Geometry)
1 Like

array nodes need create new date class,is Difficult。
sample is “Array to string"and"string to array”?
If compromise, it will be easy.

Most of the time you don’t need an array. Structure is what I write about. To create loosely typed value list sockets, you need to rethink all the nodes in the principle.

Can you send me some examples of C++ or BPY creating geometry nodes? if I can create geometry nodes with BPY, I will choose BPY first. I want to try to define a new class in a node code file.

Since I am new here, I am not familiar with the way, so I can only ask these low-level questions

https://developer.blender.org/diffusion/B/browse/master/source/blender/nodes/geometry/

Thank you for giving me the source code path. I opened it with visual studio and found that I may need to modify “DNA” to add the “new class” I want. This is not the method I want. I try not to modify other source code and use only one file to achieve it.

Of course, there is a good chance that this attempt will fail.

I don’t know if I can use BPY to make a Geometry nodes, but if I can, it’s a better choice.
Should BPY belong to the problem category of “use of Blender” or “developer”?

https://developer.blender.org/D13985