Hi,
I've been trying to change material projection for the materials added to take system, but it doesn't seem to be working. I can generate takes, add material tags, but when trying to change default spherical projection into uwv (using textag[c4d.TEXTURETAG_PROJECTION] = 6) - there is no effect. I also tried to move the code after group tag, and even make the current take active, and then modify the value of the projection - still the projection stays the same as before modification. I spent a few hours trying to find what's wrong , but unable to find any solution :-(
Here is my code snippet. Would be grateful if anyone could help me, by pointing me in the right direction.
if len(listOfMaterials2Swap) > 0:
for mat in listOfMaterials2Swap:
matOnTheScene = doc.SearchMaterial(mat)
if matOnTheScene is None:
print ("Mat : " + mat + " not found on the scene")
quit()
else:
#print ("Creating take for mat: " + mat)
if takeData is not None:
materialTake = takeData.AddTake(roomName + "_" + mat, parentTake, None)
if materialTake != None:
group = materialTake.AddOverrideGroup()
group.SetName("Take for " + roomName + "_" + mat)
group.SetEditorMode(c4d.MODE_ON)
group.SetRenderMode(c4d.MODE_ON)
textag = c4d.TextureTag()
for currentMeshName in listOfMeshes4MatSwap:
currentMesh = doc.SearchObject(currentMeshName)
currentMesh.KillTag(5616)
currentMesh.InsertTag(textag) #Remove texture tag for current object, if already there
textag[c4d.TEXTURETAG_PROJECTION] = 6 #Change current projection to UVW
group.AddToGroup(takeData, currentMesh)
group.AddTag(takeData,c4d.Ttexture,matOnTheScene)