@ferdinand Thank you for this; it makes things much clearer. I am very grateful we have the forum to clarify these issues.

blastframe
@blastframe
Posts made by blastframe
-
RE: CCurve.FindPrevUnmuted & CCurve.FindNextUnmuted
-
RE: Updating F-Curves in Timeline on EditSlider Drag
@m_magalhaes said in Updating F-Curves in Timeline on EditSlider Drag:
hi @blastframe
You should use
EVMSG_CHANGE
instead ofEVMSG_FCURVECHANGE
c4d.GeSyncMessage(c4d.EVMSG_CHANGE)
Cheers,
ManuelHi Manuel, that was simple, thank you very much! That's a bit confusing though because I'm changing an F-Curve. What's
c4d.EVMSG_FCURVECHANGE
for then? -
Updating F-Curves in Timeline on EditSlider Drag
Hello,
I have a script that updates the keyframe at the current time's value while dragging an EditSlider. Is it possible to also update the keyframe in the Timeline while dragging? Currently the associated object updates in the Viewport using c4d.DrawViews but the keyframe in the F-Curve Timeline only updates on release of the EditSlider's handle. Here is the code I'm using to redraw:c4d.DrawViews(c4d.DRAWFLAGS_NO_THREAD | c4d.DRAWFLAGS_FORCEFULLREDRAW) c4d.GeSyncMessage(c4d.EVMSG_FCURVECHANGE) c4d.EventAdd(c4d.EVENT_ANIMATE)
Thank you!
-
CCurve.FindPrevUnmuted & CCurve.FindNextUnmuted
Hello,
I am trying to use CCurve.FindPrevUnmuted & CCurve.FindNextUnmuted. In this example based on @m_magalhaesCreateKey
demo, I'm passing the middle key's index to these respective methods. Both return the middle key which is unexpected. Based on the documentation, FindPrevUnmuted should return the previous unmuted key and FindNextUnmuted should return the next unmuted key using the index parameter as the starting index. Am I using this incorrectly or is something else going wrong? Thank you!import c4d def CreateKey(curve, time, value, interpolation): keyDict = curve.AddKey(time) if keyDict is None: raise MemoryError("Failed to create a key") key = keyDict["key"] keyIndex = keyDict["nidx"] key.SetValue(curve, value) curve.SetKeyDefault(doc, keyIndex) key.SetInterpolation(curve, interpolation) return key, keyIndex def main(): obj = c4d.BaseObject(c4d.Ocube) trackY = c4d.CTrack(obj, c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_Y, c4d.DTYPE_REAL, 0))) curveY = trackY.GetCurve() keyA, keyAIndex = CreateKey(curveY, c4d.BaseTime(0), value=0, interpolation=c4d.CINTERPOLATION_SPLINE) keyBTime = c4d.BaseTime(10, doc.GetFps()) keyB, keyBIndex = CreateKey(curveY, keyBTime, value=100, interpolation=c4d.CINTERPOLATION_SPLINE) bt = c4d.BaseTime(5, doc.GetFps()) keyDict = curveY.AddKeyAdaptTangent(bt, True, True) # -------------- # prevKey = curveY.FindPrevUnmuted(keyDict["nidx"]) nextKey = curveY.FindNextUnmuted(keyDict["nidx"]) print("prevKey index:",prevKey[1],", prevKey value:",prevKey[0].GetValue()) #returns keyDict's values print("nextKey index:",nextKey[1],", nextKey value:",nextKey[0].GetValue()) #returns keyDict's values # -------------- # obj.InsertTrackSorted(trackY) doc.InsertObject(obj) c4d.EventAdd() if __name__ == '__main__': main()
-
RE: Creating a Keyframe similar to Ctrl-Clicking the Curve
@ferdinand That was exactly what I was seeking, thank you, Ferdinand!
-
Creating a Keyframe similar to Ctrl-Clicking the Curve
Hello,
When in the Timeline, if I hold Ctrl/Cmd and click on the curve, Cinema 4D adds a keyframe that matches the contour of the curve perfectly.
The tangents of the new key and neighboring keys are properly weighted.
When I try to do this with the code below, I get a keyframe whose angles do not match the curve and where the Left & Right times of the neighboring keys are not adjusted.
keyDict = keyCurve.AddKey(keyTime) keyIndex = keyDict["nidx"] key = keyDict["key"] key.SetValue(keyCurve,value) key[c4d.ID_CKEY_PRESET] = c4d.ID_CKEY_PRESET_NEWAUTOWEIGHTED
Result:
The tangents of the key seem to be weighted properly using
ID_CKEY_PRESET_NEWAUTOWEIGHTED
, but how can I get the angle of the tangents to match the curve and the Left & Right Time of the neighboring keys to adjust so the curve's contour doesn't change as in the Ctrl-Click key creation scenario?Thank you!
-
Description & Example in Documentation for CCurve.AddKey
Hello,
I wanted to report an error in the documentation for CCurve.AddKey. It currently describes it as Find a writable key by time. which is the same description as CCurve.FindKey. The code example also seems to be for CCurve.FindKey as it does not use theadded
variable in the example, but thefound
one. -
RE: Request: Combobox Icons
@zipit "it would be impossible for a developer to know otherwise from just the documentation."
-
RE: Request: Combobox Icons
@zipit Thank you for the reply. That is exactly what I was I was seeking.
I think the documentation for GeDialog.AddChild should explain this ampersand operation as it would be impossible for a developer to know otherwise from just the documentation. It just says:
child (str) – Name of the item to add.
The
iconid
syntax is mentioned in the UserData Properties so the inconsistency is confusing:
I have added the tag you requested.
-
Request: Combobox Icons
Hello,
Unless I'm missing something, it seems like Comboboxes/Integer Cycle dropdowns have the option for icons everywhere they appear except in GeDialog. I'd like to request that you add this icon option to the GeDialog please as they are very informative & quickly scannable to the user, particularly with long lists.Thank you!