THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/10/2011 at 08:54, xxxxxxxx wrote:
Hi there,
Is there a way to change the texture in the color channel of a material using python.
Currently i'm writing a script where there is a variable on my clipboard wich is used to build up a document.
If my question isn't clear, let me know.
Much thanx in advance.
Kind regards RNE
Script so far:
from c4d import gui, bitmaps, documents
import c4d
c4d.StopAllThreads()
c4d.StatusSetSpin()
c4d.StatusSetText("Starting script")
datanaam = c4d.GetStringFromClipboard()
c4d.CallCommand(1024314) # Clear Python Log
c4d.CallCommand(1022604) # Open Python Log
klaar maken om te renderen
doc = documents.GetActiveDocument()
rd = doc.GetActiveRenderData()
instellen van de rendersettings op basis van de texture
c4d.StatusSetText("Adjusting render settings")
currpath=''+rd.GetDataInstance()[c4d.RDATA_MULTIPASS_FILENAME]
currpath=''+doc[c4d.DOCUMENT_PATH]+'/'
rd[c4d.RDATA_MULTIPASS_SAVEIMAGE] = 1 # 1=aan 0=uit
rd[c4d.RDATA_MULTIPASS_FILENAME] = r''+currpath+"Renders/"+datanaam+'.psd'
c4d.EventAdd()
#changing the texure
klaar maken om te renderen
doc = documents.GetActiveDocument()
#save the current document as a c4d file
c4d.documents.SaveDocument(doc, currpath+"CinemaFiles/"+datanaam+".c4d", c4d.SAVEDOCUMENTFLAGS_DIALOGSALLOWED, c4d.FORMAT_C4DEXPORT)
doc = c4d.documents.GetActiveDocument()
lijst=c4d.documents.GetBatchRender()
lijst.AddFile(currpath+"CinemaFiles/"+datanaam+".c4d",0)
c4d.documents.BatchRender.Open(lijst)
c4d.StatusSetText("Added to renderlist")
c4d.documents.CloseAllDocuments()
c4d.CallCommand(465003513); # start render queue