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
    • Register
    • Login
    1. Home
    2. cybor09
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 9
    • Best 0
    • Controversial 0
    • Groups 0

    cybor09

    @cybor09

    0
    Reputation
    22
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    cybor09 Unfollow Follow

    Latest posts made by cybor09

    • RE: How to install pip and numpy for Cinema 4D 2024 on MacOS?

      Hi!

      Maybe this video can help you:

      https://lesterbanks.com/2019/10/how-to-install-a-3rd-party-python-library-in-cinema-4d/

      posted in Cinema 4D SDK
      C
      cybor09
    • RE: How to access Volume Data?

      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()
      
      posted in Cinema 4D SDK
      C
      cybor09
    • RE: How to: Plugin parent folder on extensions menu

      That's great, thanks a lot for your answer @i_mazlov , may I ask if is possible to add also an Icon to the parent folder? and if is possible to add subfolders too like on the scripts?

      Thanks again.

      posted in Cinema 4D SDK
      C
      cybor09
    • How to access Volume Data?

      @s_bach said in Ovolumeloader:

      Hello,

      a volume loader is just an ordinary generator. This means the stuff it creates is in its cache. You can access the volumes stored in its cache as usual:

      if (baseObject->IsInstanceOf(Ovolumeloader) == false)
        return maxon::IllegalArgumentError(MAXON_SOURCE_LOCATION);
      
      BaseObject* const cache = baseObject->GetCache();
      if (cache == nullptr)
        return maxon::IllegalArgumentError(MAXON_SOURCE_LOCATION);
      
      if (cache->IsInstanceOf(Ovolume) == false)
        return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
      
      const VolumeObject* const volumeObject = static_cast<VolumeObject*>(cache);
      
      ApplicationOutput("Volume Object: " + volumeObject->GetName());
      

      See also VolumeObject Manual.

      best wishes,
      Sebastian

      Hello guys!

      May I ask if this is possible to do with Python too? I tried but the equivalent of cache.IsInstanceOf(c4d.Ovolume) is not returning True.

      Thanks!

      posted in Cinema 4D SDK
      C
      cybor09
    • How to: Plugin parent folder on extensions menu

      Hello!

      I want to ask if someone knows how to add a "parent" plugin folder into the Extensions menu like this example:

      ee32d53a-4e03-454f-b5ce-73d78c963904-image.png

      I saw the CV-ArtSmart .pyp but I didn't understand how to put that parent and all the plugins inside of it.

      I discovered if I create one folder on the plugins folder, and them each children plugin as folders it will appears as I want but that's not the most efficient way to do it if the plugins will share data that I need to duplicate on each sub folder, what's why I'm trying to get a solution similar to this example.

      Thanks!

      posted in Cinema 4D SDK python
      C
      cybor09
    • RE: Read Background Color from RS Camera

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

      posted in Cinema 4D SDK
      C
      cybor09
    • Read Background Color from RS Camera

      Hello!

      It is possible to read somehow the Color parameter from the Background section of the RS Camera?

      RSCamera[c4d.RSCAMERAOBJECT_BACKGROUND_COLOR]
      

      If I try to read it directly, it returns an error, and I didn't find a secondary ID to passtrough the value like in the RS Dome Light:

      RSDomeLight[c4d.REDSHIFT_LIGHT_DOME_TEX0, c4d.REDSHIFT_FILE_PATH]
      

      This is on C4D 2023.2.1and RS 3.5.16.

      Thanks!

      posted in Cinema 4D SDK python 2023
      C
      cybor09
    • RE: Python Field - Object Data Update

      Hello @m_magalhaes ,

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

      Cinema_4D_F7fyNZcvZ4.gif

      posted in Cinema 4D SDK
      C
      cybor09
    • Python Field - Object Data Update

      Hello,

      I created my first Python Field script, it measure the distance between one camera and each clone, everything works almost fine at this point but I don't know why for some reason, when I move the camera the field doesn't update the data from the camera position.

      I need to disable and re-enable the field to update the camera data, I also tried to add "c4d.EventAdd()" on the script to force the refresh but didn't worked, someone know what I'm missing to get a proper update of the field when I move the camera?

      You will find the demo file below, thanks a lot.

      explorer_2fZHQMkqfj.gif

      c4d camera field.c4d

      posted in Cinema 4D SDK python r21 windows
      C
      cybor09