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

    Different initGLImage for each object

    SDK Help
    0
    3
    259
    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
      Helper
      last edited by

      On 22/09/2015 at 06:28, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello.

      I have created a material plugin and whenever i assign that material to an object the initGLImage runs to calcualte the bitmap that will be used in the viewport.
       
      I want different image based on each object.
      Can i do that somehow ?

      As i see, even though i assign the same material in multiple objects, initGLImage runs only once.

      Thank you.

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

        On 22/09/2015 at 11:45, xxxxxxxx wrote:

        I think it is doable.

        in simplematerial example, check for MATPREVIEW_MODIFY_CACHE_SCENE
        depending on the scene, you can set a member with the required data.
        make sure to copy that member "CopyTo function"

        using that member, you can change the initGLImage behavior.

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

          On 23/09/2015 at 02:11, xxxxxxxx wrote:

          Hello,

          don't confuse the material preview image of the material editor with the OpenGL preview image. The OpenGL preview image is used to create a preview of a complex material in the interactive viewport. This bitmap is stored with the material and is only created for the material, not for each material/object combination.

          Best wishes,
          Sebastian

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