Jump to content

coljwood

New Member
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Poor

Profile Information

  • First Name
    Colin
  • Last Name
    Wood
  • C4D Ver
    None
  1. coljwood

    Takes -

    How many overrides does the parent have? It may be quicker for you to simply clone the child take that has all of the material overrides, rename to the same as the parent and then move all the child takes to this new clone. Then you can add any lost overrides to the new parent take, assuming that the parent didn't have many/any overrides itself. There is probably a way of scripting to do it automatically - over the next few months i'm going to be working on some scripts to improve large project workflows using the take system, so i'll look into adding this functionality (obviously another solution would be needed short term).
  2. I'm practicing some Python scripting at the moment on a little side project (i'm a novice), and i've come across a stumbling block. I'm looking for a way in Python to get a BaseTake object by searching for the take by name (i'm probably not using any official terms here). I've search the documentation and couldn't see anything obvious, but the fact I don't really know what i'm doing doesn't help. I'll shed a little light on what i'm trying to achieve, as it could be i'm trying to approach things the wrong way. Essentially I want to create copies of the following format: Take 1-1 Take 1-2 Take 1-3 Take 1-3 Take 1-3 Take 1-2 Take 1-3 Take 1-3 Take 1-3 Take 1-2 Take 1-3 Take 1-3 Take 1-3 The top level take (Take 1-1) is the one I am aiming to copy x amount of times, and the name of this will change accordingly (will move onto this shortly). All children of this main take will need to be copied to the new take(s), but they will need to be identical. I want a system where I can create a template take containing these children, and copy these to newly created takes with one click. If I were to update these child takes at any point, I can remove them from the newly created takes, updated the children takes stored in the template, then run the script to copy them back over. The other step, which i'm pretty close to achieving, is to give the newly created top level takes an automatic name based on the name of corresponding render setting (done), and then automatically assign that render setting to the newly created take (not done). The reason I can't find a way to assign the render setting to the newly created take is because I don't know how to reference the take once it is created - I assumed searching for it by name would do the job, hence this post (although I assume duplicate take names would cause complications?). Code below: import c4d from c4d import gui #Welcome to the world of Python doc = c4d.documents.GetActiveDocument() ts = c4d.modules.takesystem #Get selected render setting rs = doc.GetActiveRenderData() #Create list from all children of render setting rsch = rs.GetChildren() #Get Take Data td = doc.GetTakeData() def main(): #Cycle through each render setting for rs in rsch: #Assign new take name to match render setting tkName = rs.GetName() #Create new take with assigned name td.AddTake(tkName,None,None) #Add corresponding render settings to newly created take ???.SetRenderData(td, rs) if __name__=='__main__': main() c4d.EventAdd() Feel free to pick apart the code as much as you can - I imagine there is a lot of dodgy stuff i'm doing here! Thanks!

×