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
    • Recent
    • Tags
    • Users
    • Login

    Set Material Preview

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 683 Views
    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.
    • H Offline
      Helper
      last edited by

      On 09/03/2013 at 11:37, xxxxxxxx wrote:

      I'm trying to change the preview of a material from the normal sphere object in python. I found some documentation on it in the C++ documentation under MaterialPreviewType but i'm not sure I have the knowledge to implement that yet. Can anyone help or point me in the right direction? Thanks!

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 09/03/2013 at 14:19, xxxxxxxx wrote:

        MaterialPreviews are a CustomGui / CustomDataType which is not wrapped for Python. Basically

        you would read/write it with mymaterial[c4d.MATERIAL_PREVIEW], but as i said it is not wrapped.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 09/03/2013 at 14:58, xxxxxxxx wrote:

          Thanks Little Devil, that seems a bit beyond me at this point. I'll take another look when I understand more about Python.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 01/04/2016 at 17:22, xxxxxxxx wrote:

            Is the material preview type still inaccessible from Python?

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 04/04/2016 at 02:19, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              Is the material preview type still inaccessible from Python?

              I'm afraid the Python API still doesn't support the MaterialPreviewData type.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 07/11/2016 at 23:13, xxxxxxxx wrote:

                And is there any way to access the general c4d settings to change the default material preview ?

                EDIT:
                Nevermind, got it 🙂

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 08/11/2016 at 01:32, xxxxxxxx wrote:

                  Hello,

                  one can change the global settings by accessing the world container. Please notice that "custom" material preview scenes have to be set differently than default material preview scenes.

                    
                  worldContainer = c4d.GetWorldContainerInstance()  
                    
                  # set a default value  
                  worldContainer.SetInt32(c4d.WPREF_MATPREVIEW_DEFAULTOBJECT_MAT, c4d.MatPreview2Torus)  
                    
                  # or set a custom scene  
                  worldContainer.SetInt32(c4d.WPREF_MATPREVIEW_DEFAULTOBJECT_MAT, c4d.MatPreviewUser)  
                  worldContainer.SetString(c4d.WPREF_MATPREVIEW_DEFAULTUSERSCENE_MAT, "Cylinder (GI)")  
                    
                  c4d.EventAdd()  
                  

                  best wishes,
                  Sebastian

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