I’m trying to do some batch converting in Blender. I’m quite new to Blender but in the need of some simple guidance :o
I’m importing an .obj file. Applying a material and a texture and then exporting again. I’ve come to importing the file and creating a new material etc but now I need to apply it to the imported object. But how do I access the object functions for the imported object?
The code I’m using now gives:
AttributeError: ‘NoneType’ object has no attribute ‘setMaterials’
This is my code:
import Blender
from Blender import Scene, Object, Material
import import_obj
ob = import_obj.load_obj(‘/home/arnaud/Documents/z25/bodycount/scans/Arnaud/scan
_faceFrnt_scl8_tst02.obj’,CLAMP_SIZE=10.0)
print(ob)
mat = Material.New(‘gezichtMat’)
mat.rgbCol = [0.8, 0.2, 0.2]
ob.setMaterials(mat)
Blender.Redraw()