Hallo!
I need a bit help:
When i run my script example, it says: material are not define!
How i must define the material when i want to copy the name of the material to all selected objects?
class Copy_Materialname_to_Object(bpy.types.Operator):
"""Copy Material-Name to Object-Name"""
bl_idname = "tp_ops.copy_materialname_to_object"
bl_label = "Copy Material-Name to Object"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
selected = bpy.context.selected_objects
for obj in selected:
#find material name ???
#matname = bpy.context.active_object.active_material.name
#matname = mat.name
#for obj in matname:
#if matname:
#copy material name to all selected ???
mat.name = obj.name
return{'FINISHED'}
I know there is a way, i found it once and forgot where…
Thanks for any help!