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

    Animated gif

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 938 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 11/11/2017 at 06:44, xxxxxxxx wrote:

      Is it possible to use an animated gif as a user data icon?

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

        On 13/11/2017 at 02:42, xxxxxxxx wrote:

        Hi,

        I guess you are talking about using an animated GIF in a BitmapButton or as a registered icon for a plugin? No, that is not possible.

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

          On 13/11/2017 at 04:56, xxxxxxxx wrote:

          Okay. Thanks. That would be a cool feature.

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

            On 13/11/2017 at 05:13, xxxxxxxx wrote:

            Actually you can do it. But it wouldn't be a Maxon recommended way. And I also do not recommend to do it, for some perormance reason and also as c4d user I will hate to have a GIF as an icon. Since you can easily screw up all the UI very easily with those scripts.

            1. First step is to convert your GIF to a suite of PNG file. (1 png per frame) https://stackoverflow.com/questions/4904940/python-converting-gif-frames-to-png Which use Pillow (an externa python library)
            2. Then when you have your png you can load it as a list of PNG, make a list of baseBitmap (in order to optimize a bit and avoid loading at each frame)
            3. Then with the following script you can swap any picture inside any icon. https://developers.maxon.net/forum/topic/7462/9284_change-icon-based-on-state-in-commanddata&PID=36785#36785
            4. Finally you have to register a plugin (MessagePlugin?) in order to set a timer and redraw the next PNG of your list of PNG. And you got your animated GIF inside Cinema4D.
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 13/11/2017 at 05:37, xxxxxxxx wrote:

              Yeow! Excellent! Thanks for providing this. I will test it out.

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

                On 13/11/2017 at 05:40, xxxxxxxx wrote:

                gr4ph0s, are you available for freelance work?

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

                  On 13/11/2017 at 06:01, xxxxxxxx wrote:

                  I sent you a pm about freelancing. 
                  Another point I didn't mention, the trick used in the post of Niklas is only possible because c4d.gui.Geticon() return a reference to the actual c4d.BaseBitmap of the icon and not a copy. This behavior may be changed in future, or not. Its in the hand of Maxon. 
                  Otherwise you would have to Unregister(c4d.gui.UnregisterIcon) old icon then Register back the new icon(c4d.gui.RegisterIcon), then refresh the UI.

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