Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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. reubenlara
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 9
    • Best 0
    • Controversial 0
    • Groups 0

    reubenlara

    @reubenlara

    0
    Reputation
    8
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    reubenlara Unfollow Follow

    Latest posts made by reubenlara

    • RE: R25 doesn't register the [c4d.ID_BASEOBJECT_COLOR] parameter

      @m_adam OK this is really weird. I tried this over and over yesterday for several hours. this morning it is working fine! It must have been a case of restarting my machine or something. All set on my end! Thanks for testing either way, much appreciated!

      posted in Cinema 4D SDK
      R
      reubenlara
    • R25 doesn't register the [c4d.ID_BASEOBJECT_COLOR] parameter

      As you can see from the attached image, R25 won't highlight the following parameter:

      [c4d.ID_BASEOBJECT_COLOR]
      

      I'm using this to programmatically change the Display Color of a null, but it doesn't highlight in orange in either the Script Editor (when I type it) or the Script Log (when I manually change the color to trace a call), and since it doesn't recognize it, it throws an error. The same script highlights orange and runs fine in R23. Unless I'm missing something, I believe this is a bug?

      c4d-ID_BASEOBJECT_COLOR.png

      posted in Cinema 4D SDK
      R
      reubenlara
    • RE: Python "undo" changes the original selection order

      @m_magalhaes ah ok thanks for the clarification. So, at this point, you can confirm that this is a bug and not a mistake in implementation on my part?

      posted in Bugs
      R
      reubenlara
    • RE: Python "undo" changes the original selection order

      @m_magalhaes Excellent thank you! Will you post the results here? Or is there a another link I should follow?

      posted in Bugs
      R
      reubenlara
    • Python "undo" changes the original selection order

      Hello! My script relies on selection order and works fine. however, when I undo and run the script again immediately, the selection order is changed (somewhat reversed), and it toggles the reversal consistently. Why is it doing this? And is there a way to make sure the selection order stays constant when re-invoking the script?

      You can see a clearer explanation of my problem:
      in this brief screen recording

      import c4d
      from c4d import gui
      
      def main():
      
      
          doc.StartUndo()
      
          selected = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_SELECTIONORDER)
      
          #print order of object names to console
          print ("start:")
          names = []
          for obj in selected:
              names.append(obj.GetName())
          print (names)
      
          #distribute objects
          for idx, ob in enumerate(selected):
              doc.AddUndo(c4d.UNDOTYPE_CHANGE, ob)
              print (ob.GetName())
      
              ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_X] = 0
              ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_Y] = 0
              ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_Z] = 0 + (idx * 1000)
      
      
          c4d.EventAdd()
          doc.EndUndo()
      
      if __name__=='__main__':
          main()
          c4d.EventAdd()
      
      posted in Bugs python
      R
      reubenlara
    • RE: Detect unicode character keypress in a Python script

      Ah yes thank you so much!

      posted in General Talk
      R
      reubenlara
    • RE: Detect unicode character keypress in a Python script

      @m_magalhaes Thank you! In your example of "Check for specific key pressed", instead of "c4d.KEY_F10", how can I can I check for a character key? I'd like to use GetInputState vs. GetInputEvent for my specific script.

      posted in General Talk
      R
      reubenlara
    • RE: Detect unicode character keypress in a Python script

      @reubenlara For that matter, maybe I'm going about it the wrong way with "BFM_INPUT_ASC"? How would I detect normal letters? Thank you!

      posted in General Talk
      R
      reubenlara
    • Detect unicode character keypress in a Python script

      Hello! I've successfully been able to detect modifier keys for my Phyton script, but can't figure out how to use "BFM_INPUT_ASC" to detect the letters "x", "y", and "z" (or any other character, for that matter). Where can i query this within the code below? Thank you!

      pressedKey = 'none'
      bc = c4d.BaseContainer()
      if c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.BFM_INPUT_CHANNEL,bc):
          if bc[c4d.BFM_INPUT_QUALIFIER] & c4d.QSHIFT:
              print("SHIFT PRESSED")
              pressedKey = "shift"
          if bc[c4d.BFM_INPUT_QUALIFIER] & c4d.QCTRL:
              print("CONTROL PRESSED")
              pressedKey = "control"
          if bc[c4d.BFM_INPUT_QUALIFIER] & c4d.QALT:
              print("ALT PRESSED")
              pressedKey = "alt"
      
      posted in General Talk
      R
      reubenlara