I have 645 objects and I would like to repeat the same commands for each one.
I followed this tutorial: Is there a way to repeat a set of actions on an object?
But the script gives me an error.
import bpy
bpy.ops.material.new()
bpy.ops.node.add_node(type="ShaderNodeAttribute", use_transform=True)
bpy.ops.node.translate_attach_remove_on_cancel(TRANSFORM_OT_translate={"value":(-1405.21, -1784.65, 0), "orient_type":'GLOBAL', "orient_matrix":((1, 0, 0), (0, 1, 0), (0, 0, 1)), "orient_matrix_type":'GLOBAL', "constraint_axis":(False, False, False), "mirror":True, "use_proportional_edit":False, "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "use_proportional_connected":False, "use_proportional_projected":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "cursor_transform":False, "texture_space":False, "remove_on_cancel":True, "release_confirm":False, "use_accurate":False, "use_automerge_and_split":False}, NODE_OT_attach={}, NODE_OT_insert_offset={})
bpy.data.materials["Materiale"].node_tree.nodes["Attributo"].attribute_name = "Col"
bpy.ops.node.link(detach=False)
So I run these commands for one object, then select the others and run the script, but it gives me an error.
I don't know how to use Blender or Python well but I need it for my thesis work.
Thanks to anyone who wants to help me.