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

    Loading bitmaps from object data through a shader?

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 515 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 03/01/2018 at 08:44, xxxxxxxx wrote:

      Hi,

      I'm currently trying to write a ShaderData plugin that, at render time, retrieves a string from an object's user data (or alternatively, a custom TagData), and uses that string (appended to a filepath) to return a bitmap specific to the object. I'm envisioning this working similarly to the MoGraph Color Shader, where the data used during rendering comes from the object, and the data reference is relative, meaning the same shader can be used on multiple objects with different results. Is this possible with PYTHON? Is a ShaderData plugin the best way to go about this and, if so, how do I access the object's data from the shader?

      Thanks,
      Ben

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

        On 04/01/2018 at 07:51, xxxxxxxx wrote:

        Hi Ben, thanks for writing us.

        First of all welcome to our discussion forum as an active participant.

        With regard to your request, I confirm that your assumption is correct and ShaderData would definitively be the easier and most effective way to go if it would be in C++. Unfortunately current Python API comes with a limited set of exposed classes with regard to VolumeData and more specifically it lacks the RayObject class as well as the VolumeData::GetObj() method.
        These twos are vital to retrieve the object (or its instances) currently using the ShaderData instance being under evaluation at render time (i.e. during the ShaderData::Output() execution).

        So far there's no workaround in Python that could make the trick.

        Best, Riccardo

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

          On 04/01/2018 at 10:25, xxxxxxxx wrote:

          Thanks so much for the warm welcome, and for getting back to me so quickly!

          While I may not be able to do it in Python, I'm glad to hear that it is at least theoretically possible using C++. Coming from a Java background, picking up C++ shouldn't be too difficult, and I should be able to repurpose my knowledge of C4D's Python API.

          Cheers,
          Ben

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