I am trying to modify an object after importing it. This post is related to this question
import bpy full_path_to_file = "C:\\Users\\xyz\\Documents\\test.obj" bpy.ops.import_scene.obj(filepath=full_path_to_file) # create the material mat = bpy.data.materials.new('MaterialName') mat.diffuse_color = (1.0,0.0,1.0) mat.diffuse_shader = 'LAMBERT' mat.diffuse_intensity = 1.0 # get the object obj = bpy.data.objects['Cube'] # get the material mat = bpy.data.materials['MaterialName'] # assign material to object obj.data.materials.append(mat)
I wanted to add a material to the imported object but that is not happening. So I tried to scale it even that is not happening.
I realized that no operation is being performed on the imported objects. But the same operations are executing on the objects that are created (i.e. not imported).
Any help would be appreciated.