Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
GetClone creates a take from a source take but its overrides are linked to source take. if I remove overrides from cloned take, original take's overrides also deleted. Is this a bug or GetClone produces a kind of instance object with linking to source object? How can I fix this? How can I break them from the source take?
import c4d # Script clones selected take to under Main Take # AliasTrans did not work #trans = c4d.AliasTrans() #if trans is None or trans.Init(doc) is False: # return False #clonedTake=selectedTake[0].GetClone(c4d.COPYFLAGS_0) #trans.Translate(False) def main(): takeData = doc.GetTakeData() mainTake=takeData.GetMainTake() selectedTake=takeData.GetTakeSelection(0) doc.StartUndo() doc.AddUndo(c4d.UNDOTYPE_CHANGE, mainTake) clonedTake=selectedTake[0].GetClone(c4d.COPYFLAGS_0) clonedTake.InsertUnder(mainTake) doc.EndUndo() c4d.EventAdd() #gui.MessageDialog('Hello World!') # Execute main() if __name__=='__main__': main()
test.c4d
Hi @delizade,
thank you for reaching out to us. There are two problems with your code:
C4DAtom.GetClone()
GeListNode.InsertUnder()
TakeData.AddTake()
cloneFrom
AddTake
According to one our devs, No. 2 seems to be a Python bug and not a limitation, we will investigate that. For now you would have to clone the two child takes under the main take manually in Python (and add a parent take beforehand if you want this structure). Because otherwise you will end up with two "root/main" takes in your document, confusing Cinema 4D
Cheers, Ferdinand
without further questions or feedback, we will consider this thread as solved by Monday and flag it accordingly.