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

    Set Knot Value of RangeData, bug?

    Cinema 4D SDK
    r19 python
    2
    3
    579
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gsmetzer
      last edited by m_adam

      Hello, I am using a RangeData in my UserData. I am trying to set the value of a knot in the RangeData Gui but nothing is changing despite rs.SetSelectedKnot(knot) returning True.
      Is this a bug or am I doing something wrong? Thanks for any insight.
      (I'm using R19)

         rs = op[c4d.ID_USERDATA,1]   #get my rangeSlider
          
          
          v = op[c4d.ID_USERDATA,2]  #Get a Float
          rs.SetCurrentValue(v)
      
          print rs.GetCurrentValue()
          knot = rs.GetSelectedKnot()
          rs.SetKnotValue(knot, v)
          rs.SetSelectedKnot(knot)
          
      
          c4d.EventAdd()
      
      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @gsmetzer I've moved your topic since it's related to Cinema 4D API itself.
        I also added tags to your post and mark the topic as a question. Don't worry but the next time try to setup your topic correctly, see Q&A New Functionality and How to Post Questions.

        Regarding your issue, rs = op[c4d.ID_USERDATA,1] #get my rangeSlider performs a copy of the RangeData to the rs variable. So you have to assign it back at the end of your code op[c4d.ID_USERDATA,1] = rs

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • G
          gsmetzer
          last edited by

          Thank You,
          How embarrassing I forgot to write back to the UserData. (I shouldn't code late at night) Solved.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post