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
    1. Maxon Developers Forum
    2. MMayrh
    3. Topics
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by MMayrh

    • M

      How to set the active documents preview image

      Cinema 4D SDK
      • windows python • • MMayrh
      2
      0
      Votes
      2
      Posts
      369
      Views

      ferdinandF

      Hey @MMayrh,

      Thank you for reaching out to us. This is not how this parameter works. The parameter DOCUMENT_PREVIEW_IMAGE is of data type BitmapButtonStruct, not of BaseBitmap.

      54c636b2-05c8-4e3a-af41-9edf7e80bd24-image.png

      The documentation is a bit misleading here. This is not the document preview bitmap, but sort of the preview bitmap delegate. I.e., an entity that is used to retrieve a preview bitmap (for a document in this case). A BitmapButtonStruct wraps a node, an ID, and a dirty flag.

      3e4681a7-7db6-45b7-a1da-5279cc028cf2-image.png

      This parameter does not make too much sense in the Python API, here is what the C++ API does when the parameter is access for a document:

      459e7ff6-a8fe-4abf-ae35-adc803c17170-image.png

      I.e., it returns itself (the doc), the ID of the parameter (DOCUMENT_PREVIEW_IMAGE) and the dirty state of its internal current preview bitmap as the BitmapButtonStruct bbs. What you could technically try, is implement a node, e.g., an object, and then set that object as the preview provider for a document. Your node would for that have to implement MSG_DESCRIPTION_GETBITMAP, because that is what effectively will be called. But that is all very theoretical, DOCUMENT_PREVIEW_IMAGE is largely unused in our code base, and I do not see any implemnation for the SetParameter part. So, the document will likely just ignore you trying to overwrite its preview provider. There could be some base implemenation kicking in, but I doubt it.

      But what you definitely cannot do, is just set there a bitmap to overwrite the preview image of the document (assuming that was what you wanted to do). That would also not make too much sense since a document is constantly recalculating its preview image. So, on the next update that image would be gone (if it would work like that).

      Cheers,
      Ferdinand

    • M

      Python plugin in costum C4D-Layout

      Cinema 4D SDK
      • 2024 python windows • • MMayrh
      3
      0
      Votes
      3
      Posts
      598
      Views

      M

      @ferdinand thank you for your welcoming words, for your help and edits.

      Since I am no trained developer I was simply copy and pasting my first lines of code including the RegisterCommand function from the maxon python example github and thought it would fit my application since I thought the description in the sdk seemedlike a match to me ["Command can be dragged into an icon bar and delivers its own dialogs instead of icons." (- maybe I got that wrong)]. Also scince I have little developing experience the term "smallnode" is nothing I can make sense of and an accurate description seems to be missing.

      Nevertheless I tried your suggestion and it works like a charm.

      Thanks a lot 🙌
      Marc