Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. blastframe
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    blastframe

    @blastframe

    14
    Reputation
    281
    Posts
    204
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Website www.blastframe.com Location Burbank, CA

    blastframe Follow

    Posts made by blastframe

    • RE: CCurve.FindPrevUnmuted & CCurve.FindNextUnmuted

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

      posted in Cinema 4D Development
      blastframe
    • 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 of EVMSG_FCURVECHANGE

      c4d.GeSyncMessage(c4d.EVMSG_CHANGE)
      

      Cheers,
      Manuel

      Hi 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?

      posted in Cinema 4D Development
      blastframe
    • 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!

      posted in Cinema 4D Development
      blastframe
    • CCurve.FindPrevUnmuted & CCurve.FindNextUnmuted

      Hello,
      I am trying to use CCurve.FindPrevUnmuted & CCurve.FindNextUnmuted. In this example based on @m_magalhaes CreateKey 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()
      
      posted in Cinema 4D Development
      blastframe
    • RE: Creating a Keyframe similar to Ctrl-Clicking the Curve

      @ferdinand That was exactly what I was seeking, thank you, Ferdinand! 😄

      posted in Cinema 4D Development
      blastframe
    • 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.
      Curve2.jpg

      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:
      10972325-56f5-40c8-b50f-b32d3025c6bd-image.png

      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!

      posted in Cinema 4D Development
      blastframe
    • 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 the added variable in the example, but the found one.

      posted in Cinema 4D Development
      blastframe
    • RE: Request: Combobox Icons

      @zipit "it would be impossible for a developer to know otherwise from just the documentation."

      posted in Cinema 4D Development
      blastframe
    • 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:
      674f7908-a6ec-4ef8-8ff3-5bd8e23ba066-image.png

      I have added the tag you requested.

      posted in Cinema 4D Development
      blastframe
    • 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!

      posted in Cinema 4D Development
      blastframe