Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. aug
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    aug

    @aug

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    aug Unfollow Follow

    Latest posts made by aug

    • Keyframing the source file on an ImageTexture shader

      I have this Octane material with a ImageTexture shader.
      I can programmatically set the source file on the shader.
      I want to be able to Keyframe this source file.
      Here's what I got so far:

      def changeTexture(shader, item, chosen, curTime) :
      
          doc = shader.GetDocument()
          doc.AddUndo(c4d.UNDOTYPE_CHANGE, shader)
          filepath = f'{item}_{chosen}.png'
          # Assign the new value
          print(f'Applying texture: {filepath}')
          print (shader[c4d.IMAGETEXTURE_FILE])
          shader[c4d.IMAGETEXTURE_FILE] = filepath
          shader.Message(c4d.MSG_UPDATE)
          print(shader[c4d.IMAGETEXTURE_FILE])
      
          track = shader.FindCTrack(c4d.IMAGETEXTURE_FILE)
          if not track:
              track = c4d.CTrack(shader, c4d.IMAGETEXTURE_FILE)
              shader.InsertTrackSorted(track)
          print(track)
          curve = track.GetCurve()
          result = curve.FindKey(curTime)
          if result is None:
              result = curve.AddKey(curTime)
          print(result)
          track.FillKey(doc, shader, result['key'])
          c4d.EventAdd()
      

      This runs without bugs. The files do get changed but they're not keyframed. The first time I run this, the file keyframe indicator does show up orange. But not the subsequent times.

      posted in Cinema 4D SDK r25
      A
      aug