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).
I was able to solve it by searching the DescID in the Cloner Description with the Inheritance Name.
@ferdinand Thank you so much. Adding:
inheritance1.Message(c4d.MSG_MEUPREPARE, doc)
Solved the issue.
@ferdinand Thank you so much, looking forward to your reply.
@ferdinand Is the information that I have provided sufficient?
@ferdinand This is the part of the code corresponding to the set issue.Inheritance_error.c4d
inheritance1 = c4d.BaseObject(1018775) inheritance1_Name = 'Inheritance-'+str(number)+ '_1' inheritance1.SetName(inheritance1_Name) # Set the first inheritance name. inheritance1.InsertUnder(null) # Insert the first inheritance under the null. inheritance1[c4d.MGINHERITANCEEFFECTOR_OBJECT] = cloner # Set the first inheritance Effector Object to the transition cloner. inheritance1[c4d.MGINHERITANCEEFFECTOR_MORPHMG] = True # Set the first inheritance Effector Morph Motion Object to True. inexcludedata1 = clonerbase[c4d.ID_MG_MOTIONGENERATOR_EFFECTORLIST] # Get the cloner base Effectors List inexcludedata1.InsertObject(inheritance1, 1) # Insert the first inheritance in the Effectors List clonerbase[c4d.ID_MG_MOTIONGENERATOR_EFFECTORLIST] = inexcludedata1 # Set the cloner base Effectors List. InheritanceID1 = find_DescID(clonerbase, inheritance1_Name) Inheritance1Track = c4d.CTrack(clonerbase, InheritanceID1) # Get the CTrack of the base cloner for the first inheritance. clonerbase.InsertTrackSorted(Inheritance1Track) Inheritance1Curve = Inheritance1Track.GetCurve() # Get the curve of the base cloner for the first inheritance. time = c4d.BaseTime(frames[0] - 1, doc.GetFps()) clonerbase[InheritanceID1] = 0.0 # Set the strength of the first inheritance to 0. dictKey = Inheritance1Curve.AddKey(time) key = dictKey['key'] Inheritance1Track.FillKey(doc, clonerbase, key) # Set the keyframe of the base cloner first inheritance strength. time = c4d.BaseTime(frames[0], doc.GetFps()) clonerbase[InheritanceID1] = 1.0 # Set the strength of the first inheritance to 1. dictKey = Inheritance1Curve.AddKey(time) key = dictKey['key'] Inheritance1Track.FillKey(doc, clonerbase, key)# Set the keyframe of the base cloner second inheritance strength.
I have not shared all the code as this code is not meant to be public.
I also have attached a Cinema 4D file where after the script run the inheritance works, but after a project save, close Cinema 4D reopen Cinema 4D, and the project, the inheritance does not work.
Inheritance_error.c4d
Hi, I have a python script that creates inheritances with keyframes. All these work and get represented in the viewport, however when I save the project, close Cinema 4D, and then reopen the project, the inheritances are there with the keyframes, but their effects are not represented.
And this only happens to the inheritances created by the script, manually created inheritances do work.
What could be the issue?
Thank you for your time. Joel.
I am trying your code however I am getting ReferenceError: the object 'c4d.PointTag' is not alive. What could be the issue?
ReferenceError: the object 'c4d.PointTag' is not alive
Hi,
I am tasked with obtaining the position of spline points from the PLA keyframes of the set spline.
From the SDK, I ended up at a <c4d.PLAData object at 0x000001B118B7F2C0> But I do not know how to extract the spline points' positions from this PLAData object.
<c4d.PLAData object at 0x000001B118B7F2C0>
Code to get the PLAData object:
import c4d def get_PLAData(): spline = doc.SearchObject('Spline') track = None PLA = c4d.DescID(c4d.DescLevel(c4d.CTpla, c4d.CTpla)) tracks = spline.GetCTracks() for t in tracks: tid = t.GetDescriptionID() if tid[0] == PLA[0] : track = t curve = track.GetCurve() for i in range(curve.GetKeyCount()): key = curve.GetKey(i) data = key.GetGeData() print(data[c4d.CK_PLA_DATA]) def main(): get_PLAData() if __name__=='__main__': main() c4d.EventAdd()
I also tried setting the document time with doc.SetTime(key.GetTime()) and then spline.GetAllPoints() but I am getting the same points' positions all the time.
doc.SetTime(key.GetTime())
spline.GetAllPoints()
What am I doing wrong? Or how can I get the points' positions from the PLAData Object?
Thank you for your time.
Thank you so much for the information. If further information is needed I will reopen this question.
Thank you so much. All further communications will be done via email.