How to make instances inherit grid information?

Hello, I use geometric node the “Instance on Points” way to create an instance, want to make this instance after applying into a grid, can inherit the Vertex Groups or Face Maps information of the original object, how can I do it?

i am not sure what you mean with “after applying into a grid”? maybe you wanna show us your geometry nodes tree so we can see what you mean?

if i understood you right, you want to use a vertex group after instancing, so hopefully this is what you want?

I created a cube with this vertex group:

i saved this vertex group in the attributes like this:

and as you can see i can read out the information via named attribute and use it.

You have to choose the right vertex group in your modifier:

image

result:

Hope it helps.

1 Like

First of all, thank you for your reply, and thanks for the help with the screenshot instructions as well, just sorry that that didn’t work out the way I wanted it to. Maybe I didn’t express myself clearly enough, let me explain.

I have an original mesh (a flower petal) that contains vertex group, face mapping information (Because one of these two attributes needs to be exported to Zbrush to be recognized as a poly group).

Then I created an instance of that mesh via the geometry node (because it’s easier to combine the petals into a flower while retaining the synchronized editing properties), and after converting that instance into a mesh (via the “Visual Geometry to Mesh” operation, or Apply Modifiers), it doesn’t inherit the original mesh’s vertex group and face mapping information.

I would like the object that is transformed from an instance to a mesh to inherit the vertex group or face mapping information of the original mesh.

ok, then pls provide a blend file so that i can check it out and make a solution proposal. thx.

Yes, please check it out.

A geometric node is used in there to implement the array, which is not directly related to the current question, so I hope I’m not interfering with you.

I asked the AI search engine and it gave the following answer (Unfortunately I don’t know how to make plugins) :

To copy vertex group information from one object to another in Blender, you can use the Python API. The process involves creating new vertex groups in the target object and assigning weights to vertices based on their corresponding vertices in the source object. Here’s a step-by-step guide and a code example to help you achieve this:

First, you need to decide how to assign weights to each vertex in the target object. A common technique is to choose the closest vertex in the target object to the vertex in the source object. You can calculate the distance between vertices using (src.data.vertices[i].co - dst_vert.co).length and select the vertex with the minimum distance.

Here’s a simplified code example that demonstrates how to copy vertex group information:

import bpy

# Source and target objects
source_obj = bpy.data.objects['SourceObjectName']
target_obj = bpy.data.objects['TargetObjectName']

# Iterate over all vertex groups in the source object
for group in source_obj.vertex_groups:
    # Create a new vertex group in the target object
    new_group = target_obj.vertex_groups.new(name=group.name)
    
    # Iterate over all vertices in the source object
    for vertex in source_obj.data.vertices:
        # Check if the vertex belongs to the current vertex group
        for g in vertex.groups:
            if g.group == group.index:
                # Find the corresponding vertex in the target object
                target_vertex_index = find_closest_vertex(vertex.co, target_obj)
                # Set the vertex weight
                new_group.add([target_vertex_index], g.weight, 'REPLACE')

# Function to find the closest vertex in the target object
def find_closest_vertex(co, obj):
    closest_vertex_index = None
    closest_distance = None
    for i, vertex in enumerate(obj.data.vertices):
        distance = (vertex.co - co).length
        if closest_distance is None or distance < closest_distance:
            closest_distance = distance
            closest_vertex_index = i
    return closest_vertex_index

This code example first defines the source and target objects. It then iterates over all vertex groups in the source object. For each vertex group, it creates a new vertex group in the target object and iterates over all vertices in the source object. For each vertex, it checks if the vertex belongs to the current vertex group and finds the closest vertex in the target object. Finally, it sets the vertex weight using the new_group.add() method.

Please note that this code example assumes you have a find_closest_vertex function that can find the closest vertex in the target object. You will need to implement this function based on your specific requirements.

This method can help you copy vertex group information, but it may require some adjustments to fit your specific needs, especially when dealing with large meshes or when precise control over vertex weights is required [1][5].

The above may be able to give you a reference?