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

    Topics created by cybor09

    • C

      How to access Volume Data?

      Cinema 4D SDK
      • • • cybor09
      3
      0
      Votes
      3
      Posts
      867
      Views

      C

      Hello @ferdinand ,

      First of all thanks a lot for your answer, it does exactly what I was trying to achieve, print the names of the volume grids stored on a Volume Loader with Python, I just added the GetName() on the last loop for that.

      Sorry about the rule violation, I thought it was a good idea to have the C++ and the Python code equivalent at the same place because of the same reason that you mentioned, if someone was looking for doing this they could find both versions at the same place, also as you mentioned, sometimes it can be tricky to decide when something is on-topic or not.

      Here is the updated code with the grid name:

      """Demonstrates accessing volume caches. Volumes are composed differently based on part of application using them but this script demonstrates how most of them can be accessed. """ import c4d doc: c4d.documents.BaseDocument # The active document op: c4d.BaseObject | None # The active object, None if unselected def main() -> None: """ """ if not op: return # Volume output is contained in the caches of objects. In this case an Ovolume is directly # the cache content of some tangible scene object. cache: c4d.BaseObject = op.GetCache() if cache.CheckType(c4d.Ovolume): print (f"{cache = }") # Sometimes, e.g., Pyro, volumes are loaded from VDB files on disk, in that case the loading # tangible scene object usually holds a Ovolumeloader as the first child of its cache. if cache.CheckType(c4d.Ovolumeloader): cache = cache.GetCache() # Many things contain not only a singular volume but sets of them. Which then hold their content # as children. Stuff can get more complex as always the case with caches in Cinema 4D, but the # cache structure of a Pyro Output object loading data from disk could look like this: # # PyroOutput # Cache: Ovolumeloader # Cache: Ovolumeset # Child: Ovolume (Color) # Child: Ovolume (Density) # ... if cache.CheckType(c4d.Ovolumeset): cache = cache.GetCache() for item in cache.GetChildren(): print (f"{item = }") print ("grid name = " + item.GetName()) if __name__ == '__main__': main()
    • C

      How to: Plugin parent folder on extensions menu

      Cinema 4D SDK
      • python • • cybor09
      5
      0
      Votes
      5
      Posts
      1.2k
      Views

      J

      Hello @cybor09 ,

      without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly.

      Thank you for your understanding,
      Maxon SDK Group

    • C

      Read Background Color from RS Camera

      Cinema 4D SDK
      • python 2023 • • cybor09
      3
      0
      Votes
      3
      Posts
      597
      Views

      C

      Thanks a lot for the quick response @ferdinand ! I'll use the raw int values then, thanks 🙂

    • C

      Python Field - Object Data Update

      Cinema 4D SDK
      • python r21 windows • • cybor09
      3
      0
      Votes
      3
      Posts
      741
      Views

      C

      Hello @m_magalhaes ,

      Thanks a lot for the tip, works perfectly as you said 😁

      Cinema_4D_F7fyNZcvZ4.gif