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

    Apply Substance Preset with no User Input.

    Cinema 4D SDK
    3
    5
    669
    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.
    • J
      janine.mcmaster
      last edited by janine.mcmaster

      I would like to apply a substance preset (.sbsprs) using the python API. I can use c4d.CallCommand(1038417) to open the Substance asset manager but it just opens up file explorer to allow me to select and apply a .sbsprs file. I want to be able to run my script with no user input (just a hardcoded filepath to the substance preset file). Is it possible to apply the substance preset using just python?

      I am using Cinema 4D R23.110 and Redshift. Thanks!

      1 Reply Last reply Reply Quote 0
      • J
        janine.mcmaster
        last edited by

        Sorry forgot to say I'm using the Script Manager and Windows 10 Pro 2004.

        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by Manuel

          Hi,

          Please use our guidelines and use the forum functionalities to mark your thread as a question. Thanks for tagging your post 🙂

          while we have a module for substance available in python it is not possible to apply presets with it (without dialog). Even with C++ it's not possible

          But Substance asset are BaseList2D so you can change the parameters:

              substance = c4d.modules.substance.GetFirstSubstance(doc)
              if substance is None:
                  raise RuntimeError("Failed to retrieve the first substance (most likely there is no substance).")
              #change the resolution to 16x16
              substance[10000] = 4 
              substance[10001] = 4
              
              c4d.EventAdd()
          

          Cheers,
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • J
            janine.mcmaster
            last edited by

            Thank you for letting me know 😞

            1 Reply Last reply Reply Quote 0
            • ferdinandF
              ferdinand
              last edited by

              Hello @janine-mcmaster,

              without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly.

              Thank you for your understanding,
              Ferdinand

              MAXON SDK Specialist
              developers.maxon.net

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