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. sawyerwolf19
    3. Topics
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by sawyerwolf19

    • S

      How to get the bounding box for the whole scene

      Cinema 4D SDK
      • python • • sawyerwolf19
      5
      0
      Votes
      5
      Posts
      1.5k
      Views

      ferdinandF

      Hey @mogh,

      Thank you for pointing out that problem. No, there is no Vector(0, 0, 0) being added, there was simply a small bug in my code.

      self.min: c4d.Vector = c4d.Vector(sys.float_info.max) self.max: c4d.Vector = c4d.Vector(sys.float_info.min)

      float_info.min is 2.2250738585072014e-308, i.e., the smallest representable increment of the float type, not the lower representable boundary. So, the code did initialize the max-value boundary as ~(0, 0, 0) which then caused values to be discarded which should not be discared. I of course meant here the following:

      self.min: c4d.Vector = c4d.Vector(sys.float_info.max) self.max: c4d.Vector = c4d.Vector(-sys.float_info.max)

      Fixing this should fix your problems. I have updated my original posting to not mislead future readers.

      Cheers,
      Ferdinand

    • S

      How to make Icon buttons and Shortcut in python plugin

      Cinema 4D SDK
      • python • • sawyerwolf19
      2
      0
      Votes
      2
      Posts
      459
      Views

      ManuelM

      Hi,
      Welcome to the forum, you do not need to be sorry, we all ask basic question.

      There are differences between creating a script and plugins. Script is something you create inside the Script Manager. You can save them in a file and this file extension is .py. Plugins are something you must create in an external editor and save the file with the extension .pyp or .pypv (for encrypted files) with a certain plugin structure

      There are differents way to create an icon and a shortcut.
      icon for script:

      as state here, you can just use the command in the Script Manager to load a file that will be used as the icon for that script. If you save the script or already saved it, the picture will be saved in the same directory with the same name as the script. save the picture you want to use for a script in the same directory than your script with the same filename.

      icon for plugins:
      Plugins are registered using register commands like RegisterCommandPlugin, most of those commands allow you to pass as an argument the bitmap that will be used as the icon for that plugin.

      Shortcuts:
      To create shortcuts you must use the function AddShortcut you can check this thread where Maxime answer the question in the second part of his thread.

      Finally, you might want to create a palette to store your different icons and add the possibility to load the palette. Ferdinand answer this question in this thread.

      Cheers,
      Manuel