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

    Change Hair preferences with Python API

    Cinema 4D SDK
    python r20
    3
    3
    840
    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.
    • mikeudinM
      mikeudin
      last edited by mikeudin

      Hello everybody! There is any idea how it possible to change Hair preferences using python api?
      Using Script Log i get this code. But its not working unlike other preferences 😒

      import c4d
      
      def main():
          def tool():
              return c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL)
      
          def object():
              return doc.GetActiveObject()
      
          def tag():
              return doc.GetActiveTag()
      
          def renderdata():
              return doc.GetActiveRenderData()
      
          def prefs(id):
              return c4d.plugins.FindPlugin(id, c4d.PLUGINTYPE_PREFS)
      
          tag()[c4d.HAIR_PREFS_SETUP_TOCHILD] = True #why tag() unlike prefs(id)???
          prefs(465001634)[c4d.PREF_BROWSER_SHOWFOLDER] = False #this preferences parameter works
      
      if __name__=='__main__':
          main()
      

      Thanks!

      Checkout my python tutorials, plugins, scripts, xpresso presets and more
      https://mikeudin.net

      merkvilsonM 1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @mikeudin, I'm afraid there is a limitation in the Python API(PrefDialogObject is missing in Python) that prevents to change the hair preferences.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • merkvilsonM
          merkvilson @mikeudin
          last edited by

          @mikeudin
          We all have to learn C++ 😅

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