Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/08/2019 in all areas

  1. And this is what happens, when you click on "Disclaimer" on my next homepage... Physical render, Marvelous designer for the suit.
    3 points
  2. No idea actually. Haven't been able to practice on those fields yet. EDIT: You can make a paperclip in about 50 seconds. Here's how: https://we.tl/t-vphJSnEaOw (link contains a quicktime movie)
    1 point
  3. Firstly thing - There is no way to directly access and change the value of the dropdown for the render setting within the Batch Renderer with Python AFAIK. Which means that while it's not very efficient your approach is not terrible when dealing with a body of files, don't feel bad about it, if it works then that's more important than if it works efficiently. Now onto ways you could improve your code : For a start I don't see anything in your script accessing the batch renderer to get the file. So that's done first by using the "GetBatchRender" function, e.g. batchRender = c4d.documents.GetBatchRender() count = batchRender.GetElementCount() for i in range(count): fileName = batchRender.GetElement(i) This goes through the whole list, but perhaps you only want to deal with the first (top most, just about to render) document, in which case you wouldn't do the for loop but would just do fileName = batchRender.GetElement(0). Next, you can just load in and save the file more directly than using CallCommand using the c4d.document.LoadDocument(file, flags). myDoc = c4d.documents.LoadDocument(fileName, c4d.SCENEFILTER_PROGRESSALLOWED) if myDoc is None: return At this point you now have an opened document and can see the progress as the file is loaded in. Your next step is to switch out the render data in that document. Just use the code you already have for that, it's fine. You shouldn't need the EventAdd() function calls in there though. The final step is to re-save your document, this time rather than using CallCommand again you can do it directly. With c4d.document.SaveDocument(doc, file, flags, format) result = c4d.documents.SaveDocument(myDoc, fileName, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT) if result is False: return At this point you should be able to start the batch render and be good to go. If you want you can do this programmatically again without having to use CallCommand by accessing the BatchRender object's SetRendering() function i.e. batchRender.SetRendering(c4d.BR_START) should do the job.
    1 point
×
×
  • Create New...

Copyright Core 4D © 2024 Powered by Invision Community