0
$\begingroup$

Blender 2.93 Spreadsheet Editor - how do you access the items displayed on the new spreadsheet editor. E.g. In my current setup using the spreadsheet editor to view the output of Geonodes there are three main columns "Name, Position, Rotation" - see pic. I'd like to view the column labelled "Names" to get a list of the Geonodes output which forms as a combination of a primitive mesh and a collection. There are two objects in the collection and depending on the seed value in the Geonode a different variation is displayed.

What data structures does the Spreadsheet use to generate the output and how can I access it?enter image description here

    import bpy

Ag = bpy.data.objects['GrpStk_01a']
#Ag.select_set(True)

#print( list(Act_Obj))
x = 1
depsgraph = bpy.context.evaluated_depsgraph_get()

Act_Obj = Ag.evaluated_get(depsgraph)

if x == 0:
    for attr in dir(depsgraph.ids):
         try:           
            print(str(attr), getattr(depsgraph, attr))
         except AttributeError:
            pass
    
if x == 1:
    for object_instance in depsgraph.object_instances:
        # This is an object which is being instanced.
        obj = object_instance.object
        #print(obj)
        # `is_instance` denotes whether the object is coming from instances (as an opposite of
        # being an emitting object. )
        if not object_instance.is_instance:
            print(obj.location)
            print(f"Object {obj.name} at {object_instance.matrix_world}")
        #    i+=1
            #print("This is the number of objects found", i)
        else:
            # Instanced will additionally have fields like uv, random_id and others which are
            # specific for instances. See Python API for DepsgraphObjectInstance for details,
            print(obj.location)
            print(obj.delta_location)
            print(f"Instance of {obj.name} at {object_instance.matrix_world}")
            
            #for attr in dir(obj):               
             #       print(str(attr), getattr(obj, attr))
            
            #if Ag.data == obj.data:
             #   print( "This Instance belongs to the collection")     
              #  for attr in dir(obj):               
                #   print(str(attr), getattr(obj, attr))

if x == 2:
    for In_j in depsgraph.ids:
        if In_j.name == "GrpStk_01a":
            print(In_j.name)
            
            for attr in dir(In_j.modifiers.bl_rna):
                 try:           
                    print(str(attr), getattr(In_j, attr))
                 except AttributeError:
                    pass
$\endgroup$
3
  • $\begingroup$ I've managed to get the output of the full list on instances but I can't identify any attributes which links it to any primitive mesh or collection. This makes it difficult to match the instance to a specific object / mesh group. $\endgroup$ Commented Aug 25, 2021 at 1:13
  • $\begingroup$ blender.stackexchange.com/questions/228137/… $\endgroup$
    – batFINGER
    Commented Aug 25, 2021 at 16:49
  • $\begingroup$ Appreciate the help and the link. I still haven't found what I'm looking for in that I'm unable to decipher how to access the name property for the instance object linked to mesh. I can find the list of Object_Instances but I can't figure out how to tie it to a mesh and iterate through that specific group of items. which forms as a result of a Geonode modifier. I'm spending hours just searching... help... $\endgroup$ Commented Aug 26, 2021 at 19:18

0

You must log in to answer this question.

Browse other questions tagged .